Code Duplication    Length = 4-9 lines in 2 locations

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

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