kahlan/kahlan

View on GitHub

Showing 191 of 191 total issues

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

    public static function get($name = null, $target = '')
    {
        if (!func_num_args()) {
            return static::$_matchers;
        }
Severity: Minor
Found in src/Matcher.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 _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 _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 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

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

    public static function parameters($class, $method, $data = null)
    {
        $params = [];
        $reflexion = Inspector::inspect($class);
        $parameters = $reflexion->getMethod($method)->getParameters();
Severity: Minor
Found in src/Analysis/Inspector.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

Avoid too many return statements within this method.
Open

        return $quote . addcslashes($value, $quote) . $quote;
Severity: Major
Found in src/Util/Text.php - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

            return $result;
    Severity: Major
    Found in src/Expectation.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

              return $boxes[$name] = $box;
      Severity: Major
      Found in src/functions.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                    return $file;
        Severity: Major
        Found in src/Jit/ClassLoader.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                      return static::$_matchers[$name][''];
          Severity: Major
          Found in src/Matcher.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                    return false;
            Severity: Major
            Found in src/Jit/ClassLoader.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                  return $boxes[''];
              Severity: Major
              Found in src/functions.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                            return true;
                Severity: Major
                Found in src/Matcher/ToContainKey.php - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                          return false;
                  Severity: Major
                  Found in src/Matcher/ToContainKey.php - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                                    return false;
                    Severity: Major
                    Found in src/Matcher/ToContainKey.php - About 30 mins to fix

                      Avoid too many return statements within this method.
                      Open

                              return $config['value'];
                      Severity: Major
                      Found in src/Cli/CommandLine.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
                          Severity
                          Category
                          Status
                          Source
                          Language