Code Duplication    Length = 19-26 lines in 2 locations

main/survey/survey.lib.php 2 locations

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