Code Duplication    Length = 9-11 lines in 2 locations

app/Controller/HourglassController.php 1 location

@@ 380-390 (lines=11) @@
377
			return $depth;
378
		}
379
		$maxdc = $depth;
380
		foreach ($individual->getSpouseFamilies() as $family) {
381
			foreach ($family->getChildren() as $child) {
382
				$dc = $this->maxDescendencyGenerations($child, $depth + 1);
383
				if ($dc >= $this->generations) {
384
					return $dc;
385
				}
386
				if ($dc > $maxdc) {
387
					$maxdc = $dc;
388
				}
389
			}
390
		}
391
392
		$maxdc++;
393
		if ($maxdc == 1) {

app/Controller/FamilyBookController.php 1 location

@@ 326-334 (lines=9) @@
323
		}
324
		$maxdc = $depth;
325
		foreach ($person->getSpouseFamilies() as $family) {
326
			foreach ($family->getChildren() as $child) {
327
				$dc = $this->maxDescendencyGenerations($child->getXref(), $depth + 1);
328
				if ($dc >= $this->generations) {
329
					return $dc;
330
				}
331
				if ($dc > $maxdc) {
332
					$maxdc = $dc;
333
				}
334
			}
335
		}
336
		$maxdc++;
337
		if ($maxdc == 1) {