crysalead/kahlan

View on GitHub

Showing 187 of 191 total issues

Function _check has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function _check($reference)
    {
        $isString = is_string($reference);
        if ($isString) {
            if (!class_exists($reference)) {
Severity: Minor
Found in src/Matcher/ToReceive.php - About 25 mins to fix

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 _execute has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function _execute()
    {
        if (!$this->enabled() && !$this->focused()) {
            return;
        }
Severity: Minor
Found in src/Block/Group.php - About 25 mins to fix

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 broadcastFocus has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function broadcastFocus()
    {
        foreach ($this->_children as $child) {
            if ($child->type() !== 'normal') {
                continue;
Severity: Minor
Found in src/Block/Group.php - About 25 mins to fix

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'    => '',
Severity: Minor
Found in src/Plugin/Double.php - About 25 mins to fix

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 _processNode has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function _processNode($file, $node, $coverage, $path)
    {
        if ($node->type === 'namespace') {
            $path = "{$path}" . $node->name . '\\';
            $this->_processTree($file, $node->tree, $coverage, $path);
Severity: Minor
Found in src/Reporter/Coverage/Collector.php - About 25 mins to fix

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 returnTypehint has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function returnTypehint($type)
    {
        if (!$type) {
            return '';
        }
Severity: Minor
Found in src/Analysis/Inspector.php - About 25 mins to fix

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 loader has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public static function loader($loader = null)
    {
        if ($loader) {
            return static::$_loader = $loader;
        }
Severity: Minor
Found in src/Analysis/Debugger.php - About 25 mins to fix

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

Severity
Category
Status
Source
Language