Showing 4,939 of 4,939 total issues

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

class Method extends ClassElement implements FunctionInterface
{
    use Analyzable;
    use Memoize;
    use FunctionTrait;
Severity: Minor
Found in src/Phan/Language/Element/Method.php by phpmd

The method fromNode() has an NPath complexity of 1728. The configured NPath complexity threshold is 200.
Open

    public static function fromNode(
        Context $context,
        CodeBase $code_base,
        Node $node,
        FullyQualifiedMethodName $fqsen,
Severity: Minor
Found in src/Phan/Language/Element/Method.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 fromInternalTypeName() has 102 lines of code. Current threshold is set to 100. Avoid really long methods.
Open

    public static function fromInternalTypeName(
        string $type_name,
        bool $is_nullable,
        int $source,
        array $template_parameter_type_list = []
Severity: Minor
Found in src/Phan/Language/Type.php by phpmd

The method iterableValueUnionType() has an NPath complexity of 2380. The configured NPath complexity threshold is 200.
Open

    public function iterableValueUnionType(CodeBase $code_base): ?UnionType
    {
        if ($this->namespace === '\\') {
            $name = strtolower($this->name);
            if ($name === 'traversable' || $name === 'iterator') {
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 class Type has 3993 lines of code. Current threshold is 1000. Avoid really long classes.
Open

class Type
{
    use \Phan\Memoize;

    /**
Severity: Minor
Found in src/Phan/Language/Type.php by phpmd

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

class UnionType implements Serializable
{
    /**
     * @var string
     * A list of one or more types delimited by the '|'
Severity: Minor
Found in src/Phan/Language/UnionType.php by phpmd

The method canCastToUnionType() has an NPath complexity of 17280. The configured NPath complexity threshold is 200.
Open

    public function canCastToUnionType(
        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 internalFunctionSignatureMap() has an NPath complexity of 3584. The configured NPath complexity threshold is 200.
Open

    public static function internalFunctionSignatureMap(int $target_php_version): array
    {
        static $php73_map = [];

        if (!$php73_map) {
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 analyzeFileList() has 186 lines of code. Current threshold is set to 100. Avoid really long methods.
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

The method analyzeFileList() contains an exit expression.
Open

                exit(0);  // This is normal (E.g. .txt files, files outside of analysis list, etc)
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(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 class ConfigPluginSet has 1354 lines of code. Current threshold is 1000. Avoid really long classes.
Open

final class ConfigPluginSet extends PluginV3 implements
    AfterAnalyzeFileCapability,
    AnalyzeClassCapability,
    AnalyzeFunctionCapability,
    AnalyzeFunctionCallCapability,
Severity: Minor
Found in src/Phan/Plugin/ConfigPluginSet.php by phpmd

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

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

    protected static function make(
        string $namespace,
        string $type_name,
        array $template_parameter_type_list,
        bool $is_nullable,
Severity: Minor
Found in src/Phan/Language/Type.php by phpmd

The method computeExpandedTypesPreservingTemplate() has an NPath complexity of 384. The configured NPath complexity threshold is 200.
Open

    private function computeExpandedTypesPreservingTemplate(CodeBase $code_base, int $recursion_depth): UnionType
    {
        $union_type = $this->asPHPDocUnionType();

        $class_fqsen = $this->asFQSEN();
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 class ParseVisitor has 1705 lines of code. Current threshold is 1000. Avoid really long classes.
Open

class ParseVisitor extends ScopeVisitor
{

    /**
     * @param Context $context
Severity: Minor
Found in src/Phan/Parse/ParseVisitor.php by phpmd

The method analyzeFileList() contains an exit expression.
Open

            exit(self::dumpSignaturesToFile($code_base, Config::getValue('dump_signatures_file')));
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 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 checkForOptionsConflictingWithServerModes() 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

Severity
Category
Status
Source
Language