Code Duplication    Length = 8-8 lines in 2 locations

src/Http/Api/ReportController.php 2 locations

@@ 103-110 (lines=8) @@
100
                $sprint = Sprint::where('project_key', $project_key)
101
                    ->where('status', 'active')
102
                    ->first();
103
                if ($sprint) {
104
                    $filters[$key]['query'] = [ 'sprints' => $sprint->no ];
105
                }
106
                else
107
                {
108
                    unset($filters[$key]);
109
                }
110
            }
111
            else if ($filter['id'] === 'latest_completed_sprint') {
112
                $sprint = Sprint::where('project_key', $project_key)
113
                    ->where('status', 'completed')
@@ 116-123 (lines=8) @@
113
                    ->where('status', 'completed')
114
                    ->orderBy('no', 'desc')
115
                    ->first();
116
                if ($sprint) {
117
                    $filters[$key]['query'] = [ 'sprints' => $sprint->no ];
118
                }
119
                else
120
                {
121
                    unset($filters[$key]);
122
                }
123
            }
124
            else if ($filter['id'] === 'will_release_version') {
125
                $version = Version::where('project_key', $project_key)
126
                    ->where('status', 'unreleased')