Code Duplication    Length = 10-10 lines in 3 locations

src/diag/index.php 3 locations

@@ 507-516 (lines=10) @@
504
                    {
505
                        $message = '<a class="pass">PASS</a> <i>(Microsoft SQL Server / feature level ' . $row['var_value'] . ')</i>';
506
                    }
507
                    else
508
                    {
509
                        $error = sqlsrv_errors(SQLSRV_ERR_ALL);
510
511
                        $message = (is_null($error))
512
                                 ? '<a class="fail">FAIL</a> <i>(unknown Microsoft SQL Server error on releasing recordset)</i>'
513
                                 : sprintf('<a class="fail">FAIL</a> <i>(Microsoft SQL Server error #%d on releasing recordset - %s)</i>',
514
                                           $error[0]['code'],
515
                                           $error[0]['message']);
516
                    }
517
                }
518
                else
519
                {
@@ 518-527 (lines=10) @@
515
                                           $error[0]['message']);
516
                    }
517
                }
518
                else
519
                {
520
                    $error = sqlsrv_errors(SQLSRV_ERR_ALL);
521
522
                    $message = (is_null($error))
523
                             ? '<a class="fail">FAIL</a> <i>(unknown Microsoft SQL Server error on fetching data)</i>'
524
                             : sprintf('<a class="fail">FAIL</a> <i>(Microsoft SQL Server error #%d on fetching data - %s)</i>',
525
                                       $error[0]['code'],
526
                                       $error[0]['message']);
527
                }
528
            }
529
            else
530
            {
@@ 529-538 (lines=10) @@
526
                                       $error[0]['message']);
527
                }
528
            }
529
            else
530
            {
531
                $error = sqlsrv_errors(SQLSRV_ERR_ALL);
532
533
                $message = (is_null($error))
534
                         ? '<a class="fail">FAIL</a> <i>(unknown Microsoft SQL Server error on query database)</i>'
535
                         : sprintf('<a class="fail">FAIL</a> <i>(Microsoft SQL Server error #%d on query database - %s)</i>',
536
                                   $error[0]['code'],
537
                                   $error[0]['message']);
538
            }
539
540
            sqlsrv_close($link);
541
        }