Showing 4,939 of 4,939 total issues

The method recordHoverTextForElementType() has an NPath complexity of 1800. The configured NPath complexity threshold is 200.
Open

    private function recordHoverTextForElementType(
        CodeBase $code_base,
        Context $context,
        TypedElementInterface $element
    ): void {

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 analyzeFileList() contains an exit expression.
Open

                exit(EXIT_FAILURE);
Severity: Minor
Found in src/Phan/Phan.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 visitClass() has an NPath complexity of 400. The configured NPath complexity threshold is 200.
Open

    public function visitClass(Node $node): Context
    {
        if ($node->flags & \ast\flags\CLASS_ANONYMOUS) {
            $class_name = (new ContextNode(
                $this->code_base,
Severity: Minor
Found in src/Phan/Parse/ParseVisitor.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 method analyzeFileList() contains an exit expression.
Open

                    exit(2);
Severity: Minor
Found in src/Phan/Phan.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 finishAnalyzingRemainingStatements() contains an exit expression.
Open

                exit(0);
Severity: Minor
Found in src/Phan/Phan.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 processGraph() utilizes a goto statement.
Open

                                    goto cfound;

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 addProperty() has an NPath complexity of 1709696. The configured NPath complexity threshold is 200.
Open

    private function addProperty(Clazz $class, string $property_name, $default_node, UnionType $real_union_type, ?Comment\Parameter $variable, int $lineno, int $flags, ?string $doc_comment, Comment $property_comment): ?Property
    {
        $variable_has_literals = $variable && $variable->getUnionType()->hasLiterals();

        // If something goes wrong will getting the type of
Severity: Minor
Found in src/Phan/Parse/ParseVisitor.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 method getReturnTypeOverridesStatic() has 135 lines of code. Current threshold is set to 100. Avoid really long methods.
Open

    private static function getReturnTypeOverridesStatic(): array
    {
        /**
         * @param list<Node|int|string|float> $args
         */

The method finalizeProcess() has an NPath complexity of 1924. The configured NPath complexity threshold is 200.
Open

    public function finalizeProcess(CodeBase $code_base): void
    {
        if (empty($this->elements)) {
            \fwrite(\STDERR, "Nothing to analyze - please run pdep from your top-level project directory" . \PHP_EOL);
            exit(\EXIT_FAILURE);

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 finalizeProcess() contains an exit expression.
Open

        exit(0);

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 check_fields() has 184 lines of code. Current threshold is set to 100. Avoid really long methods.
Open

function check_fields(string $function_name, array $fields, array $signatures): void
{
    $return_type = $fields[0];  // TODO: Check type
    if (!is_string($return_type)) {
        throw new InvalidArgumentException("Invalid return type: " . json_encode($return_type));
Severity: Minor
Found in internal/sanitycheck.php by phpmd

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

    private static function getAnalyzeFunctionCallClosuresStatic(): array
    {
        $stop_exception = new StopParamAnalysisException();

        /**

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 analyzeNode() has an NPath complexity of 103680. The configured NPath complexity threshold is 200.
Open

    private function analyzeNode(Node $stmts): array
    {
        $kind = $stmts->kind;
        switch ($kind) {
            // Nodes that create new scopes

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 analyzeFileList() has an NPath complexity of 2799360. The configured NPath complexity threshold is 200.
Open

    public static function analyzeFileList(
        CodeBase $code_base,
        Closure $file_path_lister
    ): bool {
        if (Config::getValue('dump_parsed_file_list') === true) {
Severity: Minor
Found in src/Phan/Phan.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 method getReturnTypeOverridesStatic() has 662 lines of code. Current threshold is set to 100. Avoid really long methods.
Open

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

The method getReplacementTypesForFullyQualifiedClassName() 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 function dump_main() contains an exit expression.
Open

        exit($exit_code);
Severity: Minor
Found in internal/dump_fallback_ast.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 updateSignature() has an NPath complexity of 954. The configured NPath complexity threshold is 200.
Open

    protected function updateSignature(string $function_like_name, array $arguments_from_phan): array
    {
        $return_type = $arguments_from_phan[0];
        $arguments_from_external_stub = $this->parseFunctionLikeSignature($function_like_name);
        if (is_null($arguments_from_external_stub)) {

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 compareNamedParameters() contains an exit expression.
Open

        exit(0);

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