GlobalActivities   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 0
dl 0
loc 21
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 10 1
1
<?php
2
/**
3
 * GitScrum v0.1.
4
 *
5
 * @author  Renato Marinho <[email protected]>
6
 * @license http://opensource.org/licenses/GPL-3.0 GPLv3
7
 */
8
9
namespace GitScrum\Http\Middleware;
10
11
use Closure;
12
use GitScrum\Models\Sprint;
13
14
class GlobalActivities
15
{
16
    /**
17
     * Handle an incoming request.
18
     *
19
     * @param \Illuminate\Http\Request $request
20
     * @param \Closure                 $next
21
     *
22
     * @return mixed
23
     */
24
    public function handle($request, Closure $next)
25
    {
26
        $sprint = Sprint::slug($request->slug)
0 ignored issues
show
Unused Code introduced by
$sprint is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
27
            ->with('issues.statuses')
28
            ->first();
29
30
        //view()->share('globalActivities', $sprint->activities());
31
32
        return $next($request);
33
    }
34
}
35