crysalead/kahlan

View on GitHub

Showing 187 of 191 total issues

Method _stubbedMethod has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    protected static function _stubbedMethod($lsb, $self, $class, $name, $args)
Severity: Minor
Found in src/Plugin/Pointcut.php - About 35 mins to fix

    Method _getMetricsReport has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        protected function _getMetricsReport($children, $verbosity, $depth = 0, $tab = 3, &$maxWidth = null)
    Severity: Minor
    Found in src/Reporter/Coverage.php - About 35 mins to fix

      Method run has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          public static function run($context, $method, $params, $callback, $filters = [])
      Severity: Minor
      Found in src/Filter/Filters.php - About 35 mins to fix

        Function _annotationNode has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            protected function _annotationNode()
            {
                $cpt = 1; //because #[
                $this->_codeNode();
                $token = $this->_stream->current(true);
        Severity: Minor
        Found in src/Jit/Parser.php - About 35 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 _reportSpecMessage has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            protected function _reportSpecMessage($log)
            {
                $messages = $log->messages();
                $message = end($messages);
        
        
        Severity: Minor
        Found in src/Reporter/Tree.php - About 35 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 _coverage has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

                protected function _coverage()
                {
                    return Filters::run($this, 'coverage', [], function ($chain) {
                        if (!$this->commandLine()->exists('coverage')) {
                            return;
        Severity: Minor
        Found in src/Cli/Kahlan.php - About 35 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 add has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            public function add($prefix, $paths, $prepend = false)
            {
                if (!$prefix) {
                    if ($prepend) {
                        $this->_fallbackDirsPsr0 = array_merge(
        Severity: Minor
        Found in src/Jit/ClassLoader.php - About 35 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 _classNode has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            protected function _classNode()
            {
                if (substr($this->_states['body'], -2) === '::') { // Bails out on `::class`
                    $this->_states['body'] .= 'class';
                    return;
        Severity: Minor
        Found in src/Jit/Parser.php - About 35 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 _reportSpecMessage has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            protected function _reportSpecMessage($log)
            {
                $messages = $log->messages();
                $message = end($messages);
        
        
        Severity: Minor
        Found in src/Reporter/Terminal.php - About 35 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 _processMetrics has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            protected function _processMetrics($file, $node, $coverage)
            {
                $metrics = [
                    'loc'      => 0,
                    'nlloc'    => 0,
        Severity: Minor
        Found in src/Reporter/Coverage/Collector.php - About 35 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 allowed has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            public function allowed($class)
            {
                foreach ($this->_exclude as $namespace) {
                    if (strpos($class, $namespace) === 0) {
                        return false;
        Severity: Minor
        Found in src/Jit/ClassLoader.php - About 35 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 stop has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            public function stop()
            {
                $data = xdebug_get_code_coverage();
                xdebug_stop_code_coverage($this->_config['cleanup']);
        
        
        Severity: Minor
        Found in src/Reporter/Coverage/Driver/Xdebug.php - About 35 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 clean has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            public static function clean($str, $options = [])
            {
                $options += [
                    'before'      => '{:',
                    'after'       => '}',
        Severity: Minor
        Found in src/Util/Text.php - About 35 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 _processMethods has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            protected function _processMethods($parent)
            {
                foreach ($parent->tree as $child) {
                    if (!$child->processable) {
                        continue;
        Severity: Minor
        Found in src/Jit/Patcher/Pointcut.php - About 35 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 autoclear has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            public function autoclear()
            {
                foreach ($this->_autoclear as $plugin) {
                    if (is_object($plugin)) {
                        if (method_exists($plugin, 'clear')) {
        Severity: Minor
        Found in src/Suite.php - About 35 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 specEnd has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            public function specEnd($log = null)
            {
                switch ($log->type()) {
                    case 'passed':
                        $this->_write($this->_symbols['dot']);
        Severity: Minor
        Found in src/Reporter/Dot.php - About 35 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 _reportDiff has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            protected function _reportDiff($log)
            {
                $data = $log->data();
        
                $this->write("It expect actual ");
        Severity: Minor
        Found in src/Reporter/Terminal.php - About 35 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 match has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            public static function match($actual, $expected)
            {
                if (is_string($actual)) {
                    return strpos($actual, $expected) !== false;
                } elseif (is_iterable($actual)) {
        Severity: Minor
        Found in src/Matcher/ToContain.php - About 35 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 end has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            public function end($summary)
            {
                $this->_writeNewLine();
                $this->_reportSkipped($summary);
        
        
        Severity: Minor
        Found in src/Reporter/Tree.php - About 35 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 match has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            public function match($actual)
            {
                $target = null;
                $matcher = null;
                foreach ($this->_matchers as $target => $value) {
        Severity: Minor
        Found in src/Arg.php - About 35 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