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/Object.php (16 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_Object
0 ignored issues
show
Kint_Object 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 $owner_class 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 $access_path 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
    const ACCESS_NONE = null;
6
    const ACCESS_PUBLIC = 'public';
7
    const ACCESS_PROTECTED = 'protected';
8
    const ACCESS_PRIVATE = 'private';
9
10
    const OPERATOR_NONE = null;
11
    const OPERATOR_ARRAY = '=>';
12
    const OPERATOR_OBJECT = '->';
13
    const OPERATOR_STATIC = '::';
14
15
    public $name;
16
    public $type;
17
    public $static = false;
18
    public $const = false;
19
    public $access = self::ACCESS_NONE;
20
    public $owner_class;
0 ignored issues
show
$owner_class 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...
21
    public $access_path;
0 ignored issues
show
$access_path 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...
22
    public $operator = self::OPERATOR_NONE;
23
    public $reference = false;
24
    public $size = null;
25
    public $depth = 0;
26
    public $representations = array();
27
    public $value = null;
28
    public $hints = array();
29
30
    public function __construct()
31
    {
32
    }
33
34
    public function addRepresentation(Kint_Object_Representation $rep, $pos = null)
0 ignored issues
show
function addRepresentation() does not seem to conform to the naming convention (^(?:is|has|should|may|supports)).

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...
35
    {
36
        if (isset($this->representations[$rep->name])) {
37
            return false;
38
        }
39
40
        if ($this->value === null) {
41
            $this->value = $rep;
42
        }
43
44
        if ($pos === null) {
45
            $this->representations[$rep->name] = $rep;
46
        } else {
47
            $this->representations = array_merge(
48
                array_slice($this->representations, 0, $pos),
49
                array($rep->name => $rep),
50
                array_slice($this->representations, $pos)
51
            );
52
        }
53
54
        return true;
55
    }
56
57
    public function replaceRepresentation(Kint_Object_Representation $rep, $pos = null)
58
    {
59
        if ($pos === null) {
60
            $this->representations[$rep->name] = $rep;
61
        } else {
62
            $this->removeRepresentation($rep->name);
63
            $this->addRepresentation($rep, $pos);
64
        }
65
    }
66
67
    public function removeRepresentation($name)
68
    {
69
        unset($this->representations[$name]);
70
    }
71
72
    public function getRepresentation($name)
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...
73
    {
74
        if (isset($this->representations[$name])) {
75
            return $this->representations[$name];
76
        }
77
    }
78
79
    public function getRepresentations()
80
    {
81
        return $this->representations;
82
    }
83
84
    public function clearRepresentations()
85
    {
86
        $this->representations = array();
87
    }
88
89
    public function getType()
90
    {
91
        return $this->type;
92
    }
93
94
    public function getModifiers()
95
    {
96
        $out = $this->getAccess();
97
98
        if ($this->const) {
99
            $out .= ' const';
100
        }
101
102
        if ($this->static) {
103
            $out .= ' static';
104
        }
105
106
        if (strlen($out)) {
107
            return ltrim($out);
108
        }
109
    }
110
111
    public function getAccess()
112
    {
113
        switch ($this->access) {
114
            case self::ACCESS_PRIVATE:
115
                return 'private';
116
            case self::ACCESS_PROTECTED:
117
                return 'protected';
118
            case self::ACCESS_PUBLIC:
119
                return 'public';
120
        }
121
    }
122
123
    public function getName()
124
    {
125
        return $this->name;
126
    }
127
128
    public function getOperator()
129
    {
130
        if ($this->operator === self::OPERATOR_ARRAY) {
131
            return '=>';
132
        } elseif ($this->operator === self::OPERATOR_OBJECT) {
133
            return '->';
134
        } elseif ($this->operator === self::OPERATOR_STATIC) {
135
            return '::';
136
        }
137
138
        return;
139
    }
140
141
    public function getSize()
142
    {
143
        return $this->size;
144
    }
145
146
    public function getValueShort()
147
    {
148
        if ($rep = $this->value) {
149
            if ($this->type === 'boolean') {
150
                return $rep->contents ? 'true' : 'false';
151
            } elseif ($this->type === 'integer' || $this->type === 'double') {
152
                return $rep->contents;
153
            }
154
        }
155
    }
156
157
    public function getAccessPath()
158
    {
159
        return $this->access_path;
160
    }
161
162
    public static function blank($name = null, $access_path = null)
0 ignored issues
show
$access_path 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 Naming introduced by
The parameter $access_path is not named in camelCase.

This check marks parameter 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...
163
    {
164
        $o = new self();
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...
165
        $o->name = $name;
166
        $o->access_path = $name;
167
        if ($access_path) {
0 ignored issues
show
$access_path 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...
168
            $o->access_path = $access_path;
0 ignored issues
show
$access_path 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...
169
        }
170
171
        return $o;
172
    }
173
174
    public function transplant(Kint_Object $new)
175
    {
176
        $new->name = $this->name;
177
        $new->size = $this->size;
178
        $new->access_path = $this->access_path;
179
        $new->access = $this->access;
180
        $new->static = $this->static;
181
        $new->const = $this->const;
182
        $new->type = $this->type;
183
        $new->depth = $this->depth;
184
        $new->owner_class = $this->owner_class;
185
        $new->operator = $this->operator;
186
        $new->reference = $this->reference;
187
        $new->value = $this->value;
188
        $new->representations += $this->representations;
189
        $new->hints = array_merge($this->hints, $new->hints);
190
191
        return $new;
192
    }
193
194
    public static function isSequential(array $array)
195
    {
196
        return array_keys($array) === range(0, count($array) - 1);
197
    }
198
199
    public static function sortByAccess(Kint_Object $a, Kint_Object $b)
0 ignored issues
show
Comprehensibility introduced by
Avoid variables with short names like $a. 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...
Comprehensibility introduced by
Avoid variables with short names like $b. 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...
200
    {
201
        static $sorts = array(
202
            self::ACCESS_PUBLIC => 1,
203
            self::ACCESS_PROTECTED => 2,
204
            self::ACCESS_PRIVATE => 3,
205
            self::ACCESS_NONE => 4,
206
        );
207
208
        return $sorts[$a->access] - $sorts[$b->access];
209
    }
210
211
    public static function sortByName(Kint_Object $a, Kint_Object $b)
0 ignored issues
show
Comprehensibility introduced by
Avoid variables with short names like $a. 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...
Comprehensibility introduced by
Avoid variables with short names like $b. 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...
212
    {
213
        $ret = strnatcasecmp($a->name, $b->name);
214
215
        if ($ret === 0) {
216
            return is_int($a->name) - is_int($b->name);
217
        }
218
219
        return $ret;
220
    }
221
}
222