bkdotcom/PHPDebugConsole

View on GitHub

Showing 199 of 244 total issues

Function asItem has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    private function asItem($item)
    {
        if ($item instanceof ElementInterface) {
            return $item;
        }
Severity: Minor
Found in src/Teams/Elements/TableCell.php - About 45 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

Method __construct has 6 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public function __construct(Debug $subject, $method, $args = array(), $meta = array(), $defaultArgs = array(), $argsToMeta = array())
Severity: Minor
Found in src/Debug/LogEntry.php - About 45 mins to fix

    Function isExcluded has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        protected function isExcluded(array $logEntry)
        {
            $category = $logEntry[2];
            if (\strpos($category, 'system.db') === 0 && \preg_match('/^(Opening|Closing)/', $logEntry[0])) {
                return false;
    Severity: Minor
    Found in src/Debug/Framework/Yii1_1/LogRoute.php - About 45 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 sort has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        public function sort(array $array, $order = 'visibility')
        {
            $sortVisOrder = array('public', 'magic', 'magic-read', 'magic-write', 'protected', 'private', 'debug');
            $sortData = array(
                'name' => array(),
    Severity: Minor
    Found in src/Debug/Abstraction/ObjectAbstraction.php - About 45 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

    Method errorFactory has 6 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        protected function errorFactory(self $handler, $errType, $errMsg, $file, $line, $vars = array())
    Severity: Minor
    Found in src/ErrorHandler/ErrorHandler.php - About 45 mins to fix

      Function unsubscribeFromPriority has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          private function unsubscribeFromPriority($eventName, $callable, $priority, $onlyOnce)
          {
              $search = \array_filter(array(
                  'callable' => $callable,
                  'onlyOnce' => $onlyOnce,
      Severity: Minor
      Found in src/PubSub/ManagerHelperTrait.php - About 45 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 processLogEntry has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          public function processLogEntry(LogEntry $logEntry)
          {
              $args = $logEntry['args'];
              $meta = \array_merge(array(
                  'format' => 'raw',
      Severity: Minor
      Found in src/Debug/Route/Wamp.php - About 45 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 applyOptions has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          private function applyOptions(RequestInterface $request, $options)
          {
              if (\is_array($options['headers']) !== true) {
                  throw new InvalidArgumentException('headers must be an array');
              }
      Severity: Minor
      Found in src/CurlHttpMessage/Client.php - About 45 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 colKeysMerge has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

          private static function colKeysMerge($curRowKeys, $colKeys)
          {
              $newKeys = array();
              $count = \count($curRowKeys);
              for ($i = 0; $i < $count; $i++) {
      Severity: Minor
      Found in src/Debug/Utility/Table.php - About 45 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

      Method bindColumn has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          public function bindColumn($column, &$param, $type = null, $maxlen = null, $driverdata = null)
      Severity: Minor
      Found in src/Debug/Collector/Pdo/Statement.php - About 35 mins to fix

        Method __construct has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            public function __construct($consumerKey, $consumerSecret, $signatureMethod = OAUTH_SIG_METHOD_HMACSHA1, $authType = OAUTH_AUTH_TYPE_AUTHORIZATION, $debug = null)
        Severity: Minor
        Found in src/Debug/Collector/OAuth.php - About 35 mins to fix

          Method bindParam has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              public function bindParam($parameter, &$variable, $dataType = PdoBase::PARAM_STR, $length = null, $driverOptions = null)
          Severity: Minor
          Found in src/Debug/Collector/Pdo/Statement.php - About 35 mins to fix

            Function buildChannelLi has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            function buildChannelLi (channelName, value, isChecked, isRoot, options) {
            Severity: Minor
            Found in src/Debug/js_src/enhanceMain.js - About 35 mins to fix

              Function expandGroupObjNext has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              function expandGroupObjNext ($toggle, $classTarget, $evtTarget, icon, eventNameDone) {
              Severity: Minor
              Found in src/Debug/js_src/expandCollapse.js - About 35 mins to fix

                Method markupIdentifier has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    public function markupIdentifier($val, $asFunction = false, $tagName = 'span', $attribs = array(), $wbr = false)
                Severity: Minor
                Found in src/Debug/Dump/Html/Value.php - About 35 mins to fix

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

                  export function expand ($node) {
                    var icon = config.iconsExpand.collapse
                    var isToggle = $node.is('[data-toggle]')
                    var what = isToggle
                      ? $node.data('toggle')
                  Severity: Minor
                  Found in src/Debug/js_src/expandCollapse.js - 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 debugEnhance has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                  $.fn.debugEnhance = function (method, arg1, arg2) {
                    // console.warn('debugEnhance', method, this)
                    if (method === 'sidebar') {
                      debugEnhanceSidebar(this, arg1)
                    } else if (method === 'buildChannelList') {
                  Severity: Minor
                  Found in src/Debug/js_src/main.js - 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 buildFooter has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                      protected function buildFooter()
                      {
                          $haveTotal = false;
                          $cells = array();
                          foreach ($this->options['tableInfo']['columns'] as $colInfo) {
                  Severity: Minor
                  Found in src/Debug/Dump/Html/Table.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 tippyContent has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function tippyContent (reference) {
                    var $ref = $(reference)
                    var attributes
                    var title
                    if ($ref.hasClass('fa-hashtag')) {
                  Severity: Minor
                  Found in src/Debug/js_src/Tooltip.js - 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 findEvalCode has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                      private static function findEvalCode(array $backtrace, $index)
                      {
                          $backtrace = \array_slice($backtrace, $index);
                          $lines = false;
                          foreach ($backtrace as $frame) {
                  Severity: Minor
                  Found in src/Backtrace/Context.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

                  Severity
                  Category
                  Status
                  Source
                  Language