crysalead/kahlan

View on GitHub

Showing 187 of 191 total issues

Function _processTree has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    protected function _processTree($parent)
    {
        $hasScope = $parent instanceof FunctionDef || $parent->type === 'namespace' | $parent->type === 'declare';
        if ($hasScope) {
            $this->_variables[++$this->_depth] = [];
Severity: Minor
Found in src/Jit/Patcher/Monkey.php - About 55 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 findFile has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function findFile($class)
    {
        // class map lookup
        if (isset($this->_classMap[$class])) {
            return $this->_classMap[$class];
Severity: Minor
Found in src/Jit/ClassLoader.php - About 55 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 __invoke has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function __invoke($args = [], $self = null)
    {
        if ($this->_closures) {
            if (isset($this->_closures[$this->_returnIndex])) {
                $closure = $this->_closures[$this->_returnIndex++];
Severity: Minor
Found in src/Plugin/Stub/Method.php - About 55 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 _processTree has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    protected function _processTree($parent)
    {
        foreach ($parent->tree as $node) {
            if ($node->processable && $node->type === 'class' && $node->extends) {
                $namespace = $node->namespace->name . '\\';
Severity: Minor
Found in src/Jit/Patcher/Layer.php - About 55 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 addFile has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function addFile($file, $coverage)
    {
        $file = $this->realpath($file);
        if (!$this->collectable($file)) {
            return;
Severity: Minor
Found in src/Reporter/Coverage/Collector.php - About 55 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 _generateSignature has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    protected static function _generateSignature($method)
    {
        $params = [];
        $isVariadic = $method->isVariadic();

Severity: Minor
Found in src/Plugin/Double.php - About 55 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 focus has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public static function focus($pattern, $backtrace, $depth = null, $maxLookup = 10)
    {
        if (!$pattern) {
            return $backtrace;
        }
Severity: Minor
Found in src/Analysis/Debugger.php - About 55 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 _reportSummary has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function _reportSummary($summary)
    {
        $passed = $summary->passed();
        $skipped = $summary->skipped();
        $pending = $summary->pending();
Severity: Minor
Found in src/Reporter/Terminal.php - About 55 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 _line has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    protected static function _line($trace)
    {
        $path = $trace['file'];
        $callLine = $trace['line'];
        if (!file_exists($path)) {
Severity: Minor
Found in src/Analysis/Debugger.php - About 55 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 __construct has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function __construct($actual, $expected)
    {
        $this->_backtrace = Debugger::backtrace();

        if (is_string($actual)) {
Severity: Minor
Found in src/Matcher/ToReceive.php - About 45 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 backtrace has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function backtrace($backtrace = [])
    {
        if (!func_num_args()) {
            return $this->_backtrace;
        }
Severity: Minor
Found in src/Log.php - About 45 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 __construct has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function __construct($config = [])
    {
        $defaults = [
            'coverage' => 0,
            'cleanup' => true
Severity: Minor
Found in src/Reporter/Coverage/Driver/Xdebug.php - About 45 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 _renderMetricsReport has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    protected function _renderMetricsReport($metricsReport, $labelWidth, $lineWidth, $depth)
    {
        $nbChilden = count($metricsReport);
        $index = 0;
        foreach ($metricsReport as $name => $data) {
Severity: Minor
Found in src/Reporter/Coverage.php - About 45 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 get has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function get($name = null)
    {
        if (func_num_args()) {
            return $this->_get($name);
        }
Severity: Minor
Found in src/Cli/CommandLine.php - About 45 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 detach has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public static function detach($context, $method = null)
    {
        if (func_num_args() === 2) {
            $value = static::_ref($context, $method);
        } else {
Severity: Minor
Found in src/Filter/Filters.php - About 45 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 _matcher has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function _matcher($matcherName, $actual)
    {
        $target = null;
        if (!Matcher::exists($matcherName, true)) {
            throw new Exception("Unexisting matcher attached to `'{$matcherName}'`.");
Severity: Minor
Found in src/Expectation.php - About 45 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 _skipChildren has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    protected function _skipChildren($exception, $emit = false)
    {
        $log = $this->log();
        if ($this instanceof Group) {
            foreach ($this->children() as $child) {
Severity: Minor
Found in src/Block.php - About 45 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 _reportSkipped has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    protected function _reportSkipped($summary)
    {
        foreach ([
            'pending'  => 'cyan',
            'excluded' => 'yellow',
Severity: Minor
Found in src/Reporter/Terminal.php - About 45 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 _buildDescription has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function _buildDescription($startIndex = 0)
    {
        $times = $this->times();

        $report = $this->_report;
Severity: Minor
Found in src/Matcher/ToReceive.php - About 45 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 nextMatchingBracket has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public function nextMatchingBracket()
    {
        if (!$this->valid()) {
            return;
        }
Severity: Minor
Found in src/Jit/TokenStream.php - About 45 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