| Conditions | 5 |
| Paths | 5 |
| Total Lines | 30 |
| Code Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 17 |
| CRAP Score | 5.0291 |
| Changes | 0 | ||
| 1 | <?php |
||
| 13 | 13 | public static function versione($container) |
|
| 14 | { |
||
| 15 | |||
| 16 | 13 | if (self::isWindows()) { |
|
| 17 | return ''; |
||
| 18 | } |
||
| 19 | |||
| 20 | 13 | if (self::$versione) { |
|
| 21 | 12 | $risposta = self::$versione; |
|
| 22 | 12 | } else { |
|
| 23 | 1 | $projectDir = substr($container->get('kernel')->getRootDir(), 0, -4); |
|
| 24 | |||
| 25 | 1 | $cmd = 'cd ' . $projectDir; |
|
|
|
|||
| 26 | 1 | $process = new Process($cmd . ';git describe --tags'); |
|
| 27 | 1 | $process->setTimeout(60 * 100); |
|
| 28 | 1 | $process->run(); |
|
| 29 | 1 | if ($process->isSuccessful()) { |
|
| 30 | 1 | $out = explode(chr(10), $process->getOutput()); |
|
| 31 | |||
| 32 | 1 | $version = isset($out[0]) ? $out[0] : "0"; |
|
| 33 | |||
| 34 | 1 | $risposta = $version; |
|
| 35 | 1 | } else { |
|
| 36 | $risposta = "0"; |
||
| 37 | } |
||
| 38 | 1 | self::$versione = $risposta; |
|
| 39 | } |
||
| 40 | |||
| 41 | |||
| 42 | 13 | return $risposta; |
|
| 43 | } |
||
| 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.