The class F has 27 non-getter- and setter-methods. Consider refactoring F to keep number of methods under 25. Open
class F {
/**
* @brief `F::_` is a special placeholder value used to specify "gaps" within curried functions,
- Read upRead up
- Exclude checks
TooManyMethods
Since: 0.1
A class with too many methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.
By default it ignores methods starting with 'get' or 'set'.
The default was changed from 10 to 25 in PHPMD 2.3.
Example
Source https://phpmd.org/rules/codesize.html#toomanymethods
The class F has 27 public methods. Consider refactoring F to keep number of public methods under 10. Open
class F {
/**
* @brief `F::_` is a special placeholder value used to specify "gaps" within curried functions,
- Read upRead up
- Exclude checks
TooManyPublicMethods
Since: 0.1
A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.
By default it ignores methods starting with 'get' or 'set'.
Example
Source https://phpmd.org/rules/codesize.html#toomanypublicmethods
The method splitAt uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them. Open
} else {
$snd[] = $list[$i];
}
- Read upRead up
- Exclude checks
ElseExpression
Since: 1.4.0
An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.
Example
class Foo
{
public function bar($flag)
{
if ($flag) {
// one branch
} else {
// another branch
}
}
}
Source https://phpmd.org/rules/cleancode.html#elseexpression
A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 25 and the first side effect is on line 12. Open
<?php
- Exclude checks
Avoid variables with short names like $fn. Configured minimum length is 3. Open
return _curry2(function($fn, $array) {
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Avoid variables with short names like $fn. Configured minimum length is 3. Open
return _curry2(function($fn, $array) {
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Avoid variables with short names like $fn. Configured minimum length is 3. Open
return _curry2(function($fn, $array) {
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Avoid variables with short names like $fn. Configured minimum length is 3. Open
return _curry3(function($fn, $prop, $obj) {
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Avoid variables with short names like $fn. Configured minimum length is 3. Open
return _reduce(function($acc, $fn) {
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Avoid variables with short names like $fn. Configured minimum length is 3. Open
return _curry2(function($fn, $array) {
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Avoid variables with short names like $fn. Configured minimum length is 3. Open
return _curry2(function($fn, $params) {
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Avoid classes with short names like F. Configured minimum length is 3. Open
class F {
/**
* @brief `F::_` is a special placeholder value used to specify "gaps" within curried functions,
- Read upRead up
- Exclude checks
ShortClassName
Since: 2.9
Detects when classes or interfaces have a very short name.
Example
class Fo {
}
interface Fo {
}
Source https://phpmd.org/rules/naming.html#shortclassname
Avoid variables with short names like $fn. Configured minimum length is 3. Open
return _curry2(function($fn, $array) {
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Avoid variables with short names like $fn. Configured minimum length is 3. Open
return _curry3(function($fn, $default, $array) {
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Avoid variables with short names like $fn. Configured minimum length is 3. Open
return _curry2(function($fn, $array) {
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Avoid variables with short names like $fn. Configured minimum length is 3. Open
return _curry2(function($fn, $array) {
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Avoid variables with short names like $fn. Configured minimum length is 3. Open
return _curry2(function($fn, $array) {
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Avoid variables with short names like $fn. Configured minimum length is 3. Open
return _curry2(function($fn, $array) {
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Avoid variables with short names like $fn. Configured minimum length is 3. Open
return _curry2(function($fn, $array) {
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Avoid variables with short names like $fn. Configured minimum length is 3. Open
return _curry2(function($fn, $array) {
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Avoid variables with short names like $a. Configured minimum length is 3. Open
return _curry1(function($a) {
- Read upRead up
- Exclude checks
ShortVariable
Since: 0.2
Detects when a field, local, or parameter has a very short name.
Example
class Something {
private $q = 15; // VIOLATION - Field
public static function main( array $as ) { // VIOLATION - Formal
$r = 20 + $this->q; // VIOLATION - Local
for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
$r += $this->q;
}
}
}
Source https://phpmd.org/rules/naming.html#shortvariable
Opening brace of a class must be on the line after the definition Open
class F {
- Exclude checks
Expected 1 space after FUNCTION keyword; 0 found Open
return _curry3(function($fn, $default, $array) {
- Exclude checks
Expected 1 space after FUNCTION keyword; 0 found Open
return _curry2(function($value, $array) {
- Exclude checks
Expected 1 space after FUNCTION keyword; 0 found Open
return _curry2(function($prop, $arr) {
- Exclude checks
Expected 1 space after FUNCTION keyword; 0 found Open
? function(...$objs) use ($obj) { return array_merge($obj, ...$objs); }
- Exclude checks
Expected 1 space after FUNCTION keyword; 0 found Open
return _reduce(function($acc, $fn) {
- Exclude checks
Expected 1 space after FUNCTION keyword; 0 found Open
return _curry2(function($fn, $array) {
- Exclude checks
Function closing brace must go on the next line following the body; found 1 blank lines before brace Open
})(...$args);
- Exclude checks
Expected 1 space after FUNCTION keyword; 0 found Open
return _curry2(function($fn, $array) {
- Exclude checks
Expected 1 space after FUNCTION keyword; 0 found Open
return _curry2(function($fn, $array) {
- Exclude checks
The closing brace for the class must go on the next line after the body Open
}
- Exclude checks
Expected 1 space after FUNCTION keyword; 0 found Open
return _curry3(function($prop, $value, $obj) {
- Exclude checks
Expected 1 space after FUNCTION keyword; 0 found Open
return function(...$rest_params) use ($fn, $params) {
- Exclude checks
Expected 1 space after FUNCTION keyword; 0 found Open
return _curry2(function($fn, $array) {
- Exclude checks
Expected 1 space after FUNCTION keyword; 0 found Open
return _curry1(function($array) {
- Exclude checks
Expected 1 space after FUNCTION keyword; 0 found Open
return _curry2(function($fn, $array) {
- Exclude checks
Expected 1 space after FUNCTION keyword; 0 found Open
return _curry2(function($fn, $array) {
- Exclude checks
Expected 1 space after FUNCTION keyword; 0 found Open
return _curry1(function($arr) {
- Exclude checks
Expected 1 space after FUNCTION keyword; 0 found Open
return _curry2(function($fn, $array) {
- Exclude checks
Expected 1 space after FUNCTION keyword; 0 found Open
return _curry2(function($idx, $list) {
- Exclude checks
Expected 1 space after FUNCTION keyword; 0 found Open
return _curry3(function($fn, $prop, $obj) {
- Exclude checks
Expected 1 space after FUNCTION keyword; 0 found Open
return _curry2(function($fn, $array) {
- Exclude checks
Expected 1 space after FUNCTION keyword; 0 found Open
return _curry3(function($prop, $default, $obj) {
- Exclude checks
Expected 1 space after FUNCTION keyword; 0 found Open
return _curry2(function($fn, $array) {
- Exclude checks
Expected 1 space after FUNCTION keyword; 0 found Open
return _curry2(function($props, $arr) {
- Exclude checks
Expected 1 space after FUNCTION keyword; 0 found Open
return _curry2(function($props, $obj) {
- Exclude checks
Expected 1 space after FUNCTION keyword; 0 found Open
return _curry2(function($fn, $params) {
- Exclude checks
Expected 1 space after FUNCTION keyword; 0 found Open
return _curry2(function($fn, $array) {
- Exclude checks
Expected 1 space after FUNCTION keyword; 0 found Open
return _curry2(function($fn, $array) {
- Exclude checks
Expected 1 space after FUNCTION keyword; 0 found Open
return _curry1(function($a) {
- Exclude checks
Line exceeds 120 characters; contains 145 characters Open
* Takes a value and returns the it's `!` (NOT Logical operator). Returns true when passed a falsy value, and false when passed a truthy one.
- Exclude checks
Line exceeds 120 characters; contains 122 characters Open
* Performs right-to-left function composition. Like the unix pipe (|), but reversed ! All the function must be unary.
- Exclude checks
Opening brace should be on a new line Open
public static function each(...$args) {
- Exclude checks
Opening brace should be on a new line Open
public static function findIndex(...$args) {
- Exclude checks
Opening brace should be on a new line Open
public static function propEq(...$args) {
- Exclude checks
Opening brace should be on a new line Open
public static function propSatisfies(...$args) {
- Exclude checks
Opening brace should be on a new line Open
public static function find(...$args) {
- Exclude checks
Opening brace should be on a new line Open
public static function compose(...$fns) {
- Exclude checks
Opening brace should be on a new line Open
public static function not(...$args) {
- Exclude checks
Opening brace should be on a new line Open
public static function partition(...$args) {
- Exclude checks
Opening brace should be on a new line Open
public static function reduce(...$args) {
- Exclude checks
Opening brace should be on a new line Open
public static function every(...$args) {
- Exclude checks
Opening brace should be on a new line Open
public static function prop(...$args) {
- Exclude checks
Opening brace should be on a new line Open
public static function splitAt(...$args) {
- Exclude checks
Opening brace should be on a new line Open
public static function merge($obj, ...$objs) {
- Exclude checks
Opening brace should be on a new line Open
public static function flatMap(...$args) {
- Exclude checks
Opening brace should be on a new line Open
public static function sort(...$args) {
- Exclude checks
Opening brace should be on a new line Open
public static function map(...$args) {
- Exclude checks
Opening brace must be the last content on the line Open
public static function includes(...$args) { // TODO: make it work with strings
- Exclude checks
Opening brace should be on a new line Open
public static function reverse(...$args) {
- Exclude checks
Opening brace should be on a new line Open
public static function some(...$args) {
- Exclude checks
Opening brace should be on a new line Open
public static function props(...$args) {
- Exclude checks
Opening brace should be on a new line Open
public static function propOr(...$args) {
- Exclude checks
Opening brace must be the last content on the line Open
? function(...$objs) use ($obj) { return array_merge($obj, ...$objs); }
- Exclude checks
Closing brace must be on a line by itself Open
? function(...$objs) use ($obj) { return array_merge($obj, ...$objs); }
- Exclude checks
Opening brace should be on a new line Open
public static function pipe(...$fns) {
- Exclude checks
Opening brace should be on a new line Open
public static function includes(...$args) { // TODO: make it work with strings
- Exclude checks
Opening brace should be on a new line Open
public static function pick(...$args) {
- Exclude checks
Opening brace should be on a new line Open
public static function uniqBy(...$args) {
- Exclude checks
Opening brace should be on a new line Open
public static function uniq(...$args) {
- Exclude checks
Opening brace should be on a new line Open
public static function partial(...$args) {
- Exclude checks
Opening brace should be on a new line Open
public static function filter(...$args) {
- Exclude checks
The variable $rest_params is not named in camelCase. Open
public static function partial(...$args) {
return _curry2(function($fn, $params) {
return function(...$rest_params) use ($fn, $params) {
return call_user_func_array($fn, array_merge($params, $rest_params));
};
- Read upRead up
- Exclude checks
CamelCaseVariableName
Since: 0.2
It is considered best practice to use the camelCase notation to name variables.
Example
class ClassName {
public function doSomething() {
$data_module = new DataModule();
}
}