Showing 4,939 of 4,939 total issues

The method visitVar() has an NPath complexity of 139536. The configured NPath complexity threshold is 200.
Open

    public function visitVar(Node $node): UnionType
    {
        // $$var or ${...} (whose idea was that anyway?)
        $name_node = $node->children['name'];
        if (($name_node instanceof Node)) {
Severity: Minor
Found in src/Phan/AST/UnionTypeVisitor.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 updateFileList() has an NPath complexity of 408. The configured NPath complexity threshold is 200.
Open

    public function updateFileList(CodeBase $code_base, array $new_file_list, array $file_mapping_contents, array $reanalyze_files = null): array
    {
        $new_file_set = [];
        foreach ($new_file_list as $path) {
            $new_file_set[$path] = true;
Severity: Minor
Found in src/Phan/CodeBase/UndoTracker.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 analyzeProp() has 119 lines of code. Current threshold is set to 100. Avoid really long methods.
Open

    private function analyzeProp(Node $node, bool $is_static): UnionType
    {
        // Either expr(instance) or class(static) is set
        $expr_node = $node->children['expr'] ?? null;
        try {
Severity: Minor
Found in src/Phan/AST/UnionTypeVisitor.php by phpmd

The method methodFQSENListFromObjectAndMethodName() has an NPath complexity of 666. The configured NPath complexity threshold is 200.
Open

    private function methodFQSENListFromObjectAndMethodName($class_or_expr, string $method_name): array
    {
        $code_base = $this->code_base;
        $context = $this->context;

Severity: Minor
Found in src/Phan/AST/UnionTypeVisitor.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 createRestorePoint() has an NPath complexity of 200. The configured NPath complexity threshold is 200.
Open

    public function createRestorePoint(): array
    {
        // Create a deep copy of this CodeBase
        $clone = clone($this);
        // make a deep copy of the NamespaceMapEntry objects within parsed_namespace_maps
Severity: Minor
Found in src/Phan/CodeBase.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 createPhanSettingsForComposerSettings() has an NPath complexity of 1166400. The configured NPath complexity threshold is 200.
Open

    public static function createPhanSettingsForComposerSettings(array $composer_settings, ?string $vendor_path, array $opts): InitializedSettings
    {
        $level = $opts['init-level'] ?? 3;
        $level = self::LEVEL_MAP[\strtolower((string)$level)] ?? $level;
        if (\filter_var($level, FILTER_VALIDATE_INT) === false) {
Severity: Minor
Found in src/Phan/Config/Initializer.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 Config has 1655 lines of code. Current threshold is 1000. Avoid really long classes.
Open

class Config
{
    /**
     * The version of the AST (defined in php-ast) that we're using.
     * @see https://github.com/nikic/php-ast#ast-versioning
Severity: Minor
Found in src/Phan/Config.php by phpmd

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

    public static function unionTypeFromClassNode(
        CodeBase $code_base,
        Context $context,
        $node
    ): UnionType {
Severity: Minor
Found in src/Phan/AST/UnionTypeVisitor.php by phpmd

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

class UnionTypeVisitor extends AnalysisVisitor
{
    /**
     * If an dynamic unpacked array has more elements than this, then give up on building up the union type
     */
Severity: Minor
Found in src/Phan/AST/UnionTypeVisitor.php by phpmd

The method visitNew() has an NPath complexity of 256. The configured NPath complexity threshold is 200.
Open

    public function visitNew(Node $node): UnionType
    {
        static $object_type;
        if ($object_type === null) {
            $object_type = ObjectType::instance(false);
Severity: Minor
Found in src/Phan/AST/UnionTypeVisitor.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 visitDim() has 214 lines of code. Current threshold is set to 100. Avoid really long methods.
Open

    public function visitDim(Node $node, bool $treat_undef_as_nullable = false): UnionType
    {
        $union_type = self::unionTypeFromNode(
            $this->code_base,
            $this->context,
Severity: Minor
Found in src/Phan/AST/UnionTypeVisitor.php by phpmd

The method resolveArrayShapeElementTypesForOffset() has an NPath complexity of 14112. The configured NPath complexity threshold is 200.
Open

    public static function resolveArrayShapeElementTypesForOffset(UnionType $union_type, $dim_value, bool $is_computing_real_type_set = false)
    {
        /**
         * @var bool $has_non_array_shape_type this will be true if there are types that support array access
         *           but have unknown array shapes in $union_type
Severity: Minor
Found in src/Phan/AST/UnionTypeVisitor.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 accept() has 106 lines of code. Current threshold is set to 100. Avoid really long methods.
Open

    public static function accept(CodeBase $code_base, Closure $file_path_lister, Responder $responder, bool $fork): ?Request
    {
        FileCache::clear();

        $request = $responder->getRequestData();
Severity: Minor
Found in src/Phan/Daemon/Request.php by phpmd

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

    protected static function initHandleMap(): array
    {
        $closures = [
            /** @return ?ast\Node */
            'Microsoft\PhpParser\Node\SourceFileNode' => static function (PhpParser\Node\SourceFileNode $n, int $start_line): ?\ast\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 visitDim() has an NPath complexity of 19976880. The configured NPath complexity threshold is 200.
Open

    public function visitDim(Node $node, bool $treat_undef_as_nullable = false): UnionType
    {
        $union_type = self::unionTypeFromNode(
            $this->code_base,
            $this->context,
Severity: Minor
Found in src/Phan/AST/UnionTypeVisitor.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 CodeBase has 2294 lines of code. Current threshold is 1000. Avoid really long classes.
Open

class CodeBase
{
    /**
     * @var Map<FullyQualifiedClassName,Clazz>
     * A map from FQSEN to an internal or user defined class
Severity: Minor
Found in src/Phan/CodeBase.php by phpmd

The method phpParserStmtlistToAstNode() has an NPath complexity of 504. The configured NPath complexity threshold is 200.
Open

    private static function phpParserStmtlistToAstNode($parser_nodes, ?int $lineno, bool $return_null_on_empty = false): ?\ast\Node
    {
        if ($parser_nodes instanceof PhpParser\Node\Statement\CompoundStatementNode) {
            $parser_nodes = $parser_nodes->statements;
        } elseif ($parser_nodes instanceof PhpParser\Node\StatementNode) {

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

    public function visitMethodCall(Node $node): UnionType
    {
        $method_name = $node->children['method'] ?? '';

        // Give up on any complicated nonsense where the
Severity: Minor
Found in src/Phan/AST/UnionTypeVisitor.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 visitMethodCall() has 116 lines of code. Current threshold is set to 100. Avoid really long methods.
Open

    public function visitMethodCall(Node $node): UnionType
    {
        $method_name = $node->children['method'] ?? '';

        // Give up on any complicated nonsense where the
Severity: Minor
Found in src/Phan/AST/UnionTypeVisitor.php by phpmd

The method analyzeParameterList() has an NPath complexity of 6065288. The configured NPath complexity threshold is 200.
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

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