| Conditions | 3 |
| Paths | 3 |
| Total Lines | 12 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 3.0175 |
| Changes | 0 | ||
| 1 | <?php |
||
| 60 | 4 | protected function getCSV($file_name, $search) |
|
| 61 | { |
||
| 62 | 4 | $ch = fopen($file_name, "r"); |
|
| 63 | 4 | $header_row = fgetcsv($ch); |
|
|
|
|||
| 64 | |||
| 65 | // This will loop through all the rows until it reaches the end |
||
| 66 | 4 | while ($row = fgetcsv($ch)) { |
|
| 67 | 4 | if (in_array($search, $row)) { |
|
| 68 | return $row; |
||
| 69 | } |
||
| 70 | 4 | } |
|
| 71 | 4 | } |
|
| 72 | } |
||
| 73 |
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.