Function methodDI
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function methodDI(array $objectInfo, \Closure $callback = null)
{
$reflection = new \ReflectionObject($objectInfo[0]);
$methods = $reflection->getMethods();
$inputParams = [];
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function functionDI
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function functionDI(\Closure $function,
\Closure $callback = null)
{
$reflection = new \ReflectionFunction($function);
$functionParams = $reflection->getParameters();
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Missing class import via use statement (line '36', column '31'). Open
$reflection = new \ReflectionFunction($function);
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Missing class import via use statement (line '88', column '20'). Open
$ref = new \ReflectionClass($className);
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
Missing class import via use statement (line '59', column '31'). Open
$reflection = new \ReflectionObject($objectInfo[0]);
- Read upRead up
- Exclude checks
MissingImport
Since: 2.7.0
Importing all external classes in a file through use statements makes them clearly visible.
Example
function make() {
return new \stdClass();
}
Source http://phpmd.org/rules/cleancode.html#MissingImport
The closing parenthesis of a multi-line function declaration must be on a new line Open
\Closure $callback = null)
- Exclude checks
The first parameter of a multi-line function declaration must be on the line after the opening bracket Open
public static function constructObject($className,
- Exclude checks
The closing parenthesis and the opening brace of a multi-line function declaration must be on the same line Open
{
- Exclude checks
Multi-line function declaration not indented correctly; expected 8 spaces but found 43 Open
array $constructorArguments = [])
- Exclude checks
The closing parenthesis and the opening brace of a multi-line function declaration must be on the same line Open
{
- Exclude checks
The first parameter of a multi-line function declaration must be on the line after the opening bracket Open
public static function functionDI(\Closure $function,
- Exclude checks
Multi-line function declaration not indented correctly; expected 8 spaces but found 38 Open
\Closure $callback = null)
- Exclude checks
The closing parenthesis of a multi-line function declaration must be on a new line Open
array $constructorArguments = [])
- Exclude checks
Expected 1 newline at end of file; 0 found Open
}
- Exclude checks