Showing 4,939 of 4,939 total issues

The method getReturnTypeOverridesStatic() has an NPath complexity of 9223372036854775807. The configured NPath complexity threshold is 200.
Open

    private static function getReturnTypeOverridesStatic(): array
    {
        $mixed_type  = MixedType::instance(false);
        $false_type  = FalseType::instance(false);
        $array_type  = ArrayType::instance(false);

NPathComplexity

Since: 0.1

The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.

Example

class Foo {
    function bar() {
        // lots of complicated code
    }
}

Source https://phpmd.org/rules/codesize.html#npathcomplexity

The method addEntriesForClass() has an NPath complexity of 780. The configured NPath complexity threshold is 200.
Open

    private static function addEntriesForClass(
        CtagsEntrySet $entries,
        CodeBase $code_base,
        FullyQualifiedClassName $class_fqsen,
        Clazz $class

NPathComplexity

Since: 0.1

The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.

Example

class Foo {
    function bar() {
        // lots of complicated code
    }
}

Source https://phpmd.org/rules/codesize.html#npathcomplexity

The method processGraph() has 122 lines of code. Current threshold is set to 100. Avoid really long methods.
Open

    public function processGraph(array $cached_graph = null): void
    {
        $cmd  = $_ENV['PDEP_CMD'];
        $mode = $_ENV['PDEP_MODE'];
        $this->depth = (int)$_ENV['PDEP_DEPTH'];

The method processGraph() contains an exit expression.
Open

        exit(\EXIT_SUCCESS);

ExitExpression

Since: 0.2

An exit-expression within regular code is untestable and therefore it should be avoided. Consider to move the exit-expression into some kind of startup script where an error/exception code is returned to the calling environment.

Example

class Foo {
    public function bar($param)  {
        if ($param === 42) {
            exit(23);
        }
    }
}

Source https://phpmd.org/rules/design.html#exitexpression

The method getAnalyzeFunctionCallClosuresStatic() has 278 lines of code. Current threshold is set to 100. Avoid really long methods.
Open

    private static function getAnalyzeFunctionCallClosuresStatic(): array
    {
        /**
         * @param Closure(UnionType):int $checker returns _IS_IMPOSSIBLE/_IS_REDUNDANT/_IS_REASONABLE_CONDITION
         * @param string $expected_type

The method extractIncrementDirections() has an NPath complexity of 458. The configured NPath complexity threshold is 200.
Open

    public static function extractIncrementDirections(CodeBase $code_base, Context $context, $cond_node): array
    {
        if (!$cond_node instanceof Node) {
            return [];
        }

NPathComplexity

Since: 0.1

The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.

Example

class Foo {
    function bar() {
        // lots of complicated code
    }
}

Source https://phpmd.org/rules/codesize.html#npathcomplexity

The method checkUselessScalarComparison() has 103 lines of code. Current threshold is set to 100. Avoid really long methods.
Open

    private function checkUselessScalarComparison(
        Node $node,
        UnionType $left,
        UnionType $right,
        $left_node,

The method processGraph() utilizes a goto statement.
Open

                                goto ffound;

GotoStatement

Since: 1.1.0

Goto makes code harder to read and it is nearly impossible to understand the control flow of an application that uses this language construct. Therefore it should be avoided. Consider to replace Goto with regular control structures and separate methods/function, which are easier to read.

Example

class Foo {
    public function bar($param)  {
        A:
        if ($param === 42) {
            goto X;
        }
        Y:
        if (time() % 42 === 23) {
            goto Z;
        }
        X:
        if (time() % 23 === 42) {
            goto Y;
        }
        Z:
        return 42;
    }
}

Source https://phpmd.org/rules/design.html#gotostatement

The method finalizeProcess() contains an exit expression.
Open

        exit(\EXIT_SUCCESS);

ExitExpression

Since: 0.2

An exit-expression within regular code is untestable and therefore it should be avoided. Consider to move the exit-expression into some kind of startup script where an error/exception code is returned to the calling environment.

Example

class Foo {
    public function bar($param)  {
        if ($param === 42) {
            exit(23);
        }
    }
}

Source https://phpmd.org/rules/design.html#exitexpression

The function dump_main() has an NPath complexity of 224. The configured NPath complexity threshold is 200.
Open

function dump_main(): void
{
    $print_help = static function (int $exit_code): void {
        global $argv;
        $help = <<<"EOB"
Severity: Minor
Found in internal/dump_fallback_ast.php by phpmd

NPathComplexity

Since: 0.1

The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.

Example

class Foo {
    function bar() {
        // lots of complicated code
    }
}

Source https://phpmd.org/rules/codesize.html#npathcomplexity

The class IncompatibleXMLSignatureDetector has 1135 lines of code. Current threshold is 1000. Avoid really long classes.
Open

class IncompatibleXMLSignatureDetector extends IncompatibleSignatureDetectorBase
{
    use Memoize;

    /** @var string the directory for english PHP element references */

The method expectFunctionLikeSignaturesMatch() contains an exit expression.
Open

            exit(1);

ExitExpression

Since: 0.2

An exit-expression within regular code is untestable and therefore it should be avoided. Consider to move the exit-expression into some kind of startup script where an error/exception code is returned to the calling environment.

Example

class Foo {
    public function bar($param)  {
        if ($param === 42) {
            exit(23);
        }
    }
}

Source https://phpmd.org/rules/design.html#exitexpression

The method main() contains an exit expression.
Open

            exit(1);
Severity: Minor
Found in internal/line_deleter.php by phpmd

ExitExpression

Since: 0.2

An exit-expression within regular code is untestable and therefore it should be avoided. Consider to move the exit-expression into some kind of startup script where an error/exception code is returned to the calling environment.

Example

class Foo {
    public function bar($param)  {
        if ($param === 42) {
            exit(23);
        }
    }
}

Source https://phpmd.org/rules/design.html#exitexpression

The method getReturnTypeOverridesStatic() has 375 lines of code. Current threshold is set to 100. Avoid really long methods.
Open

    public static function getReturnTypeOverridesStatic(CodeBase $code_base): array
    {
        $string_union_type = StringType::instance(false)->asPHPDocUnionType();
        $string_union_type_real = StringType::instance(false)->asRealUnionType();
        $string_union_type_with_false_in_real = UnionType::fromFullyQualifiedPHPDocAndRealString('string', 'string|false');

The method visitClassConstDecl() has 108 lines of code. Current threshold is set to 100. Avoid really long methods.
Open

    public function visitClassConstDecl(Node $node): Context
    {
        $class = $this->getContextClass();

        foreach ($node->children as $child_node) {
Severity: Minor
Found in src/Phan/Parse/ParseVisitor.php by phpmd

The function suggest_functions_to_fully_qualify_usage() contains an exit expression.
Open

    exit($status);

ExitExpression

Since: 0.2

An exit-expression within regular code is untestable and therefore it should be avoided. Consider to move the exit-expression into some kind of startup script where an error/exception code is returned to the calling environment.

Example

class Foo {
    public function bar($param)  {
        if ($param === 42) {
            exit(23);
        }
    }
}

Source https://phpmd.org/rules/design.html#exitexpression

The method checkUselessScalarComparison() has an NPath complexity of 2280. The configured NPath complexity threshold is 200.
Open

    private function checkUselessScalarComparison(
        Node $node,
        UnionType $left,
        UnionType $right,
        $left_node,

NPathComplexity

Since: 0.1

The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.

Example

class Foo {
    function bar() {
        // lots of complicated code
    }
}

Source https://phpmd.org/rules/codesize.html#npathcomplexity

The method processGraph() contains an exit expression.
Open

                        exit(\EXIT_FAILURE);

ExitExpression

Since: 0.2

An exit-expression within regular code is untestable and therefore it should be avoided. Consider to move the exit-expression into some kind of startup script where an error/exception code is returned to the calling environment.

Example

class Foo {
    public function bar($param)  {
        if ($param === 42) {
            exit(23);
        }
    }
}

Source https://phpmd.org/rules/design.html#exitexpression

The method processGraph() contains an exit expression.
Open

                            exit(\EXIT_FAILURE);

ExitExpression

Since: 0.2

An exit-expression within regular code is untestable and therefore it should be avoided. Consider to move the exit-expression into some kind of startup script where an error/exception code is returned to the calling environment.

Example

class Foo {
    public function bar($param)  {
        if ($param === 42) {
            exit(23);
        }
    }
}

Source https://phpmd.org/rules/design.html#exitexpression

The method main() contains an exit expression.
Open

            exit(1);
Severity: Minor
Found in internal/extract_arg_info.php by phpmd

ExitExpression

Since: 0.2

An exit-expression within regular code is untestable and therefore it should be avoided. Consider to move the exit-expression into some kind of startup script where an error/exception code is returned to the calling environment.

Example

class Foo {
    public function bar($param)  {
        if ($param === 42) {
            exit(23);
        }
    }
}

Source https://phpmd.org/rules/design.html#exitexpression

Severity
Category
Status
Source
Language