Issues (1165)

Security Analysis    no request data  

This project does not seem to handle request data directly as such no vulnerable execution paths were found.

  Cross-Site Scripting
Cross-Site Scripting enables an attacker to inject code into the response of a web-request that is viewed by other users. It can for example be used to bypass access controls, or even to take over other users' accounts.
  File Exposure
File Exposure allows an attacker to gain access to local files that he should not be able to access. These files can for example include database credentials, or other configuration files.
  File Manipulation
File Manipulation enables an attacker to write custom data to files. This potentially leads to injection of arbitrary code on the server.
  Object Injection
Object Injection enables an attacker to inject an object into PHP code, and can lead to arbitrary code execution, file exposure, or file manipulation attacks.
  Code Injection
Code Injection enables an attacker to execute arbitrary code on the server.
  Response Splitting
Response Splitting can be used to send arbitrary responses.
  File Inclusion
File Inclusion enables an attacker to inject custom files into PHP's file loading mechanism, either explicitly passed to include, or for example via PHP's auto-loading mechanism.
  Command Injection
Command Injection enables an attacker to inject a shell command that is execute with the privileges of the web-server. This can be used to expose sensitive data, or gain access of your server.
  SQL Injection
SQL Injection enables an attacker to execute arbitrary SQL code on your database server gaining access to user data, or manipulating user data.
  XPath Injection
XPath Injection enables an attacker to modify the parts of XML document that are read. If that XML document is for example used for authentication, this can lead to further vulnerabilities similar to SQL Injection.
  LDAP Injection
LDAP Injection enables an attacker to inject LDAP statements potentially granting permission to run unauthorized queries, or modify content inside the LDAP tree.
  Header Injection
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  XML Injection
XML Injection enables an attacker to read files on your local filesystem including configuration files, or can be abused to freeze your web-server process.
  Variable Injection
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
Unfortunately, the security analysis is currently not available for your project. If you are a non-commercial open-source project, please contact support to gain access.

src/Renderer/Plain.php (27 issues)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
class Kint_Renderer_Plain extends Kint_Renderer_Text
0 ignored issues
show
Kint_Renderer_Plain 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...
The property $pre_render_sources 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...
The property $disable_utf8 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...
The property $been_run 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...
The property $mod_return 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...
The property $file_link_format 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 $pre_render_sources = array(
0 ignored issues
show
$pre_render_sources 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
        'script' => array(),
7
        'style' => array(
8
            array('Kint_Renderer_Plain', 'renderCss'),
9
        ),
10
        'raw' => array(),
11
    );
12
13
    /**
14
     * Path to the CSS file to load by default.
15
     *
16
     * @var string
17
     */
18
    public static $theme = 'plain.css';
19
20
    /**
21
     * Output htmlentities instead of utf8.
22
     *
23
     * @var bool
24
     */
25
    public static $disable_utf8 = false;
0 ignored issues
show
$disable_utf8 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...
26
27
    protected static $been_run = false;
0 ignored issues
show
$been_run 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...
28
29
    protected $mod_return = false;
0 ignored issues
show
$mod_return 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...
30
    protected $file_link_format = false;
0 ignored issues
show
$file_link_format 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...
31
32
    public function __construct(array $params = array())
33
    {
34
        parent::__construct($params);
35
36
        if (isset($params['settings']['return'])) {
37
            $this->mod_return = $params['settings']['return'];
38
        }
39
40
        if (isset($params['settings']['file_link_format'])) {
41
            $this->file_link_format = $params['settings']['file_link_format'];
42
        }
43
    }
44
45 View Code Duplication
    protected function utf8_to_htmlentity($string)
0 ignored issues
show
function utf8_to_htmlentity() 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...
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
This method seems to be duplicated in 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...
46
    {
47
        return str_replace(
48
            array('┌', '═', '┐', '│', '└', '─', '┘'),
49
            array('&#9484;', '&#9552;', '&#9488;', '&#9474;', '&#9492;', '&#9472;', '&#9496;'),
50
            $string
51
        );
52
    }
53
54
    public function colorValue($string)
55
    {
56
        return '<i>'.$string.'</i>';
57
    }
58
59
    public function colorType($string)
60
    {
61
        return '<b>'.$string.'</b>';
62
    }
63
64
    public function colorTitle($string)
65
    {
66
        return '<u>'.$string.'</u>';
67
    }
68
69
    public function renderTitle(Kint_Object $o)
0 ignored issues
show
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
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...
70
    {
71
        if (self::$disable_utf8) {
72
            return $this->utf8_to_htmlentity(parent::renderTitle($o));
73
        } else {
74
            return parent::renderTitle($o);
75
        }
76
    }
77
78 View Code Duplication
    protected static function renderCss()
0 ignored issues
show
This method seems to be duplicated in 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...
79
    {
80
        if (file_exists(KINT_DIR.'/resources/compiled/'.self::$theme)) {
81
            return file_get_contents(KINT_DIR.'/resources/compiled/'.self::$theme);
82
        } else {
83
            return file_get_contents(self::$theme);
84
        }
85
    }
86
87 View Code Duplication
    public function preRender()
0 ignored issues
show
This method seems to be duplicated in 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...
88
    {
89
        $output = '';
90
91
        if (!self::$been_run || $this->mod_return) {
92
            foreach (self::$pre_render_sources as $type => $values) {
93
                $contents = '';
94
                foreach ($values as $v) {
95
                    if (is_callable($v)) {
96
                        $contents .= call_user_func($v, $this);
97
                    } elseif (is_string($v)) {
98
                        $contents .= $v;
99
                    }
100
                }
101
102
                if (!strlen($contents)) {
103
                    continue;
104
                }
105
106
                switch ($type) {
107
                    case 'script':
108
                        $output .= '<script class="kint-script">'.$contents.'</script>';
109
                        break;
110
                    case 'style':
111
                        $output .= '<style class="kint-style">'.$contents.'</style>';
112
                        break;
113
                    default:
114
                        $output .= $contents;
115
                }
116
            }
117
118
            if (!$this->mod_return) {
119
                self::$been_run = true;
120
            }
121
        }
122
123
        return $output.'<div class="kint-plain">';
124
    }
125
126
    public function postRender()
127
    {
128
        if (self::$disable_utf8) {
129
            return $this->utf8_to_htmlentity(parent::postRender()).'</div>';
130
        } else {
131
            return parent::postRender().'</div>';
132
        }
133
    }
134
135 View Code Duplication
    public function ideLink($file, $line)
0 ignored issues
show
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
This method seems to be duplicated in 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...
136
    {
137
        $shortenedPath = $this->escape(Kint::shortenPath($file));
138
        if (!$this->file_link_format) {
139
            return $shortenedPath.':'.$line;
140
        }
141
142
        $ideLink = Kint::getIdeLink($file, $line);
143
        $class = (strpos($ideLink, 'http://') === 0) ? 'class="kint-ide-link" ' : '';
144
145
        return "<a {$class}href=\"{$ideLink}\">{$shortenedPath}:{$line}</a>";
146
    }
147
148 View Code Duplication
    public function escape($string, $encoding = false)
0 ignored issues
show
This method seems to be duplicated in 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...
149
    {
150
        if ($encoding === false) {
151
            $encoding = Kint_Object_Blob::detectEncoding($string);
0 ignored issues
show
Consider using a different name than the parameter $encoding. This often makes code more readable.
Loading history...
152
        }
153
154
        $original_encoding = $encoding;
0 ignored issues
show
$original_encoding 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...
155
156
        if ($encoding === false || $encoding === 'ASCII') {
157
            $encoding = 'UTF-8';
0 ignored issues
show
Consider using a different name than the parameter $encoding. This often makes code more readable.
Loading history...
158
        }
159
160
        $string = htmlspecialchars($string, ENT_NOQUOTES, $encoding);
0 ignored issues
show
Consider using a different name than the parameter $string. This often makes code more readable.
Loading history...
161
162
        // this call converts all non-ASCII characters into numeirc htmlentities
163
        if (extension_loaded('mbstring') && $original_encoding !== 'ASCII') {
0 ignored issues
show
$original_encoding 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...
164
            $string = mb_encode_numericentity($string, array(0x80, 0xffff, 0, 0xffff), $encoding);
0 ignored issues
show
Consider using a different name than the parameter $string. This often makes code more readable.
Loading history...
165
        }
166
167
        return $string;
168
    }
169
}
170