| Conditions | 3 |
| Paths | 3 |
| Total Lines | 18 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 10 |
| CRAP Score | 3 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 36 | 3 | private function getTotalDistance(): float | int |
|
| 37 | { |
||
| 38 | 3 | if (count($this->sequence) < 2) { |
|
| 39 | 2 | return 0; |
|
| 40 | } |
||
| 41 | |||
| 42 | 1 | $totalDistance = 0; |
|
| 43 | |||
| 44 | 1 | $sequence = $this->sequence; |
|
| 45 | |||
| 46 | 1 | $previousNode = array_shift($sequence); |
|
| 47 | 1 | foreach ($sequence as $node) { |
|
| 48 | 1 | $totalDistance += $this->graph->getLink($previousNode, $node)->getDistance(); |
|
| 49 | |||
| 50 | 1 | $previousNode = $node; |
|
| 51 | } |
||
| 52 | |||
| 53 | 1 | return $totalDistance; |
|
| 54 | } |
||
| 56 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.