Issues (345)

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/math.php (32 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 namespace Tarsana\Functional;
2
/**
3
 * Basic Math functions.
4
 * @file
5
 */
6
7
/**
8
 * Computes `$x + $y`.
9
 *
10
 * ```php
11
 * $plusTwo = F\plus(2);
12
 * $plusTwo(5); //=> 7
13
 * ```
14
 *
15
 * @stream
16
 * @signature Number -> Number -> Number
17
 * @param  int|float $x
0 ignored issues
show
There is no parameter named $x. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
18
 * @param  int|float $y
0 ignored issues
show
There is no parameter named $y. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
19
 * @return int|float
20
 */
21 View Code Duplication
function plus() {
0 ignored issues
show
This function 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...
22
    static $plus = false;
23
    $plus = $plus ?: curry(function($x, $y){
24
        return $x + $y;
25
    });
26
    return _apply($plus, func_get_args());
27
}
28
29
/**
30
 * Computues `$x - $y`.
31
 *
32
 * ```php
33
 * F\minus(7, 2); //=> 5
34
 * ```
35
 *
36
 * @stream
37
 * @signature Number -> Number -> Number
38
 * @param  int|float $x
0 ignored issues
show
There is no parameter named $x. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
39
 * @param  int|float $y
0 ignored issues
show
There is no parameter named $y. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
40
 * @return int|float
41
 */
42 View Code Duplication
function minus() {
0 ignored issues
show
This function 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...
43
    static $minus = false;
44
    $minus = $minus ?: curry(function($x, $y){
45
        return $x - $y;
46
    });
47
    return _apply($minus, func_get_args());
48
}
49
50
/**
51
 * Computes `- $x`.
52
 *
53
 * ```php
54
 * F\negate(5); //=> -5
55
 * F\negate(-7); //=> 7
56
 * ```
57
 *
58
 * @stream
59
 * @signature Number -> Number
60
 * @param  int|float $x
0 ignored issues
show
There is no parameter named $x. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
61
 * @return int|float
62
 */
63 View Code Duplication
function negate() {
0 ignored issues
show
This function 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...
64
    static $negate = false;
65
    $negate = $negate ?: curry(function($x){
66
        return -$x;
67
    });
68
    return _apply($negate, func_get_args());
69
}
70
71
/**
72
 * Computes `$x * $y`.
73
 *
74
 * ```php
75
 * $double = F\multiply(2);
76
 * $double(5); //=> 10
77
 * ```
78
 *
79
 * @stream
80
 * @signature Number -> Number -> Number
81
 * @param  int|float $x
0 ignored issues
show
There is no parameter named $x. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
82
 * @param  int|float $y
0 ignored issues
show
There is no parameter named $y. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
83
 * @return int|float
84
 */
85 View Code Duplication
function multiply() {
0 ignored issues
show
This function 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...
86
    static $multiply = false;
87
    $multiply = $multiply ?: curry(function($x, $y){
88
        return $y * $x;
89
    });
90
    return _apply($multiply, func_get_args());
91
}
92
93
/**
94
 * Computes `$x / $y`.
95
 *
96
 * ```php
97
 * F\divide(10, 2); //=> 5
98
 * ```
99
 *
100
 * @stream
101
 * @signature Number -> Number -> Number
102
 * @param  int|float $x
0 ignored issues
show
There is no parameter named $x. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
103
 * @param  int|float $y
0 ignored issues
show
There is no parameter named $y. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
104
 * @return int|float
105
 */
106 View Code Duplication
function divide() {
0 ignored issues
show
This function 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...
107
    static $divide = false;
108
    $divide = $divide ?: curry(function($x, $y){
109
        return $x / $y;
110
    });
111
    return _apply($divide, func_get_args());
112
}
113
114
/**
115
 * Computes `$x % $y`.
116
 *
117
 * ```php
118
 * F\modulo(10, 3); //=> 1
119
 * ```
120
 *
121
 * @stream
122
 * @signature Number -> Number -> Number
123
 * @param  int|float $x
0 ignored issues
show
There is no parameter named $x. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
124
 * @param  int|float $y
0 ignored issues
show
There is no parameter named $y. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
125
 * @return int|float
126
 */
127 View Code Duplication
function modulo() {
0 ignored issues
show
This function 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...
128
    static $modulo = false;
129
    $modulo = $modulo ?: curry(function($x, $y){
130
        return $x % $y;
131
    });
132
    return _apply($modulo, func_get_args());
133
}
134
135
/**
136
 * Computes the sum of an array of numbers.
137
 *
138
 * ```php
139
 * F\sum([1, 2, 3, 4]); //=> 10
140
 * F\sum([]); //=> 0
141
 * ```
142
 *
143
 * @stream
144
 * @signature [Number] -> Number
145
 * @param  array $numbers
0 ignored issues
show
There is no parameter named $numbers. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
146
 * @return int|float
147
 */
148
function sum() {
149
    static $sum = false;
150
    $sum = $sum ?: curry('array_sum');
151
    return _apply($sum, func_get_args());
152
}
153
154
/**
155
 * Computes the product of an array of numbers.
156
 *
157
 * ```php
158
 * F\product([1, 2, 3, 4]); //=> 24
159
 * F\product([]); //=> 1
160
 * ```
161
 *
162
 * @stream
163
 * @signature [Number] -> Number
164
 * @param  array $numbers
0 ignored issues
show
There is no parameter named $numbers. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
165
 * @return int|float
166
 */
167
function product() {
168
    static $product = false;
169
    $product = $product ?: curry('array_product');
170
    return _apply($product, func_get_args());
171
}
172
173
/**
174
 * Computes the minimum of two numbers.
175
 *
176
 * ```php
177
 * F\min(1, 3); //=> 1
178
 * F\min(1, -3); //=> -3
179
 * ```
180
 *
181
 * @stream
182
 * @signature Number -> Number -> Number
183
 * @param  number $a
0 ignored issues
show
There is no parameter named $a. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
184
 * @param  number $b
0 ignored issues
show
There is no parameter named $b. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
185
 * @return number
186
 */
187 View Code Duplication
function min() {
0 ignored issues
show
This function 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...
188
    static $min = false;
189
    $min = $min ?: curry(function($a, $b){
190
        return $a < $b ? $a : $b;
191
    });
192
    return _apply($min, func_get_args());
193
}
194
195
/**
196
 * Computes the minimum of two elements using a function.
197
 *
198
 * ```php
199
 * F\minBy(F\length(), 'Hello', 'Hi'); //=> 'Hi'
200
 * F\minBy('abs', 1, -3); //=> 1
201
 * ```
202
 *
203
 * @stream
204
 * @signature (a -> Number) -> a -> a -> a
205
 * @param  callable $fn
0 ignored issues
show
There is no parameter named $fn. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
206
 * @param  mixed $a
0 ignored issues
show
There is no parameter named $a. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
207
 * @param  mixed $b
0 ignored issues
show
There is no parameter named $b. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
208
 * @return mixed
209
 */
210 View Code Duplication
function minBy() {
0 ignored issues
show
This function 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...
211
    static $minBy = false;
212
    $minBy = $minBy ?: curry(function($fn, $a, $b){
213
        return $fn($a) < $fn($b) ? $a : $b;
214
    });
215
    return _apply($minBy, func_get_args());
216
}
217
218
/**
219
 * Computes the maximum of two numbers.
220
 *
221
 * ```php
222
 * F\max(1, 3); //=> 3
223
 * F\max(1, -3); //=> 1
224
 * ```
225
 *
226
 * @stream
227
 * @signature Number -> Number -> Number
228
 * @param  number $a
0 ignored issues
show
There is no parameter named $a. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
229
 * @param  number $b
0 ignored issues
show
There is no parameter named $b. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
230
 * @return number
231
 */
232 View Code Duplication
function max() {
0 ignored issues
show
This function 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...
233
    static $max = false;
234
    $max = $max ?: curry(function($a, $b){
235
        return $a > $b ? $a : $b;
236
    });
237
    return _apply($max, func_get_args());
238
}
239
240
/**
241
 * Computes the maximum of two elements using a function.
242
 *
243
 * ```php
244
 * F\maxBy(F\length(), 'Hello', 'Hi'); //=> 'Hello'
245
 * F\maxBy('abs', 1, -3); //=> -3
246
 * ```
247
 *
248
 * @stream
249
 * @signature (a -> Number) -> a -> a -> a
250
 * @param  callable $fn
0 ignored issues
show
There is no parameter named $fn. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
251
 * @param  mixed $a
0 ignored issues
show
There is no parameter named $a. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
252
 * @param  mixed $b
0 ignored issues
show
There is no parameter named $b. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
253
 * @return mixed
254
 */
255
function maxBy() {
256
    static $maxBy = false;
257
    $maxBy = $maxBy ?: curry(function($fn, $a, $b){
258
        return $fn($a) > $fn($b) ? $a : $b;
259
    });
260
    return _apply($maxBy, func_get_args());
261
}
262