bkdotcom/PHPDebugConsole

View on GitHub

Showing 109 of 2,231 total issues

Function assertAnyOf has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected static function assertAnyOf($val, $tests, $message)
    {
        foreach ($tests as $callable) {
            try {
                if ($callable($val) === false) {
Severity: Minor
Found in src/Teams/CardUtilityTrait.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

Function searchRecursiveWalk has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private static function searchRecursiveWalk($search, array $array, $byKey)
    {
        foreach ($array as $key => $val) {
            if (\is_array($val) === false) {
                continue;
Severity: Minor
Found in src/Debug/Utility/ArrayUtil.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

Function addPlugin has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function addPlugin($plugin, $name = null)
    {
        $this->assertPlugin($plugin);
        if ($this->hasPlugin($plugin)) {
            return $this->debug;
Severity: Minor
Found in src/Debug/Plugin/Manager.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

Function dump has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function dump(ObjectAbstraction $abs)
    {
        $className = $this->dumpClassName($abs);
        if ($abs['isRecursion']) {
            return $className . "\n" . '<span class="t_recursion">*RECURSION*</span>';
Severity: Minor
Found in src/Debug/Dump/Html/HtmlObject.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

Function onImportObj has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private static function onImportObj($absValues)
    {
        if (isset($absValues['collectMethods'])) {
            if ($absValues['collectMethods'] === false) {
                $absValues['cfgFlags'] &= ~AbstractObject::METHOD_COLLECT;
Severity: Minor
Found in src/Debug/Utility/SerializeLog.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

Function getOption has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    public function getOption($path)
    {
        $path = \is_array($path)
            ? $path
            : \array_filter(\preg_split('#[\./]#', (string) $path), 'strlen');
Severity: Minor
Found in src/CurlHttpMessage/CurlReqRes.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

Function initSkippableTests has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    private static function initSkippableTests($levelMax)
    {
        if ($levelMax === null) {
            static::$internalClasses['levelCurrent'] = null;
            $levelMax = \end(static::$internalClasses['levels']);
Severity: Minor
Found in src/Backtrace/SkipInternal.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

Function onSet has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function onSet($values = array())
    {
        if ($this->values['type'] === Type::TYPE_CONST && $this->getValue('name') !== null) {
            \trigger_error('Deprecated: TYPE_CONST', \E_USER_DEPRECATED);
            $this->values['type'] = Type::TYPE_IDENTIFIER;
Severity: Minor
Found in src/Debug/Abstraction/Abstraction.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

Function doPublish has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    protected function doPublish($eventName, $subscribers, Event $event)
    {
        $this->subscriberStack[] = array(
            'eventName' => $eventName,
            'subscribers' => $subscribers,
Severity: Minor
Found in src/PubSub/Manager.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

Severity
Category
Status
Source
Language