| Conditions | 2 |
| Paths | 2 |
| Total Lines | 17 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 11 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 28 | 5 | public function parse(TokenStream $tokenStream) |
|
| 29 | { |
||
| 30 | 5 | $limit = null; |
|
|
|
|||
| 31 | 5 | $offset = null; |
|
| 32 | |||
| 33 | 5 | $tokenStream->expect(Token::T_OPERATOR, 'limit'); |
|
| 34 | 5 | $tokenStream->expect(Token::T_OPEN_PARENTHESIS); |
|
| 35 | |||
| 36 | 5 | $limit = $this->valueParser->parse($tokenStream); |
|
| 37 | 3 | if ($tokenStream->nextIf(Token::T_COMMA)) { |
|
| 38 | 3 | $offset = $this->valueParser->parse($tokenStream); |
|
| 39 | 2 | } |
|
| 40 | |||
| 41 | 2 | $tokenStream->expect(Token::T_CLOSE_PARENTHESIS); |
|
| 42 | |||
| 43 | 1 | return new LimitNode($limit, $offset); |
|
| 44 | } |
||
| 45 | |||
| 54 |
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.