Showing 4,939 of 4,939 total issues

The method __construct() contains an exit expression.
Open

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

    public static function analyze(
        FunctionInterface $method,
        Node $node,
        Context $context,
        CodeBase $code_base
Severity: Minor
Found in src/Phan/Analysis/ArgumentType.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 __construct() has an NPath complexity of 2112. The configured NPath complexity threshold is 200.
Open

    public function __construct(
        array $process_task_data_iterator,
        Closure $startup_closure,
        Closure $task_closure,
        Closure $shutdown_closure
Severity: Minor
Found in src/Phan/ForkPool.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 addMethod() has an NPath complexity of 3996. The configured NPath complexity threshold is 200.
Open

    public function addMethod(
        CodeBase $code_base,
        Method $method,
        Option $type_option
    ): void {
Severity: Minor
Found in src/Phan/Language/Element/Clazz.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 analyzeParameterList() has 172 lines of code. Current threshold is set to 100. Avoid really long methods.
Open

    private static function analyzeParameterList(
        CodeBase $code_base,
        FunctionInterface $method,
        Node $node,
        Context $context
Severity: Minor
Found in src/Phan/Analysis/ArgumentType.php by phpmd

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

    public static function computeIntOrFloatOperationResult(
        Node $node,
        UnionType $left,
        UnionType $right
    ): UnionType {

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

    public function combineScopeList(array $scope_list): Context
    {
        if (\count($scope_list) < 2) {
            throw new AssertionError("Expected at least two child contexts in " . __METHOD__);
        }

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

    private static function getFlagInfo(): array
    {
        // TODO: Use AST's built in flag info if available.
        static $exclusive, $combinable;
        // Write this in a way that lets Phan infer the value of $combinable at the end.
Severity: Minor
Found in src/Phan/Debug.php by phpmd

The method getPropertyByNameInContext() has an NPath complexity of 4480. The configured NPath complexity threshold is 200.
Open

    public function getPropertyByNameInContext(
        CodeBase $code_base,
        string $name,
        Context $context,
        bool $is_static,
Severity: Minor
Found in src/Phan/Language/Element/Clazz.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 analyzeParameterListForCallback() has 127 lines of code. Current threshold is set to 100. Avoid really long methods.
Open

    private static function analyzeParameterListForCallback(
        CodeBase $code_base,
        FunctionInterface $method,
        array $arg_nodes,
        Context $context,
Severity: Minor
Found in src/Phan/Analysis/ArgumentType.php by phpmd

The method analyzeParameter() has an NPath complexity of 1493856. The configured NPath complexity threshold is 200.
Open

    public static function analyzeParameter(CodeBase $code_base, Context $context, FunctionInterface $method, UnionType $argument_type, int $lineno, int $i, $argument_node, ?Node $node): void
    {
        // Expand it to include all parent types up the chain
        try {
            $argument_type_expanded_resolved =
Severity: Minor
Found in src/Phan/Analysis/ArgumentType.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 visitBinaryAdd() has 106 lines of code. Current threshold is set to 100. Avoid really long methods.
Open

    public function visitBinaryAdd(Node $node): UnionType
    {
        $code_base = $this->code_base;
        $context = $this->context;
        $left = UnionTypeVisitor::unionTypeFromNode(

The method mergeCatchContext() has an NPath complexity of 288. The configured NPath complexity threshold is 200.
Open

    public function mergeCatchContext(Node $node): Context
    {
        if (\count($this->child_context_list) < 2) {
            throw new AssertionError("Expected at least two contexts in " . __METHOD__);
        }

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

    private static function analyzeOverrideSignatureForOverriddenMethod(
        CodeBase $code_base,
        Method $method,
        Clazz $class,
        Method $o_method

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

    private static function analyzeOverrideRealSignature(
        CodeBase $code_base,
        Method $method,
        Clazz $class,
        Method $o_method,

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

    public static function run(CodeBase $code_base, Closure $file_path_lister): ?Request
    {
        if (Config::getValue('language_server_use_pcntl_fallback')) {
            self::runWithoutPcntl($code_base, $file_path_lister);
            // Not reachable
Severity: Minor
Found in src/Phan/Daemon.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 createDaemonStreamSocketServer() contains an exit expression.
Open

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

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

    public static function suggestVariableTypoFix(CodeBase $code_base, Context $context, string $variable_name, string $prefix = 'Did you mean'): ?Suggestion
    {
        if (Config::getValue('disable_suggestions')) {
            return null;
        }
Severity: Minor
Found in src/Phan/IssueFixSuggester.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 addMethod() has 122 lines of code. Current threshold is set to 100. Avoid really long methods.
Open

    public function addMethod(
        CodeBase $code_base,
        Method $method,
        Option $type_option
    ): void {
Severity: Minor
Found in src/Phan/Language/Element/Clazz.php by phpmd
Severity
Category
Status
Source
Language