Code Duplication    Length = 4-9 lines in 2 locations

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

@@ 184-187 (lines=4) @@
181
		foreach($registration_rows as $reg_row){
182
			if ( is_array( $reg_row ) ) {
183
				$reg_csv_array = array();
184
				if( ! $event_id ){
185
					//get the event's name and Id
186
					$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' ] );
187
				}
188
				$is_primary_reg = $reg_row[ 'Registration.REG_count' ] == '1' ? true : false;
189
				/*@var $reg_row EE_Registration */
190
				foreach($reg_fields_to_include as $field_name){
@@ 296-304 (lines=9) @@
293
				);
294
				//now fill out the questions THEY answered
295
				foreach( $answers as $answer_row ){
296
					if( $answer_row[ 'Question.QST_ID' ] ){
297
						$question_label = \EEH_Export::prepare_value_from_db_for_display(
298
							\EEM_Question::instance(),
299
							'QST_admin_label',
300
							$answer_row[ 'Question.QST_admin_label' ]
301
						);
302
					} else {
303
						$question_label = sprintf( __( 'Question $s', 'event_espresso' ), $answer_row[ 'Answer.QST_ID' ] );
304
					}
305
					if ( isset( $answer_row[ 'Question.QST_type' ] )
306
						 && $answer_row[ 'Question.QST_type' ] == \EEM_Question::QST_type_state
307
					) {