renatoaraujo/debug

View on GitHub

Showing 7 of 33 total issues

Method applyHtmlTags has 48 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected static function applyHtmlTags($mixValue, $isArrayIndex = false)
    {

        if ($isArrayIndex) {
            $strHtmlTagsValue = '["<span class="literal">' . $mixValue . '</span>"]';
Severity: Minor
Found in src/Debug.php - About 1 hr to fix

    Function applyHtmlTags has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

        protected static function applyHtmlTags($mixValue, $isArrayIndex = false)
        {
    
            if ($isArrayIndex) {
                $strHtmlTagsValue = '["<span class="literal">' . $mixValue . '</span>"]';
    Severity: Minor
    Found in src/Debug.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

    Method dumpDataProvider has 38 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function dumpDataProvider()
        {
            $stdClass = \stdClass::class;
            $debugTest = $this;
            $debug = Debug::class;
    Severity: Minor
    Found in tests/DebugTest.php - About 1 hr to fix

      Function write has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          protected static function write()
          {
              $filePathContext = self::$arrBacktrace['file'];
              $lineContext = self::$arrBacktrace['line'];
              $argsContext = self::$arrBacktrace['args'];
      Severity: Minor
      Found in src/Debug.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

      Method console has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public static function console()
          {
              self::$arrBacktrace = array_shift(debug_backtrace());
              $strMessage = self::$arrBacktrace['file'] . ' on line ' . self::$arrBacktrace['line'];
              $arrLogDisplay = self::$arrBacktrace;
      Severity: Minor
      Found in src/Debug.php - About 1 hr to fix

        Method log has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public static function log()
            {
                self::$arrBacktrace = array_shift(debug_backtrace());
                $strMessage = self::$arrBacktrace['file'] . ' on line ' . self::$arrBacktrace['line'];
                $arrLogDisplay = self::$arrBacktrace;
        Severity: Minor
        Found in src/Debug.php - About 1 hr to fix

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

              public static function json()
              {
                  self::$arrBacktrace = array_shift(debug_backtrace());
                  $arrJsonDisplay = self::$arrBacktrace;
                  $arrJsonDisplay['debug'] = [];
          Severity: Minor
          Found in src/Debug.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

          Severity
          Category
          Status
          Source
          Language