Code Duplication    Length = 19-26 lines in 2 locations

main/survey/survey.lib.php 2 locations

@@ 3446-3471 (lines=26) @@
3443
                        $tableHtml .=  '	<tr>';
3444
                        for ($ii = 0; $ii <= count($question_x['answers']); $ii++) {
3445
                            if ($question_x['type'] == 'score') {
3446
                                for ($x = 1; $x <= $question_x['maximum_score']; $x++) {
3447
                                    if ($ii == 0) {
3448
                                        $tableHtml .=  ' <th>'.$question_y['answers'][($ij)].' '.$y.'</th>';
3449
                                        break;
3450
                                    } else {
3451
                                        $tableHtml .=  ' <td align="center">';
3452
                                        $votes = SurveyUtil::comparative_check(
3453
                                            $answers_x,
3454
                                            $answers_y,
3455
                                            $question_x['answersid'][($ii - 1)],
3456
                                            $question_y['answersid'][($ij)],
3457
                                            $x,
3458
                                            $y
3459
                                        );
3460
                                        $tableHtml .=  $votes;
3461
                                        array_push(
3462
                                            $chartData,
3463
                                            array(
3464
                                                'serie' => array($currentYQuestion, $xOptions[$ii-1]),
3465
                                                'option' => $x,
3466
                                                'votes' => $votes
3467
                                            )
3468
                                        );
3469
                                        $tableHtml .=  '</td>';
3470
                                    }
3471
                                }
3472
                            } else {
3473
                                if ($ii == 0) {
3474
                                    $tableHtml .=  '<th>'.$question_y['answers'][$ij].' '.$y.'</th>';
@@ 3506-3524 (lines=19) @@
3503
                    $tableHtml .=  '	<tr>';
3504
                    for ($ii = 0; $ii <= count($question_x['answers']); $ii++) {
3505
                        if ($question_x['type'] == 'score') {
3506
                            for ($x = 1; $x <= $question_x['maximum_score']; $x++) {
3507
                                if ($ii == 0) {
3508
                                    $tableHtml .=  '		<th>'.$question_y['answers'][$ij].'</th>';
3509
                                    break;
3510
                                } else {
3511
                                    $tableHtml .=  '		<td align="center">';
3512
                                    $votes =  SurveyUtil::comparative_check($answers_x, $answers_y, $question_x['answersid'][($ii-1)], $question_y['answersid'][($ij)], $x, 0);
3513
                                    $tableHtml .= $votes;
3514
                                    array_push(
3515
                                        $chartData,
3516
                                        array(
3517
                                            'serie' => array($currentYQuestion, $xOptions[$ii-1]),
3518
                                            'option' => $x,
3519
                                            'votes' => $votes
3520
                                        )
3521
                                    );
3522
                                    $tableHtml .=  '</td>';
3523
                                }
3524
                            }
3525
                        } else {
3526
                            if ($ii == 0) {
3527
                                $tableHtml .=  '		<th>'.$question_y['answers'][($ij)].'</th>';