Kint_Renderer_Rich_Binary   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 22
rs 10
c 0
b 0
f 0
wmc 2
lcom 1
cbo 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A render() 0 16 2
1
<?php
2
3
class Kint_Renderer_Rich_Binary extends Kint_Renderer_Rich_Plugin
0 ignored issues
show
Coding Style introduced by
Kint_Renderer_Rich_Binary 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...
Coding Style introduced by
The property $line_length is not named in camelCase.

This check marks property names that have not been written in camelCase.

In camelCase names are written without any punctuation, the start of each new word being marked by a capital letter. Thus the name database connection string becomes databaseConnectionString.

Loading history...
Coding Style introduced by
The property $chunk_length is not named in camelCase.

This check marks property names that have not been written in camelCase.

In camelCase names are written without any punctuation, the start of each new word being marked by a capital letter. Thus the name database connection string becomes databaseConnectionString.

Loading history...
4
{
5
    public static $line_length = 0x10;
0 ignored issues
show
Coding Style introduced by
$line_length 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...
6
    public static $chunk_length = 0x4;
0 ignored issues
show
Coding Style introduced by
$chunk_length 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...
7
8
    public function render($r)
0 ignored issues
show
Comprehensibility introduced by
Avoid variables with short names like $r. 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...
9
    {
10
        $out = '<pre>';
11
12
        $chunks = str_split($r->contents, self::$line_length);
13
14
        foreach ($chunks as $index => $chunk) {
15
            $out .= sprintf('%08X', $index * self::$line_length).":\t";
16
            $out .= implode(' ', str_split(str_pad(bin2hex($chunk), 2 * self::$line_length, ' '), self::$chunk_length));
17
            $out .= "\t".preg_replace('/[^\x20-\x7E]/', '.', $chunk)."\n";
18
        }
19
20
        $out .= '</pre>';
21
22
        return $out;
23
    }
24
}
25