Conditions | 4 |
Paths | 4 |
Total Lines | 20 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
9 | protected function isTSimpleIdentifierValid($TSimpleIdentifier) |
||
10 | { |
||
11 | if (!$this->isNCName($TSimpleIdentifier)) { |
||
12 | $msg = "Qualifier must be a valid NCName"; |
||
|
|||
13 | return false; |
||
14 | } |
||
15 | if (strlen($TSimpleIdentifier > 128)) { |
||
16 | $msg = "The maximum length permitted for qualifier is 128"; |
||
17 | return false; |
||
18 | } |
||
19 | // <!-- ECMAScript identifiers not starting with a '$' --> |
||
20 | if (!$this->matchesRegexPattern( |
||
21 | "[\p{L}\p{Nl}_][\p{L}\p{Nl}\p{Nd}\p{Mn}\p{Mc}\p{Pc}\p{Cf}]{0,}", |
||
22 | $TSimpleIdentifier |
||
23 | )) { |
||
24 | $msg = "The qualifier does not match the regex in the xsd."; |
||
25 | return false; |
||
26 | } |
||
27 | return true; |
||
28 | } |
||
29 | } |
||
30 |
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.