bkdotcom/Backtrace

View on GitHub

Showing 6 of 6 total issues

Function findEvalCode has a Cognitive Complexity of 10 (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/Context.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

Avoid too many return statements within this method.
Open

        return \array_combine($keys, $values);
Severity: Major
Found in src/Normalizer.php - About 30 mins to fix

    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/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 normalize has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        public static function normalize($backtrace)
        {
            self::$backtraceTemp = array();
            $frameTemp = array(
                'class' => null,
    Severity: Minor
    Found in src/Normalizer.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 getFirstIndexRewind has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        private static function getFirstIndexRewind(array $backtrace, $index)
        {
            $count = \count($backtrace);
            if ($index && $index === $count && self::getClass($backtrace[$index - 1]) === null) {
                // every frame was skipped and first frame is include, or similar
    Severity: Minor
    Found in src/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 xdebugFix has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        private static function xdebugFix(array $stack)
        {
            $count = \count($stack);
            for ($i = 0; $i < $count; $i++) {
                $frame = \array_merge(array(
    Severity: Minor
    Found in src/Xdebug.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