crysalead/kahlan

View on GitHub

Showing 187 of 191 total issues

Avoid too many return statements within this method.
Open

                return 'E_USER_ERROR';
Severity: Major
Found in src/Analysis/Debugger.php - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

                    return 'E_STRICT';
    Severity: Major
    Found in src/Analysis/Debugger.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

                      return 'E_RECOVERABLE_ERROR';
      Severity: Major
      Found in src/Analysis/Debugger.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                        return 'E_USER_DEPRECATED';
        Severity: Major
        Found in src/Analysis/Debugger.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                          return 'E_USER_WARNING';
          Severity: Major
          Found in src/Analysis/Debugger.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                    return '<INVALID>';
            Severity: Major
            Found in src/Analysis/Debugger.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                              return 'E_USER_NOTICE';
              Severity: Major
              Found in src/Analysis/Debugger.php - About 30 mins to fix

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

                    public function methods($name = [])
                    {
                        if (!func_num_args()) {
                            return $this->_methods;
                        }
                Severity: Minor
                Found in src/Plugin/Stub.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 __construct has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function __construct($reference)
                    {
                        $reference = $this->_reference($reference);
                        $isString = is_string($reference);
                        if ($isString) {
                Severity: Minor
                Found in src/Plugin/Stub.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 _generateInterfaceMethods has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    protected static function _generateInterfaceMethods($interfaces, $mask = 255)
                    {
                        if (!$interfaces) {
                            return [];
                        }
                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 match has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function match($call, $withArgs = true)
                    {
                        if (preg_match('/^::.*/', $call['name'])) {
                            $call['static'] = true;
                            $call['name'] = substr($call['name'], 2);
                Severity: Minor
                Found in src/Plugin/Call/Message.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 _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 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 _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 _blockEnd has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    protected function _blockEnd($runAfterAll = true)
                    {
                        if (!$this->enabled()) {
                            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 _process has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    protected function _process($options = [])
                    {
                        $suite = $this->suite();
                        if ($suite->root()->focused() && !$this->focused()) {
                            return;
                Severity: Minor
                Found in src/Block.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 _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 partition has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    public function partition($index, $total)
                    {
                        $index = (integer) $index;
                        $total = (integer) $total;
                        if (!$index || !$total || $index > $total) {
                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 _normalizeClass has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                Open

                    protected function _normalizeClass($name)
                    {
                        if (!$name || $name[0] === '\\') {
                            return $name;
                        }
                Severity: Minor
                Found in src/Jit/Parser.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