Kint_Renderer_Rich_TraceFrame::render()   C
last analyzed

Complexity

Conditions 7
Paths 13

Size

Total Lines 34
Code Lines 20

Duplication

Lines 3
Ratio 8.82 %

Importance

Changes 0
Metric Value
cc 7
eloc 20
nc 13
nop 1
dl 3
loc 34
rs 6.7272
c 0
b 0
f 0
1
<?php
2
3
class Kint_Renderer_Rich_TraceFrame extends Kint_Renderer_Rich_Plugin
0 ignored issues
show
Coding Style introduced by
Kint_Renderer_Rich_TraceFrame does not seem to conform to the naming convention (^[A-Z][a-zA-Z0-9]*$).

This check examines a number of code elements and verifies that they conform to the given naming conventions.

You can set conventions for local variables, abstract classes, utility classes, constant, properties, methods, parameters, interfaces, classes, exceptions and special methods.

Loading history...
4
{
5
    public function render($o)
0 ignored issues
show
Comprehensibility introduced by
Avoid variables with short names like $o. Configured minimum length is 3.

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.

Loading history...
6
    {
7
        $children = $this->renderer->renderChildren($o);
8
9
        if (!($o instanceof Kint_Object_TraceFrame)) {
10
            $header = $this->renderer->renderHeader($o);
11
        } else {
12
            if (!empty($o->trace['file']) && !empty($o->trace['line'])) {
13
                $header = '<var>'.$this->renderer->escape(Kint::shortenPath($o->trace['file'])).':'.(int) $o->trace['line'].'</var> ';
14
            } else {
15
                $header = '<var>PHP internal call</var> ';
16
            }
17
18
            if ($o->trace['class']) {
19
                $header .= $this->renderer->escape($o->trace['class'].$o->trace['type']);
20
            }
21
22
            if (is_string($o->trace['function'])) {
23
                $function = $this->renderer->escape($o->trace['function'].'()');
24
            } else {
25
                $function = $this->renderer->escape($o->trace['function']->getName().'('.$o->trace['function']->getParams().')');
26
27 View Code Duplication
                if (($url = $o->trace['function']->getPhpDocUrl()) !== null) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
28
                    $function = '<a href="'.$url.'" target=_blank>'.$function.'</a>';
29
                }
30
            }
31
32
            $header .= '<dfn>'.$function.'</dfn>';
33
        }
34
35
        $header = $this->renderer->renderHeaderWrapper($o, (bool) strlen($children), $header);
36
37
        return '<dl>'.$header.$children.'</dl>';
38
    }
39
}
40