Showing 191 of 191 total issues
Method end
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function end($summary)
{
$toString = function ($instance) {
return 'an instance of `' . get_class($instance) . '`';
};
Method _findFileWithExtension
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function _findFileWithExtension($class, $ext)
{
// PSR-4 lookup
$logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext;
Method _reportFailure
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function _reportFailure($log)
{
$this->_indent++;
$type = $log->type();
switch ($type) {
Function _getMetricsReport
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
protected function _getMetricsReport($children, $verbosity, $depth = 0, $tab = 3, &$maxWidth = null)
{
$list = [];
foreach ($children as $child) {
$type = $child->type();
- 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 specEnd
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function specEnd($log = null)
{
$isOk = $log->passed() ? "ok" : "not ok";
switch ($log->type()) {
- 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 _reportFailure
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
protected function _reportFailure($log)
{
$this->_indent++;
$type = $log->type();
switch ($type) {
- 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
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' => '',
Method _reportSummary
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function _reportSummary($summary)
{
$passed = $summary->passed();
$skipped = $summary->skipped();
$pending = $summary->pending();
Method _console
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function _console()
{
return Filters::run($this, 'console', [], function ($chain) {
$collection = $this->reporters();
Method __call
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __call($matcherName, $args)
{
$result = true;
$spec = $this->_actual;
$this->_passed = true;
Method _useNode
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function _useNode()
{
$current = $this->_states['current'];
$token = $this->_stream->current(true);
$last = $alias = $use = '';
Method _parseArgs
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function _parseArgs()
{
$cpt = 0;
$value = $name = '';
$args = [];
Function _blockEnd
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
protected function _blockEnd($runAfterEach = true)
{
$type = $this->log()->type();
foreach ($this->_expectations as $expectation) {
if (!($logs = $expectation->logs()) && $type !== 'errored') {
- 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 patched
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public static function patched($namespace, $className, $methodName, &$substitute = null)
{
$name = $className ?: $methodName;
if ($namespace && ($className || function_exists("{$namespace}\\{$name}"))) {
- 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
Method __construct
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct($options = [])
{
$defaults = ['autoloader' => null, 'suite' => null];
$options += $defaults;
Method backtrace
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function backtrace($options = [])
{
$defaults = [
'trace' => [],
'start' => 0,
Function _matchReference
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
protected static function _matchReference($reference, $logs = [])
{
foreach ($logs as $log) {
if (!$reference) {
if (empty($log['class']) && empty($log['instance'])) {
- 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 find
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public static function find($references, $method = null, $args = null)
{
$references = (array) $references;
$stub = null;
foreach ($references as $reference) {
- 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 typehint
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public static function typehint($parameter)
{
$type = $parameter->getType();
$typehint = '';
if ($type) {
- 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
Method _addClosingParenthesis
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function _addClosingParenthesis($pos, $index, $parent)
{
$count = 0;
$nodes = $parent->tree;
$total = count($nodes);