Conditions | 1 |
Paths | 1 |
Total Lines | 16 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 9 |
CRAP Score | 1 |
Changes | 0 |
1 | <?php |
||
16 | 1 | public function importFlow($label, $flowJson) |
|
17 | { |
||
18 | 1 | $nodes = json_decode($flowJson, true); |
|
|
|||
19 | |||
20 | 1 | $id = uniqid(); |
|
21 | |||
22 | $body = [ |
||
23 | 1 | 'id' => $id, |
|
24 | 1 | 'label' => $label, |
|
25 | 1 | 'nodes' => $this->getNodes($id, $flowJson) |
|
26 | 1 | ]; |
|
27 | |||
28 | 1 | $data = $this->instance->jsonPost('flow', $body, $this->token); |
|
29 | |||
30 | 1 | return $data['id']; |
|
31 | } |
||
32 | |||
57 |
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.