| Conditions | 3 |
| Paths | 3 |
| Total Lines | 14 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 0 | ||
| 1 | <?php declare(strict_types=1); |
||
| 12 | public function calculateScore(ParsedHeaders $scanResult) |
||
| 13 | { |
||
| 14 | $possibleScore = 0; |
||
| 15 | $penalties = 0; |
||
| 16 | |||
| 17 | foreach ($scanResult->all() as $header) { |
||
| 18 | $possibleScore++; |
||
| 19 | |||
| 20 | if (!$header->isSecure()) { |
||
| 21 | $penalties += 0.3; |
||
| 22 | } |
||
| 23 | } |
||
| 24 | |||
| 25 | return ($possibleScore - $penalties); |
||
| 26 | } |
||
| 28 |