Code Duplication    Length = 11-12 lines in 2 locations

includes/diff/DiffEngine.php 2 locations

@@ 749-759 (lines=11) @@
746
			}
747
748
			$progress = $x + $y;
749
			if ( $progress > $max_progress[0][2] ) {
750
				$num_progress = 0;
751
				$max_progress[0][0] = $x;
752
				$max_progress[0][1] = $y;
753
				$max_progress[0][2] = $progress;
754
			} elseif ( $progress == $max_progress[0][2] ) {
755
				++$num_progress;
756
				$max_progress[$num_progress][0] = $x;
757
				$max_progress[$num_progress][1] = $y;
758
				$max_progress[$num_progress][2] = $progress;
759
			}
760
		}
761
762
		$max_progress_forward = true; // initially the maximum
@@ 775-786 (lines=12) @@
772
			}
773
774
			$progress = $N - $x + $M - $y;
775
			if ( $progress > $max_progress[0][2] ) {
776
				$num_progress = 0;
777
				$max_progress_forward = false;
778
				$max_progress[0][0] = $x;
779
				$max_progress[0][1] = $y;
780
				$max_progress[0][2] = $progress;
781
			} elseif ( $progress == $max_progress[0][2] && !$max_progress_forward ) {
782
				++$num_progress;
783
				$max_progress[$num_progress][0] = $x;
784
				$max_progress[$num_progress][1] = $y;
785
				$max_progress[$num_progress][2] = $progress;
786
			}
787
		}
788
789
		// return the middle diagonal with maximal progress.