1 | <?php |
||
21 | class IssuesController extends Controller |
||
22 | { |
||
23 | |||
24 | protected $active_item = 'issues'; |
||
25 | /** |
||
26 | * Display a listing of the resource. |
||
27 | * |
||
28 | * @return \Illuminate\Http\Response |
||
29 | */ |
||
30 | |||
31 | public function index($namespace, $project_path) |
||
41 | |||
42 | public function new($namespace, $project_path) |
||
51 | |||
52 | /** |
||
53 | * Show the form for creating a new resource. |
||
54 | * |
||
55 | * @return \Illuminate\Http\Response |
||
56 | */ |
||
57 | public function create($namespace, $project_path) |
||
77 | |||
78 | /** |
||
79 | * Display the specified resource. |
||
80 | * |
||
81 | * @param int $id |
||
82 | * @return \Illuminate\Http\Response |
||
83 | */ |
||
84 | public function show($namespace, $project, Issue $issue) |
||
88 | |||
89 | /** |
||
90 | * Show the form for editing the specified resource. |
||
91 | * |
||
92 | * @param int $id |
||
93 | * @return \Illuminate\Http\Response |
||
94 | */ |
||
95 | public function edit($id) |
||
99 | |||
100 | /** |
||
101 | * Update the specified resource in storage. |
||
102 | * |
||
103 | * @param \Illuminate\Http\Request $request |
||
104 | * @param int $id |
||
105 | * @return \Illuminate\Http\Response |
||
106 | */ |
||
107 | public function update(Request $request, $id) |
||
111 | |||
112 | /** |
||
113 | * Remove the specified resource from storage. |
||
114 | * |
||
115 | * @param int $id |
||
116 | * @return \Illuminate\Http\Response |
||
117 | */ |
||
118 | public function destroy($id) |
||
122 | } |
||
123 |
This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.
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.