bkdotcom/PHPDebugConsole

View on GitHub

Showing 155 of 175 total issues

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

function rowComparator (col, dir, collator) {
  var floatRe = /^([+-]?(?:0|[1-9]\d*)(?:\.\d*)?)(?:[eE]([+-]?\d+))?$/
  return function sortFunction (trA, trB) {
    var a = trA.cells[col].textContent.trim()
    var b = trB.cells[col].textContent.trim()
Severity: Minor
Found in src/Debug/js_src/tableSort.js - 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 resolvePhpDocType has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

    public function resolvePhpDocType($type, Abstraction $abs)
    {
        if (!$type || !$abs['fullyQualifyPhpDocType']) {
            return $type;
        }
Severity: Minor
Found in src/Debug/Abstraction/AbstractObjectHelper.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 processlogEntries has 36 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function processlogEntries(Event $event)
    {
        $this->dumper->crateRaw = false;
        $this->data = $this->debug->data->get();
        $errorStats = $this->debug->errorStats();
Severity: Minor
Found in src/Debug/Route/Script.php - About 1 hr to fix

    Function reduceDataFill has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

        protected function reduceDataFill($max, $logBack = array())
        {
            $indexes = \array_reverse(\array_keys($logBack));
            $depth = 0;
            $groupOnly = false;
    Severity: Minor
    Found in src/Debug/Route/ChromeLogger.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 doProfile has 35 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function doProfile(LogEntry $logEntry)
        {
            $debug = $logEntry->getSubject();
            if (!$debug->getCfg('enableProfiling', Debug::CONFIG_DEBUG)) {
                $callerInfo = $debug->backtrace->getCallerInfo();
    Severity: Minor
    Found in src/Debug/Method/Profile.php - About 1 hr to fix

      Function enhanceInner has 34 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export function enhanceInner ($nodeObj) {
        var $inner = $nodeObj.find('> .object-inner')
        var accessible = $nodeObj.data('accessible')
        var hiddenInterfaces = []
        if ($nodeObj.is('.enhanced')) {
      Severity: Minor
      Found in src/Debug/js_src/enhanceObject.js - About 1 hr to fix

        Function buildChannelLis has 32 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function buildChannelLis (channels, nameRoot, checkedChannels, prepend) {
          var $li
          var $lis = []
          var channel
          var channelName = ''
        Severity: Minor
        Found in src/Debug/js_src/enhanceMain.js - About 1 hr to fix

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

              public static function getFirstIndex($backtrace, $offset, $levelMax = null)
              {
                  $levelMax = self::initSkippableTests($levelMax);
                  $count = \count($backtrace);
                  for ($i = 1; $i < $count; $i++) {
          Severity: Minor
          Found in src/Backtrace/SkipInternal.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 onCfgChannels has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

              private function onCfgChannels($val)
              {
                  $tree = array();
                  foreach ($val as $name => $config) {
                      $ref = &$tree;
          Severity: Minor
          Found in src/Debug/ConfigEvents.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 addDebugWalk has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

              private function addDebugWalk(Abstraction $abs)
              {
                  $debugInfo = $abs['debugInfo'];
                  $properties = $abs['properties'];
                  foreach ($properties as $name => $info) {
          Severity: Minor
          Found in src/Debug/Abstraction/AbstractObjectProperties.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 extractTypeFromBody has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

              protected static function extractTypeFromBody($body)
              {
                  $type = '';
                  $nestingLevel = 0;
                  for ($i = 0, $iMax = \strlen($body); $i < $iMax; $i++) {
          Severity: Minor
          Found in src/Debug/Utility/PhpDoc.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 createFileLinksTrace has 30 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function createFileLinksTrace ($entry, remove) {
            var isUpdate = $entry.find('.file-link').length > 0
            if (!isUpdate) {
              $entry.find('table thead tr > *:last-child').after('<th></th>')
            } else if (remove) {
          Severity: Minor
          Found in src/Debug/js_src/FileLinks.js - About 1 hr to fix

            Function visToggles has 30 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function visToggles ($inner, accessible) {
              var flags = {
                hasProtected: $inner.children('.protected').not('.magic, .magic-read, .magic-write').length > 0,
                hasPrivate: $inner.children('.private').not('.magic, .magic-read, .magic-write').length > 0,
                hasExcluded: $inner.children('.debuginfo-excluded').hide().length > 0,
            Severity: Minor
            Found in src/Debug/js_src/enhanceObject.js - About 1 hr to fix

              Function set has 29 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              Config.prototype.set = function (key, val) {
                var lsObj = {}
                var setVals = {}
                var haveLsKey = false
                if (typeof key === 'object') {
              Severity: Minor
              Found in src/Debug/js_src/config.js - About 1 hr to fix

                Method onRequest has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function onRequest(RequestInterface $request, array $options)
                    {
                        $requestInfo = array(
                            'isAsyncronous' => empty($options[RequestOptions::SYNCHRONOUS]),
                            'requestId' => \spl_object_hash($request),
                Severity: Minor
                Found in src/Debug/Collector/GuzzleMiddleware.php - About 1 hr to fix

                  Function enhanceGroup has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function enhanceGroup ($group) {
                    // console.log('enhanceGroup', $group[0])
                    var $toggle = $group.find('> .group-header')
                    var $target = $toggle.next()
                    addIcons($group) // custom data-icon
                  Severity: Minor
                  Found in src/Debug/js_src/enhanceEntries.js - About 1 hr to fix

                    Method getReflectorFromString has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        private static function getReflectorFromString($string)
                        {
                            $regex = '/^'
                                . '(?P<class>[\w\\\]+)' // classname
                                . '(?:::(?:'
                    Severity: Minor
                    Found in src/Debug/Utility/Php.php - About 1 hr to fix

                      Method process has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function process($args, $options = array())
                          {
                              if (\is_string($args[0]) === false) {
                                  return $args;
                              }
                      Severity: Minor
                      Found in src/Debug/Dump/Substitution.php - About 1 hr to fix

                        Method callerInfoBuild has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            private static function callerInfoBuild($backtrace)
                            {
                                $return = array(
                                    'class' => null,         // where the method is defined
                                    'classCalled' => null,   // parent::method()... this will be the parent class
                        Severity: Minor
                        Found in src/Backtrace/Backtrace.php - About 1 hr to fix

                          Method processLogEntries has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function processLogEntries(Event $event = null)
                              {
                                  $data = $this->debug->data->get();
                                  foreach ($data['alerts'] as $logEntry) {
                                      $this->processLogEntryViaEvent($logEntry);
                          Severity: Minor
                          Found in src/Debug/Route/Wamp.php - About 1 hr to fix
                            Severity
                            Category
                            Status
                            Source
                            Language