Code Duplication    Length = 4-9 lines in 2 locations

core/libraries/batch/JobHandlers/RegistrationsReport.php 2 locations

@@ 241-244 (lines=4) @@
238
        foreach ($registration_rows as $reg_row) {
239
            if (is_array($reg_row)) {
240
                $reg_csv_array = array();
241
                if ( ! $event_id) {
242
                    //get the event's name and Id
243
                    $reg_csv_array[__('Event', 'event_espresso')] = sprintf(__('%1$s (%2$s)', 'event_espresso'),
244
                        \EEH_Export::prepare_value_from_db_for_display(\EEM_Event::instance(), 'EVT_name',
245
                            $reg_row['Event_CPT.post_title']), $reg_row['Event_CPT.ID']);
246
                }
247
                $is_primary_reg = $reg_row['Registration.REG_count'] == '1' ? true : false;
@@ 371-379 (lines=9) @@
368
                ));
369
                //now fill out the questions THEY answered
370
                foreach ($answers as $answer_row) {
371
                    if ($answer_row['Question.QST_ID']) {
372
                        $question_label = \EEH_Export::prepare_value_from_db_for_display(\EEM_Question::instance(),
373
                            'QST_admin_label', $answer_row['Question.QST_admin_label']);
374
                    } else {
375
                        $question_label = sprintf(__('Question $s', 'event_espresso'), $answer_row['Answer.QST_ID']);
376
                    }
377
                    if (isset($answer_row['Question.QST_type'])
378
                        && $answer_row['Question.QST_type'] == \EEM_Question::QST_type_state
379
                    ) {
380
                        $reg_csv_array[$question_label] = \EEM_State::instance()
381
                                                                    ->get_state_name_by_ID($answer_row['Answer.ANS_value']);
382
                    } else {