| Conditions | 3 |
| Paths | 3 |
| Total Lines | 18 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 6 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 61 | protected static function hex2bin($hexstr) |
||
| 62 | { |
||
| 63 | if (\function_exists('hex2bin')) { |
||
| 64 | return \hex2bin($hexstr); |
||
| 65 | } |
||
| 66 | |||
| 67 | $n = \strlen($hexstr); |
||
|
|
|||
| 68 | $sbin = ''; |
||
| 69 | $i = 0; |
||
| 70 | while ($i < $n) { |
||
| 71 | $a = \substr($hexstr, $i, 2); |
||
| 72 | $c = \pack('H*', $a); |
||
| 73 | $sbin.= $c; |
||
| 74 | $i+=2; |
||
| 75 | } |
||
| 76 | |||
| 77 | return $sbin; |
||
| 78 | } |
||
| 79 | |||
| 81 |
This check looks for multiple assignments in successive lines of code. It will report an issue if the operators are not in a straight line.
To visualize
will produce issues in the first and second line, while this second example
will produce no issues.