Code Duplication    Length = 3-7 lines in 3 locations

src/Hal/Metric/System/Changes/GitChanges.php 3 locations

@@ 86-88 (lines=3) @@
83
84
                if (isset($date)) {
85
                    // new head line ($author is set). Consolidate now for last commit
86
                    if (!isset($history[$date])) {
87
                        $history[$date] = ['nbFiles' => 0, 'additions' => 0, 'removes' => 0];
88
                    }
89
                    $history[$date]['nbFiles'] += $localFiles['nbFiles'];
90
                    $history[$date]['additions'] += $localFiles['additions'];
91
                    $history[$date]['removes'] += $localFiles['removes'];
@@ 108-110 (lines=3) @@
105
                }
106
107
                // author
108
                if (!isset($authors[$author])) {
109
                    $authors[$author] = ['nbFiles' => 0, 'commits' => 0, 'additions' => 0, 'removes' => 0];
110
                }
111
                $authors[$author]['commits']++;
112
113
            } else {
@@ 150-156 (lines=7) @@
147
        $last = time();
148
        while ($current <= $last) {
149
            $key = date($dateFormat, $current);
150
            if (!isset($history[$key])) {
151
                $history[$key] = [
152
                    'nbFiles' => 0,
153
                    'additions' => 0,
154
                    'removes' => 0,
155
                ];
156
            }
157
            $current = strtotime('+7 day', $current);
158
        }
159