| Conditions | 1 |
| Paths | 1 |
| Total Lines | 15 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 22 | public static function to_rgb($input) :array { |
||
| 23 | $cmyk = static::_validate_array_input($input); |
||
| 24 | $cmyk['c'] /= 100; |
||
| 25 | $cmyk['m'] /= 100; |
||
| 26 | $cmyk['y'] /= 100; |
||
| 27 | $cmyk['k'] /= 100; |
||
| 28 | $r = 1 - min(1, $cmyk['c'] * (1 - $cmyk['k']) + $cmyk['k']); |
||
|
|
|||
| 29 | $g = 1 - min(1, $cmyk['m'] * (1 - $cmyk['k']) + $cmyk['k']); |
||
| 30 | $b = 1 - min(1, $cmyk['y'] * (1 - $cmyk['k']) + $cmyk['k']); |
||
| 31 | return [ |
||
| 32 | 'r' => round($r * 255), |
||
| 33 | 'g' => round($g * 255), |
||
| 34 | 'b' => round($b * 255) |
||
| 35 | ]; |
||
| 36 | } |
||
| 37 | |||
| 54 |
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.