| Conditions | 5 |
| Paths | 9 |
| Total Lines | 29 |
| Code Lines | 19 |
| Lines | 6 |
| Ratio | 20.69 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 11 | public function renderTab(Representation $r) |
||
|
|
|||
| 12 | { |
||
| 13 | if (!($r instanceof MicrotimeRepresentation)) { |
||
| 14 | return false; |
||
| 15 | } |
||
| 16 | |||
| 17 | $out = $r->getDateTime()->format('Y-m-d H:i:s.u'); |
||
| 18 | View Code Duplication | if ($r->lap !== null) { |
|
| 19 | $out .= "\n<b>SINCE LAST CALL:</b> <b class=\"kint-microtime-lap\">".round($r->lap, 4).'</b>s.'; |
||
| 20 | } |
||
| 21 | if ($r->total !== null) { |
||
| 22 | $out .= "\n<b>SINCE START:</b> ".round($r->total, 4).'s.'; |
||
| 23 | } |
||
| 24 | View Code Duplication | if ($r->avg !== null) { |
|
| 25 | $out .= "\n<b>AVERAGE DURATION:</b> <span class=\"kint-microtime-avg\">".round($r->avg, 4).'</span>s.'; |
||
| 26 | } |
||
| 27 | |||
| 28 | $bytes = Utils::getHumanReadableBytes($r->mem); |
||
| 29 | $out .= "\n<b>MEMORY USAGE:</b> ".$r->mem.' bytes ('.round($bytes['value'], 3).' '.$bytes['unit'].')'; |
||
| 30 | $bytes = Utils::getHumanReadableBytes($r->mem_real); |
||
| 31 | $out .= ' (real '.round($bytes['value'], 3).' '.$bytes['unit'].')'; |
||
| 32 | |||
| 33 | $bytes = Utils::getHumanReadableBytes($r->mem_peak); |
||
| 34 | $out .= "\n<b>PEAK MEMORY USAGE:</b> ".$r->mem_peak.' bytes ('.round($bytes['value'], 3).' '.$bytes['unit'].')'; |
||
| 35 | $bytes = Utils::getHumanReadableBytes($r->mem_peak_real); |
||
| 36 | $out .= ' (real '.round($bytes['value'], 3).' '.$bytes['unit'].')'; |
||
| 37 | |||
| 38 | return '<pre data-kint-microtime-group="'.$r->group.'">'.$out.'</pre>'; |
||
| 39 | } |
||
| 40 | |||
| 46 |
Short variable names may make your code harder to understand. Variable names should be self-descriptive. This check looks for variable names who are shorter than a configured minimum.