Conditions | 4 |
Paths | 3 |
Total Lines | 25 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 20 |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php |
||
19 | public function handle(Request $request, Closure $next) |
||
20 | { |
||
21 | $response = $next($request); |
||
22 | |||
23 | $request_uri = $request->getUri(); |
||
|
|||
24 | $excluded = config('lodash.xss.exclude_uris'); |
||
25 | if (! empty($excluded)) { |
||
26 | foreach ($excluded as $uri) { |
||
27 | if (strpos($uri, '/itdc/debug') !== false) { |
||
28 | return $response; |
||
29 | } |
||
30 | } |
||
31 | } |
||
32 | |||
33 | // http://blogs.msdn.com/b/ieinternals/archive/2010/03/30/combating-clickjacking-with-x-frame-options.aspx |
||
34 | $response->headers->set('X-Frame-Options', config('lodash.xss.x_frame_options'), true); |
||
35 | |||
36 | // http://msdn.microsoft.com/en-us/library/ie/gg622941(v=vs.85).aspx |
||
37 | $response->headers->set('X-Content-Type-Options', config('lodash.xss.x_content_type_options'), true); |
||
38 | |||
39 | // http://msdn.microsoft.com/en-us/library/dd565647(v=vs.85).aspx |
||
40 | $response->headers->set('X-XSS-Protection', config('lodash.xss.x_xss_protection'), true); |
||
41 | |||
42 | return $response; |
||
43 | } |
||
44 | } |
||
45 |
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.