Code Duplication    Length = 4-9 lines in 2 locations

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

@@ 209-212 (lines=4) @@
206
		foreach($registration_rows as $reg_row){
207
			if ( is_array( $reg_row ) ) {
208
				$reg_csv_array = array();
209
				if( ! $event_id ){
210
					//get the event's name and Id
211
					$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' ] );
212
				}
213
				$is_primary_reg = $reg_row[ 'Registration.REG_count' ] == '1' ? true : false;
214
				/*@var $reg_row EE_Registration */
215
				foreach($reg_fields_to_include as $field_name){
@@ 321-329 (lines=9) @@
318
				);
319
				//now fill out the questions THEY answered
320
				foreach( $answers as $answer_row ){
321
					if( $answer_row[ 'Question.QST_ID' ] ){
322
						$question_label = \EEH_Export::prepare_value_from_db_for_display(
323
							\EEM_Question::instance(),
324
							'QST_admin_label',
325
							$answer_row[ 'Question.QST_admin_label' ]
326
						);
327
					} else {
328
						$question_label = sprintf( __( 'Question $s', 'event_espresso' ), $answer_row[ 'Answer.QST_ID' ] );
329
					}
330
					if ( isset( $answer_row[ 'Question.QST_type' ] )
331
						 && $answer_row[ 'Question.QST_type' ] == \EEM_Question::QST_type_state
332
					) {