Conditions | 2 |
Paths | 2 |
Total Lines | 14 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
10 | public function testSetDataType() |
||
11 | { |
||
12 | $dataTypeValues = [ |
||
13 | 'Number', |
||
14 | 'String', |
||
15 | ]; |
||
16 | |||
17 | $testInstance = new DataSeriesValues(); |
||
18 | |||
19 | foreach ($dataTypeValues as $dataTypeValue) { |
||
20 | $result = $testInstance->setDataType($dataTypeValue); |
||
21 | $this->assertTrue($result instanceof DataSeriesValues); |
||
22 | } |
||
23 | } |
||
24 | |||
50 |
This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.
Both the
$myVar
assignment in line 1 and the$higher
assignment in line 2 are dead. The first because$myVar
is never used and the second because$higher
is always overwritten for every possible time line.