File Double.php
has 295 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace Kahlan\Plugin;
use Kahlan\Jit\Parser;
use Kahlan\Jit\Patcher\Pointcut;
Method generate
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function generate($options = [])
{
$defaults = [
'class' => 'Kahlan\Spec\Plugin\Double\Double' . static::$_index++,
'extends' => '',
Function _generateMethodStubs
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
protected static function _generateMethodStubs($methods, $defaults = true)
{
$result = [];
$methods = $methods !== null ? (array) $methods : [];
- 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 instance
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public static function instance($options = [])
{
$class = static::classname($options);
if (isset($options['args'])) {
- 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 _generateSignature
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
protected static function _generateSignature($method)
{
$params = [];
$isVariadic = $method->isVariadic();
- 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 generate
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function generate($options = [])
{
$defaults = [
'class' => 'Kahlan\Spec\Plugin\Double\Double' . static::$_index++,
'extends' => '',
- 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 _generateInterfaceMethods
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected static function _generateInterfaceMethods($interfaces, $mask = 255)
{
if (!$interfaces) {
return [];
}
- 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"