Code Duplication    Length = 4-9 lines in 2 locations

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

@@ 212-215 (lines=4) @@
209
		foreach($registration_rows as $reg_row){
210
			if ( is_array( $reg_row ) ) {
211
				$reg_csv_array = array();
212
				if( ! $event_id ){
213
					//get the event's name and Id
214
					$reg_csv_array[ __( 'Event', 'event_espresso' ) ] = sprintf( __( '%1$s (%2$s)', 'event_espresso' ), \EEH_Export::prepare_value_from_db_for_display( \EEM_Event::instance(), 'EVT_name', $reg_row[ 'Event_CPT.post_title'] ), $reg_row[ 'Event_CPT.ID' ] );
215
				}
216
				$is_primary_reg = $reg_row[ 'Registration.REG_count' ] == '1' ? true : false;
217
				/*@var $reg_row EE_Registration */
218
				foreach($reg_fields_to_include as $field_name){
@@ 324-332 (lines=9) @@
321
				);
322
				//now fill out the questions THEY answered
323
				foreach( $answers as $answer_row ){
324
					if( $answer_row[ 'Question.QST_ID' ] ){
325
						$question_label = \EEH_Export::prepare_value_from_db_for_display(
326
							\EEM_Question::instance(),
327
							'QST_admin_label',
328
							$answer_row[ 'Question.QST_admin_label' ]
329
						);
330
					} else {
331
						$question_label = sprintf( __( 'Question $s', 'event_espresso' ), $answer_row[ 'Answer.QST_ID' ] );
332
					}
333
					if ( isset( $answer_row[ 'Question.QST_type' ] )
334
						 && $answer_row[ 'Question.QST_type' ] == \EEM_Question::QST_type_state
335
					) {