Code Duplication    Length = 9-9 lines in 6 locations

src/diag/index.php 6 locations

@@ 376-384 (lines=9) @@
373
                        mysqli_free_result($res);
374
                        $message = '<a class="pass">PASS</a> <i>(MySQL / feature level ' . $row['var_value'] . ')</i>';
375
                    }
376
                    else
377
                    {
378
                        $errno = mysqli_errno($link);
379
                        $error = mysqli_error($link);
380
381
                        $message = ($errno == 0 || strlen($error) == 0)
382
                                 ? '<a class="fail">FAIL</a> <i>(unknown MySQL error on fetching data)</i>'
383
                                 : '<a class="fail">FAIL</a> <i>(MySQL error #' . $errno . ' on fetching data - ' . $error . ')</i>';
384
                    }
385
                }
386
                else
387
                {
@@ 386-394 (lines=9) @@
383
                                 : '<a class="fail">FAIL</a> <i>(MySQL error #' . $errno . ' on fetching data - ' . $error . ')</i>';
384
                    }
385
                }
386
                else
387
                {
388
                    $errno = mysqli_errno($link);
389
                    $error = mysqli_error($link);
390
391
                    $message = ($errno == 0 || strlen($error) == 0)
392
                             ? '<a class="fail">FAIL</a> <i>(unknown MySQL error on query database)</i>'
393
                             : '<a class="fail">FAIL</a> <i>(MySQL error #' . $errno . ' on query database - ' . $error . ')</i>';
394
                }
395
396
                mysqli_close($link);
397
            }
@@ 425-433 (lines=9) @@
422
                            {
423
                                $message = '<a class="pass">PASS</a> <i>(MySQL / feature level ' . $row['var_value'] . ')</i>';
424
                            }
425
                            else
426
                            {
427
                                $errno = mysql_errno($link);
428
                                $error = mysql_error($link);
429
430
                                $message = ($errno == 0 || strlen($error) == 0)
431
                                         ? '<a class="fail">FAIL</a> <i>(unknown MySQL error on releasing recordset)</i>'
432
                                         : '<a class="fail">FAIL</a> <i>(MySQL error #' . $errno . ' on releasing recordset - ' . $error . ')</i>';
433
                            }
434
                        }
435
                        else
436
                        {
@@ 435-443 (lines=9) @@
432
                                         : '<a class="fail">FAIL</a> <i>(MySQL error #' . $errno . ' on releasing recordset - ' . $error . ')</i>';
433
                            }
434
                        }
435
                        else
436
                        {
437
                            $errno = mysql_errno($link);
438
                            $error = mysql_error($link);
439
440
                            $message = ($errno == 0 || strlen($error) == 0)
441
                                     ? '<a class="fail">FAIL</a> <i>(unknown MySQL error on fetching data)</i>'
442
                                     : '<a class="fail">FAIL</a> <i>(MySQL error #' . $errno . ' on fetching data - ' . $error . ')</i>';
443
                        }
444
                    }
445
                    else
446
                    {
@@ 445-453 (lines=9) @@
442
                                     : '<a class="fail">FAIL</a> <i>(MySQL error #' . $errno . ' on fetching data - ' . $error . ')</i>';
443
                        }
444
                    }
445
                    else
446
                    {
447
                        $errno = mysql_errno($link);
448
                        $error = mysql_error($link);
449
450
                        $message = ($errno == 0 || strlen($error) == 0)
451
                                 ? '<a class="fail">FAIL</a> <i>(unknown MySQL error on query database)</i>'
452
                                 : '<a class="fail">FAIL</a> <i>(MySQL error #' . $errno . ' on query database - ' . $error . ')</i>';
453
                    }
454
                }
455
                else
456
                {
@@ 455-463 (lines=9) @@
452
                                 : '<a class="fail">FAIL</a> <i>(MySQL error #' . $errno . ' on query database - ' . $error . ')</i>';
453
                    }
454
                }
455
                else
456
                {
457
                    $errno = mysql_errno($link);
458
                    $error = mysql_error($link);
459
460
                    $message = ($errno == 0 || strlen($error) == 0)
461
                             ? '<a class="fail">FAIL</a> <i>(unknown MySQL error on selecting database)</i>'
462
                             : '<a class="fail">FAIL</a> <i>(MySQL error #' . $errno . ' on selecting database - ' . $error . ')</i>';
463
                }
464
465
                mysql_close($link);
466
            }