kahlan/kahlan

View on GitHub
src/Analysis/Debugger.php

Summary

Maintainability
C
1 day
Test Coverage
A
97%

Method backtrace has 37 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function backtrace($options = [])
    {
        $defaults = [
            'trace'  => [],
            'start'  => 0,
Severity: Minor
Found in src/Analysis/Debugger.php - About 1 hr to fix

    Method errorType has 33 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public static function errorType($value)
        {
            switch ($value) {
                case E_ERROR:
                    return 'E_ERROR';
    Severity: Minor
    Found in src/Analysis/Debugger.php - About 1 hr to fix

      Function backtrace has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function backtrace($options = [])
          {
              $defaults = [
                  'trace'  => [],
                  'start'  => 0,
      Severity: Minor
      Found in src/Analysis/Debugger.php - About 1 hr 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 _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

      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 'E_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_STRICT';
          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_CORE_WARNING';
              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_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_CORE_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_NOTICE';
                      Severity: Major
                      Found in src/Analysis/Debugger.php - About 30 mins to fix

                        Avoid too many return statements within this method.
                        Open

                                        return 'E_COMPILE_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_COMPILE_WARNING';
                          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

                              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

                              There are no issues that match your filters.

                              Category
                              Status