Conditions | 1 |
Paths | 1 |
Total Lines | 22 |
Code Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Tests | 12 |
CRAP Score | 1 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
18 | 11 | protected function generateV4Uuid() |
|
19 | { |
||
20 | 11 | return sprintf( |
|
21 | 11 | '%04x%04x-%04x-%04x-%04x-%04x%04x%04x', |
|
22 | // 32 bits for "time_low" |
||
|
|||
23 | 11 | mt_rand(0, 0xffff), |
|
24 | 11 | mt_rand(0, 0xffff), |
|
25 | // 16 bits for "time_mid" |
||
26 | 11 | mt_rand(0, 0xffff), |
|
27 | // 16 bits for "time_hi_and_version", |
||
28 | // four most significant bits holds version number 4 |
||
29 | 11 | mt_rand(0, 0x0fff) | 0x4000, |
|
30 | // 16 bits, 8 bits for "clk_seq_hi_res", |
||
31 | // 8 bits for "clk_seq_low", |
||
32 | // two most significant bits holds zero and one for variant DCE1.1 |
||
33 | 11 | mt_rand(0, 0x3fff) | 0x8000, |
|
34 | // 48 bits for "node" |
||
35 | 11 | mt_rand(0, 0xffff), |
|
36 | 11 | mt_rand(0, 0xffff), |
|
37 | 11 | mt_rand(0, 0xffff) |
|
38 | 11 | ); |
|
39 | } |
||
40 | } |
||
41 |
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.
The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.
This check looks for comments that seem to be mostly valid code and reports them.