Showing 4,939 of 4,939 total issues

The method generateClosure() has an NPath complexity of 338. The configured NPath complexity threshold is 200.
Open

    private static function generateClosure(array $callable_params, array $class_params): Closure
    {
        $key = \json_encode([$callable_params, $class_params]);
        static $cache = [];
        $closure = $cache[$key] ?? null;

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 'getPhanFlagsHasState()' method which returns a boolean should be named 'is...()' or 'has...()'
Open

    public function getPhanFlagsHasState(int $flag): bool
    {
        return ($this->phan_flags & $flag) === $flag;
    }

BooleanGetMethodName

Since: 0.2

Looks for methods named 'getX()' with 'boolean' as the return type. The convention is to name these methods 'isX()' or 'hasX()'.

Example

class Foo {
    /**
     * @return boolean
     */
    public function getFoo() {} // bad
    /**
     * @return bool
     */
    public function isFoo(); // ok
    /**
     * @return boolean
     */
    public function getFoo($bar); // ok, unless checkParameterizedMethods=true
}

Source https://phpmd.org/rules/naming.html#booleangetmethodname

The method fromFullyQualifiedStringInner() has an NPath complexity of 18144. The configured NPath complexity threshold is 200.
Open

    protected static function fromFullyQualifiedStringInner(
        string $fully_qualified_string
    ): Type {
        if ($fully_qualified_string === '') {
            throw new InvalidArgumentException("Type cannot be empty");
Severity: Minor
Found in src/Phan/Language/Type.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 canCastToUnionTypeWithoutConfig() has an NPath complexity of 1728. The configured NPath complexity threshold is 200.
Open

    public function canCastToUnionTypeWithoutConfig(
        UnionType $target
    ): bool {
        // Fast-track most common cases first
        $type_set = $this->type_set;
Severity: Minor
Found in src/Phan/Language/UnionType.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 orderForProcessCount() has an NPath complexity of 4320. The configured NPath complexity threshold is 200.
Open

    public function orderForProcessCount(
        int $process_count,
        array $analysis_file_list
    ): array {

Severity: Minor
Found in src/Phan/Ordering.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(EXIT_SUCCESS);
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 asNormalizedTypeSetInner() has an NPath complexity of 384. The configured NPath complexity threshold is 200.
Open

    private static function asNormalizedTypeSetInner(array $type_set): array
    {
        if (\count($type_set) <= 1) {
            return $type_set;
        }
Severity: Minor
Found in src/Phan/Language/UnionType.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 an NPath complexity of 331776. The configured NPath complexity threshold is 200.
Open

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

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

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

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

    public static function finishAnalyzingRemainingStatements(
        CodeBase $code_base,
        ?Request $request,
        array $analyze_file_path_list,
        array $temporary_file_mapping
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 processGraph() has an NPath complexity of 39424. The configured NPath complexity threshold is 200.
Open

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

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

    public function orderForProcessCount(
        int $process_count,
        array $analysis_file_list
    ): array {

Severity: Minor
Found in src/Phan/Ordering.php by phpmd

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

    private function ensurePluginsExist(): void
    {
        if (!is_null($this->plugin_set)) {
            return;
        }
Severity: Minor
Found in src/Phan/Plugin/ConfigPluginSet.php by phpmd

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

The method analyzeFileList() contains an exit expression.
Open

            exit(EXIT_SUCCESS);
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 ensurePluginsExist() has an NPath complexity of 93312. The configured NPath complexity threshold is 200.
Open

    private function ensurePluginsExist(): void
    {
        if (!is_null($this->plugin_set)) {
            return;
        }
Severity: Minor
Found in src/Phan/Plugin/ConfigPluginSet.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

Severity
Category
Status
Source
Language