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/Color.php (31 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_Color extends Kint_Object_Blob
0 ignored issues
show
Kint_Object_Color 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 $color_map 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 $color_map = array(
0 ignored issues
show
$color_map 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
        'aliceblue' => 'f0f8ff',
7
        'antiquewhite' => 'faebd7',
8
        'aqua' => '00ffff',
9
        'aquamarine' => '7fffd4',
10
        'azure' => 'f0ffff',
11
        'beige' => 'f5f5dc',
12
        'bisque' => 'ffe4c4',
13
        'black' => '000000',
14
        'blanchedalmond' => 'ffebcd',
15
        'blue' => '0000ff',
16
        'blueviolet' => '8a2be2',
17
        'brown' => 'a52a2a',
18
        'burlywood' => 'deb887',
19
        'cadetblue' => '5f9ea0',
20
        'chartreuse' => '7fff00',
21
        'chocolate' => 'd2691e',
22
        'coral' => 'ff7f50',
23
        'cornflowerblue' => '6495ed',
24
        'cornsilk' => 'fff8dc',
25
        'crimson' => 'dc143c',
26
        'cyan' => '00ffff',
27
        'darkblue' => '00008b',
28
        'darkcyan' => '008b8b',
29
        'darkgoldenrod' => 'b8860b',
30
        'darkgray' => 'a9a9a9',
31
        'darkgreen' => '006400',
32
        'darkgrey' => 'a9a9a9',
33
        'darkkhaki' => 'bdb76b',
34
        'darkmagenta' => '8b008b',
35
        'darkolivegreen' => '556b2f',
36
        'darkorange' => 'ff8c00',
37
        'darkorchid' => '9932cc',
38
        'darkred' => '8b0000',
39
        'darksalmon' => 'e9967a',
40
        'darkseagreen' => '8fbc8f',
41
        'darkslateblue' => '483d8b',
42
        'darkslategray' => '2f4f4f',
43
        'darkslategrey' => '2f4f4f',
44
        'darkturquoise' => '00ced1',
45
        'darkviolet' => '9400d3',
46
        'deeppink' => 'ff1493',
47
        'deepskyblue' => '00bfff',
48
        'dimgray' => '696969',
49
        'dimgrey' => '696969',
50
        'dodgerblue' => '1e90ff',
51
        'firebrick' => 'b22222',
52
        'floralwhite' => 'fffaf0',
53
        'forestgreen' => '228b22',
54
        'fuchsia' => 'ff00ff',
55
        'gainsboro' => 'dcdcdc',
56
        'ghostwhite' => 'f8f8ff',
57
        'gold' => 'ffd700',
58
        'goldenrod' => 'daa520',
59
        'gray' => '808080',
60
        'green' => '008000',
61
        'greenyellow' => 'adff2f',
62
        'grey' => '808080',
63
        'honeydew' => 'f0fff0',
64
        'hotpink' => 'ff69b4',
65
        'indianred' => 'cd5c5c',
66
        'indigo' => '4b0082',
67
        'ivory' => 'fffff0',
68
        'khaki' => 'f0e68c',
69
        'lavender' => 'e6e6fa',
70
        'lavenderblush' => 'fff0f5',
71
        'lawngreen' => '7cfc00',
72
        'lemonchiffon' => 'fffacd',
73
        'lightblue' => 'add8e6',
74
        'lightcoral' => 'f08080',
75
        'lightcyan' => 'e0ffff',
76
        'lightgoldenrodyellow' => 'fafad2',
77
        'lightgray' => 'd3d3d3',
78
        'lightgreen' => '90ee90',
79
        'lightgrey' => 'd3d3d3',
80
        'lightpink' => 'ffb6c1',
81
        'lightsalmon' => 'ffa07a',
82
        'lightseagreen' => '20b2aa',
83
        'lightskyblue' => '87cefa',
84
        'lightslategray' => '778899',
85
        'lightslategrey' => '778899',
86
        'lightsteelblue' => 'b0c4de',
87
        'lightyellow' => 'ffffe0',
88
        'lime' => '00ff00',
89
        'limegreen' => '32cd32',
90
        'linen' => 'faf0e6',
91
        'magenta' => 'ff00ff',
92
        'maroon' => '800000',
93
        'mediumaquamarine' => '66cdaa',
94
        'mediumblue' => '0000cd',
95
        'mediumorchid' => 'ba55d3',
96
        'mediumpurple' => '9370db',
97
        'mediumseagreen' => '3cb371',
98
        'mediumslateblue' => '7b68ee',
99
        'mediumspringgreen' => '00fa9a',
100
        'mediumturquoise' => '48d1cc',
101
        'mediumvioletred' => 'c71585',
102
        'midnightblue' => '191970',
103
        'mintcream' => 'f5fffa',
104
        'mistyrose' => 'ffe4e1',
105
        'moccasin' => 'ffe4b5',
106
        'navajowhite' => 'ffdead',
107
        'navy' => '000080',
108
        'oldlace' => 'fdf5e6',
109
        'olive' => '808000',
110
        'olivedrab' => '6b8e23',
111
        'orange' => 'ffa500',
112
        'orangered' => 'ff4500',
113
        'orchid' => 'da70d6',
114
        'palegoldenrod' => 'eee8aa',
115
        'palegreen' => '98fb98',
116
        'paleturquoise' => 'afeeee',
117
        'palevioletred' => 'db7093',
118
        'papayawhip' => 'ffefd5',
119
        'peachpuff' => 'ffdab9',
120
        'peru' => 'cd853f',
121
        'pink' => 'ffc0cb',
122
        'plum' => 'dda0dd',
123
        'powderblue' => 'b0e0e6',
124
        'purple' => '800080',
125
        'rebeccapurple' => '663399',
126
        'red' => 'ff0000',
127
        'rosybrown' => 'bc8f8f',
128
        'royalblue' => '4169e1',
129
        'saddlebrown' => '8b4513',
130
        'salmon' => 'fa8072',
131
        'sandybrown' => 'f4a460',
132
        'seagreen' => '2e8b57',
133
        'seashell' => 'fff5ee',
134
        'sienna' => 'a0522d',
135
        'silver' => 'c0c0c0',
136
        'skyblue' => '87ceeb',
137
        'slateblue' => '6a5acd',
138
        'slategray' => '708090',
139
        'slategrey' => '708090',
140
        'snow' => 'fffafa',
141
        'springgreen' => '00ff7f',
142
        'steelblue' => '4682b4',
143
        'tan' => 'd2b48c',
144
        'teal' => '008080',
145
        'thistle' => 'd8bfd8',
146
        'tomato' => 'ff6347',
147
        'turquoise' => '40e0d0',
148
        'violet' => 'ee82ee',
149
        'wheat' => 'f5deb3',
150
        'white' => 'ffffff',
151
        'whitesmoke' => 'f5f5f5',
152
        'yellow' => 'ffff00',
153
        'yellowgreen' => '9acd32',
154
    );
155
156
    public $hints = array('color');
157
    public $color = null;
158
159
    public function __construct($color)
160
    {
161
        $this->color = $color;
162
    }
163
164
    /**
165
     * Turns HSL color to RGB. Black magic.
166
     *
167
     * @param float $hue        Hue
168
     * @param float $saturation Saturation
169
     * @param float $lightness  Lightness
170
     *
171
     * @return array RGB array
0 ignored issues
show
Should the return type not be null|double[]?

This check compares the return type specified in the @return annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.

Loading history...
172
     */
173
    public static function hslToRgb($hue, $saturation, $lightness)
174
    {
175
        $hue /= 360;
176
        $saturation /= 100;
177
        $lightness /= 100;
178
179
        $m2 = ($lightness <= 0.5) ? $lightness * ($saturation + 1) : $lightness + $saturation - $lightness * $saturation;
0 ignored issues
show
Comprehensibility introduced by
Avoid variables with short names like $m2. 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...
180
        $m1 = $lightness * 2 - $m2;
0 ignored issues
show
Comprehensibility introduced by
Avoid variables with short names like $m1. 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...
181
182
        $out = array(
183
            round(self::hueToRgb($m1, $m2, $hue + 1 / 3) * 255),
184
            round(self::hueToRgb($m1, $m2, $hue) * 255),
185
            round(self::hueToRgb($m1, $m2, $hue - 1 / 3) * 255),
186
        );
187
188
        if (max($out) > 255) {
189
            return;
190
        } else {
191
            return $out;
192
        }
193
    }
194
195
    /**
196
     * Helper function for hslToRgb. Even blacker magic.
197
     *
198
     * @return float Color value
199
     */
200
    private static function hueToRgb($m1, $m2, $hue)
0 ignored issues
show
Comprehensibility introduced by
Avoid variables with short names like $m1. 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 $m2. 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...
201
    {
202
        $hue = ($hue < 0) ? $hue + 1 : (($hue > 1) ? $hue - 1 : $hue);
0 ignored issues
show
Consider using a different name than the parameter $hue. This often makes code more readable.
Loading history...
203 View Code Duplication
        if ($hue * 6 < 1) {
0 ignored issues
show
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...
204
            return $m1 + ($m2 - $m1) * $hue * 6;
205
        }
206
        if ($hue * 2 < 1) {
207
            return $m2;
208
        }
209 View Code Duplication
        if ($hue * 3 < 2) {
0 ignored issues
show
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...
210
            return $m1 + ($m2 - $m1) * (0.66666 - $hue) * 6;
211
        }
212
213
        return $m1;
214
    }
215
216
    /**
217
     * Converts RGB to HSL. Color inversion of previous black magic is white magic?
218
     *
219
     * @param float $red   Red
220
     * @param float $green Green
221
     * @param float $blue  Blue
222
     *
223
     * @return array HSL array
0 ignored issues
show
Consider making the return type a bit more specific; maybe use array<integer|double>.

This check looks for the generic type array as a return type and suggests a more specific type. This type is inferred from the actual code.

Loading history...
224
     */
225
    public static function rgbToHsl($red, $green, $blue)
226
    {
227
        $clrMin = min($red, $green, $blue);
228
        $clrMax = max($red, $green, $blue);
229
        $deltaMax = $clrMax - $clrMin;
230
231
        $L = ($clrMax + $clrMin) / 510;
0 ignored issues
show
$L 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...
Comprehensibility introduced by
Avoid variables with short names like $L. 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...
232
233
        if (0 == $deltaMax) {
234
            $H = 0;
0 ignored issues
show
$H 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...
Comprehensibility introduced by
Avoid variables with short names like $H. 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...
235
            $S = 0;
0 ignored issues
show
$S 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...
Comprehensibility introduced by
Avoid variables with short names like $S. 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...
236
        } else {
237
            if (0.5 > $L) {
0 ignored issues
show
$L 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...
238
                $S = $deltaMax / ($clrMax + $clrMin);
0 ignored issues
show
$S 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...
239
            } else {
240
                $S = $deltaMax / (510 - $clrMax - $clrMin);
0 ignored issues
show
$S 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...
241
            }
242
243
            if ($clrMax == $red) {
244
                $H = ($green - $blue) / (6.0 * $deltaMax);
0 ignored issues
show
$H 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...
245
            } elseif ($clrMax == $green) {
246
                $H = 1 / 3 + ($blue - $red) / (6.0 * $deltaMax);
0 ignored issues
show
$H 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...
247
            } else {
248
                $H = 2 / 3 + ($red - $green) / (6.0 * $deltaMax);
0 ignored issues
show
$H 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...
249
            }
250
251
            if (0 > $H) {
0 ignored issues
show
$H 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...
252
                $H += 1;
0 ignored issues
show
$H 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...
253
            }
254
            if (1 < $H) {
0 ignored issues
show
$H 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...
255
                $H -= 1;
0 ignored issues
show
$H 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...
256
            }
257
        }
258
259
        return array(
260
            (round($H * 360) % 360 + 360) % 360,
0 ignored issues
show
$H 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...
261
            round($S * 100),
0 ignored issues
show
$S 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...
262
            round($L * 100),
0 ignored issues
show
$L 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...
263
        );
264
    }
265
}
266