| Conditions | 1 |
| Paths | 1 |
| Total Lines | 21 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 24 | public function handle($request, Closure $next) |
||
| 25 | { |
||
| 26 | $response = $next($request); |
||
| 27 | |||
| 28 | // Set security headers |
||
| 29 | $uri = $request->getUri(); |
||
|
|
|||
| 30 | |||
| 31 | // checking for debugger |
||
| 32 | //if (strpos($uri, '/itdc/debug') === false) { |
||
| 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', 'DENY', false); |
||
| 35 | //} |
||
| 36 | |||
| 37 | // http://msdn.microsoft.com/en-us/library/ie/gg622941(v=vs.85).aspx |
||
| 38 | $response->headers->set('X-Content-Type-Options', 'nosniff', false); |
||
| 39 | |||
| 40 | // http://msdn.microsoft.com/en-us/library/dd565647(v=vs.85).aspx |
||
| 41 | $response->headers->set('X-XSS-Protection', '1; mode=block', false); |
||
| 42 | |||
| 43 | return $response; |
||
| 44 | } |
||
| 45 | } |
||
| 46 |
This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.
Both the
$myVarassignment in line 1 and the$higherassignment in line 2 are dead. The first because$myVaris never used and the second because$higheris always overwritten for every possible time line.