Code Duplication    Length = 5-5 lines in 8 locations

edit_interface.php 8 locations

@@ 846-850 (lines=5) @@
843
	$gedrec = '0 @REF@ INDI';
844
	$gedrec .= FunctionsEdit::addNewName();
845
	$gedrec .= FunctionsEdit::addNewSex();
846
	if (preg_match_all('/([A-Z0-9_]+)/', $controller->tree()->getPreference('QUICK_REQUIRED_FACTS'), $matches)) {
847
		foreach ($matches[1] as $match) {
848
			$gedrec .= FunctionsEdit::addNewFact($match);
849
		}
850
	}
851
	$gedrec .= "\n" . GedcomCodePedi::createNewFamcPedi($PEDI, $xref);
852
	if (Filter::postBool('SOUR_INDI')) {
853
		$gedrec = FunctionsEdit::handleUpdates($gedrec);
@@ 937-941 (lines=5) @@
934
	$gedcom .= FunctionsEdit::addNewName();
935
	$gedcom .= FunctionsEdit::addNewSex();
936
	$gedcom .= "\n" . GedcomCodePedi::createNewFamcPedi($PEDI, $family->getXref());
937
	if (preg_match_all('/([A-Z0-9_]+)/', $controller->tree()->getPreference('QUICK_REQUIRED_FACTS'), $matches)) {
938
		foreach ($matches[1] as $match) {
939
			$gedcom .= FunctionsEdit::addNewFact($match);
940
		}
941
	}
942
	if (Filter::postBool('SOUR_INDI')) {
943
		$gedcom = FunctionsEdit::handleUpdates($gedcom);
944
	} else {
@@ 1015-1019 (lines=5) @@
1012
	$gedcom = '0 @NEW@ INDI';
1013
	$gedcom .= FunctionsEdit::addNewName();
1014
	$gedcom .= FunctionsEdit::addNewSex();
1015
	if (preg_match_all('/([A-Z0-9_]+)/', $controller->tree()->getPreference('QUICK_REQUIRED_FACTS'), $matches)) {
1016
		foreach ($matches[1] as $match) {
1017
			$gedcom .= FunctionsEdit::addNewFact($match);
1018
		}
1019
	}
1020
	if (Filter::postBool('SOUR_INDI')) {
1021
		$gedcom = FunctionsEdit::handleUpdates($gedcom);
1022
	} else {
@@ 1075-1079 (lines=5) @@
1072
	$gedrec = '0 @REF@ INDI';
1073
	$gedrec .= FunctionsEdit::addNewName();
1074
	$gedrec .= FunctionsEdit::addNewSex();
1075
	if (preg_match_all('/([A-Z0-9_]+)/', $controller->tree()->getPreference('QUICK_REQUIRED_FACTS'), $matches)) {
1076
		foreach ($matches[1] as $match) {
1077
			$gedrec .= FunctionsEdit::addNewFact($match);
1078
		}
1079
	}
1080
	if (Filter::postBool('SOUR_INDI')) {
1081
		$gedrec = FunctionsEdit::handleUpdates($gedrec);
1082
	} else {
@@ 1141-1145 (lines=5) @@
1138
	$indi_gedcom = '0 @REF@ INDI';
1139
	$indi_gedcom .= FunctionsEdit::addNewName();
1140
	$indi_gedcom .= FunctionsEdit::addNewSex();
1141
	if (preg_match_all('/([A-Z0-9_]+)/', $controller->tree()->getPreference('QUICK_REQUIRED_FACTS'), $matches)) {
1142
		foreach ($matches[1] as $match) {
1143
			$indi_gedcom .= FunctionsEdit::addNewFact($match);
1144
		}
1145
	}
1146
	if (Filter::postBool('SOUR_INDI')) {
1147
		$indi_gedcom = FunctionsEdit::handleUpdates($indi_gedcom);
1148
	} else {
@@ 1153-1157 (lines=5) @@
1150
	}
1151
1152
	$fam_gedcom = '';
1153
	if (preg_match_all('/([A-Z0-9_]+)/', $controller->tree()->getPreference('QUICK_REQUIRED_FAMFACTS'), $matches)) {
1154
		foreach ($matches[1] as $match) {
1155
			$fam_gedcom .= FunctionsEdit::addNewFact($match);
1156
		}
1157
	}
1158
	if (Filter::postBool('SOUR_FAM')) {
1159
		$fam_gedcom = FunctionsEdit::handleUpdates($fam_gedcom);
1160
	} else {
@@ 1231-1235 (lines=5) @@
1228
	$gedrec = '0 @REF@ INDI';
1229
	$gedrec .= FunctionsEdit::addNewName();
1230
	$gedrec .= FunctionsEdit::addNewSex();
1231
	if (preg_match_all('/([A-Z0-9_]+)/', $controller->tree()->getPreference('QUICK_REQUIRED_FACTS'), $matches)) {
1232
		foreach ($matches[1] as $match) {
1233
			$gedrec .= FunctionsEdit::addNewFact($match);
1234
		}
1235
	}
1236
1237
	if (Filter::postBool('SOUR_INDI')) {
1238
		$gedrec = FunctionsEdit::handleUpdates($gedrec);
@@ 1252-1256 (lines=5) @@
1249
		$family->createFact('1 HUSB @' . $spouse->getXref() . '@', true);
1250
	}
1251
	$famrec = '';
1252
	if (preg_match_all('/([A-Z0-9_]+)/', $controller->tree()->getPreference('QUICK_REQUIRED_FAMFACTS'), $matches)) {
1253
		foreach ($matches[1] as $match) {
1254
			$famrec .= FunctionsEdit::addNewFact($match);
1255
		}
1256
	}
1257
	if (Filter::postBool('SOUR_FAM')) {
1258
		$famrec = FunctionsEdit::handleUpdates($famrec);
1259
	} else {