Showing 4,939 of 4,939 total issues

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

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 Clazz has 3605 lines of code. Current threshold is 1000. Avoid really long classes.
Open

class Clazz extends AddressableElement
{
    use Memoize;
    use ClosedScopeElement;

Severity: Minor
Found in src/Phan/Language/Element/Clazz.php by phpmd

The method analyzeShapedArrayAssignment() has an NPath complexity of 626. The configured NPath complexity threshold is 200.
Open

    private function analyzeShapedArrayAssignment(Node $node): void
    {
        // Figure out the type of elements in the list
        $fallback_element_type = null;
        /** @suppress PhanAccessMethodInternal */

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

    private function analyzeGenericArrayAssignment(Node $node): void
    {
        // Figure out the type of elements in the list
        $right_type = $this->right_type;
        if ($right_type->isEmpty()) {

The method computeTypeSetOfMergedArrayShapeTypes() has an NPath complexity of 576. The configured NPath complexity threshold is 200.
Open

    private static function computeTypeSetOfMergedArrayShapeTypes(array $old_type_set, array $new_type_set, int $dim_depth, bool $is_real): array
    {
        if ($is_real) {
            if (!$old_type_set || !$new_type_set) {
                return [];

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

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

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

    private static function calculateNarrowedUnionType(CodeBase $code_base, Context $context, UnionType $old_type, UnionType $asserted_object_type): UnionType
    {
        $new_type_set = [];
        foreach ($old_type->getTypeSet() as $type) {
            if ($type instanceof MixedType) {

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

    public static function asTypeSupportingAccess(UnionType $type, int $access_type): UnionType
    {
        $type = $type->asMappedListUnionType(/** @return list<Type> */ static function (Type $type) use ($access_type): array {
            if ($access_type === ConditionVisitor::ACCESS_IS_OBJECT) {
                if (!$type->isPossiblyObject()) {

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

    private function analyzeBinaryConditionSide(Node $var_node, $expr_node, BinaryCondition $condition): ?Context
    {
        '@phan-var ConditionVisitorUtil|ConditionVisitorInterface $this';
        $kind = $var_node->kind;
        if ($kind === ast\AST_VAR || $kind === ast\AST_DIM) {

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

    public function combineScopeList(array $scope_list): Context
    {
        if (\count($scope_list) < 2) {
            throw new AssertionError("Expected at least two child 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 class NegatedConditionVisitor has 1030 lines of code. Current threshold is 1000. Avoid really long classes.
Open

class NegatedConditionVisitor extends KindVisitorImplementation implements ConditionVisitorInterface
{
    // TODO: if (a || b || c || d) might get really slow, due to creating both ConditionVisitor and NegatedConditionVisitor
    use ConditionVisitorUtil;

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

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

The method importMixin() has an NPath complexity of 273. The configured NPath complexity threshold is 200.
Open

    private function importMixin(CodeBase $code_base, Type $type): void
    {
        $fqsen = FullyQualifiedClassName::fromType($type);
        if (!$code_base->hasClassWithFQSEN($fqsen) || $fqsen === $this->fqsen) {
            Issue::maybeEmit(
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 analyzeParameterStrict() has an NPath complexity of 384. The configured NPath complexity threshold is 200.
Open

    private static function analyzeParameterStrict(CodeBase $code_base, Context $context, FunctionInterface $method, $argument_node, UnionType $argument_type, Variable $alternate_parameter, UnionType $parameter_type, int $lineno, int $i): void
    {
        if ($alternate_parameter instanceof Parameter && $alternate_parameter->isPassByReference() && $alternate_parameter->getReferenceType() === Parameter::REFERENCE_WRITE_ONLY) {
            return;
        }
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 addTypesToProperty() has an NPath complexity of 444. The configured NPath complexity threshold is 200.
Open

    private function addTypesToProperty(Property $property, Node $node): void
    {
        if ($property->getRealUnionType()->isEmpty() && $property->getPHPDocUnionType()->isEmpty()) {
            $property->setUnionType(
                $this->right_type

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

    public static function encodeValue($value, int $max_depth = 2): string
    {
        if (is_object($value)) {
            if ($value instanceof IssueInstance) {
                return "IssueInstance($value)";
Severity: Minor
Found in src/Phan/Debug/Frame.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() 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 warnInvalidArgumentType() has an NPath complexity of 23808. The configured NPath complexity threshold is 200.
Open

    private static function warnInvalidArgumentType(
        CodeBase $code_base,
        Context $context,
        FunctionInterface $method,
        Parameter $alternate_parameter,
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 visitProp() has 108 lines of code. Current threshold is set to 100. Avoid really long methods.
Open

    public function visitProp(Node $node): Context
    {
        // Get class list first, warn if the class list is invalid.
        try {
            $class_list = (new ContextNode(

The method analyzeClassConstantTypes() has an NPath complexity of 603. The configured NPath complexity threshold is 200.
Open

    public static function analyzeClassConstantTypes(CodeBase $code_base, Clazz $clazz): void
    {
        foreach ($clazz->getConstantMap($code_base) as $constant) {
            // This phase is done before the analysis phase, so there aren't any dynamic properties to filter out.

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