src/Phan/Analysis/ArgumentType.php

Summary

Maintainability
F
2 wks
Test Coverage

File ArgumentType.php has 1165 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

declare(strict_types=1);

namespace Phan\Analysis;
Severity: Major
Found in src/Phan/Analysis/ArgumentType.php - About 2 days to fix

    Function analyzeParameterList has a Cognitive Complexity of 88 (exceeds 5 allowed). Consider refactoring.
    Open

        private static function analyzeParameterList(
            CodeBase $code_base,
            FunctionInterface $method,
            Node $node,
            Context $context
    Severity: Minor
    Found in src/Phan/Analysis/ArgumentType.php - About 1 day to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function analyzeParameterListForCallback has a Cognitive Complexity of 66 (exceeds 5 allowed). Consider refactoring.
    Open

        private static function analyzeParameterListForCallback(
            CodeBase $code_base,
            FunctionInterface $method,
            array $arg_nodes,
            Context $context,
    Severity: Minor
    Found in src/Phan/Analysis/ArgumentType.php - About 1 day to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function analyzeParameter has a Cognitive Complexity of 60 (exceeds 5 allowed). Consider refactoring.
    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 - About 1 day to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Method analyzeParameterList has 144 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        private static function analyzeParameterList(
            CodeBase $code_base,
            FunctionInterface $method,
            Node $node,
            Context $context
    Severity: Major
    Found in src/Phan/Analysis/ArgumentType.php - About 5 hrs to fix

      Method warnInvalidArgumentType has 127 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private static function warnInvalidArgumentType(
              CodeBase $code_base,
              Context $context,
              FunctionInterface $method,
              Parameter $alternate_parameter,
      Severity: Major
      Found in src/Phan/Analysis/ArgumentType.php - About 5 hrs to fix

        Function warnInvalidArgumentType has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
        Open

            private static function warnInvalidArgumentType(
                CodeBase $code_base,
                Context $context,
                FunctionInterface $method,
                Parameter $alternate_parameter,
        Severity: Minor
        Found in src/Phan/Analysis/ArgumentType.php - About 4 hrs to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Function isExpressionReturningReference has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
        Open

            public static function isExpressionReturningReference(CodeBase $code_base, Context $context, $node): bool
            {
                if (!($node instanceof Node)) {
                    return false;
                }
        Severity: Minor
        Found in src/Phan/Analysis/ArgumentType.php - About 4 hrs to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

        Method analyzeParameterListForCallback has 105 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private static function analyzeParameterListForCallback(
                CodeBase $code_base,
                FunctionInterface $method,
                array $arg_nodes,
                Context $context,
        Severity: Major
        Found in src/Phan/Analysis/ArgumentType.php - About 4 hrs to fix

          Function analyze has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
          Open

              public static function analyze(
                  FunctionInterface $method,
                  Node $node,
                  Context $context,
                  CodeBase $code_base
          Severity: Minor
          Found in src/Phan/Analysis/ArgumentType.php - About 4 hrs to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Function checkAbstractStaticMethodCall has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
          Open

              private static function checkAbstractStaticMethodCall(
                  FunctionInterface $method,
                  Node $node,
                  Context $context,
                  CodeBase $code_base
          Severity: Minor
          Found in src/Phan/Analysis/ArgumentType.php - About 3 hrs to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          Function analyzeParameterStrict has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
          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 - About 3 hrs to fix

          Cognitive Complexity

          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

          A method's cognitive complexity is based on a few simple rules:

          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
          • Code is considered more complex for each "break in the linear flow of the code"
          • Code is considered more complex when "flow breaking structures are nested"

          Further reading

          The class ArgumentType has an overall complexity of 252 which is very high. The configured complexity threshold is 50.
          Open

          final class ArgumentType
          {
          
              /**
               * @param FunctionInterface $method
          Severity: Minor
          Found in src/Phan/Analysis/ArgumentType.php by phpmd

          Method analyzeParameter has 80 lines of code (exceeds 25 allowed). Consider refactoring.
          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: Major
          Found in src/Phan/Analysis/ArgumentType.php - About 3 hrs to fix

            Method analyze has 67 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public static function analyze(
                    FunctionInterface $method,
                    Node $node,
                    Context $context,
                    CodeBase $code_base
            Severity: Major
            Found in src/Phan/Analysis/ArgumentType.php - About 2 hrs to fix

              Function analyzeForCallback has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
              Open

                  public static function analyzeForCallback(
                      FunctionInterface $method,
                      array $arg_nodes,
                      Context $context,
                      CodeBase $code_base,
              Severity: Minor
              Found in src/Phan/Analysis/ArgumentType.php - About 2 hrs to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

              Method analyzeParameterStrict has 61 lines of code (exceeds 25 allowed). Consider refactoring.
              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: Major
              Found in src/Phan/Analysis/ArgumentType.php - About 2 hrs to fix

                ArgumentType has 21 functions (exceeds 20 allowed). Consider refactoring.
                Open

                final class ArgumentType
                {
                
                    /**
                     * @param FunctionInterface $method
                Severity: Minor
                Found in src/Phan/Analysis/ArgumentType.php - About 2 hrs to fix

                  Method analyzeForCallback has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public static function analyzeForCallback(
                          FunctionInterface $method,
                          array $arg_nodes,
                          Context $context,
                          CodeBase $code_base,
                  Severity: Major
                  Found in src/Phan/Analysis/ArgumentType.php - About 2 hrs to fix

                    Method isExpressionReturningReference has 53 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public static function isExpressionReturningReference(CodeBase $code_base, Context $context, $node): bool
                        {
                            if (!($node instanceof Node)) {
                                return false;
                            }
                    Severity: Major
                    Found in src/Phan/Analysis/ArgumentType.php - About 2 hrs to fix

                      Method checkAbstractStaticMethodCall has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          private static function checkAbstractStaticMethodCall(
                              FunctionInterface $method,
                              Node $node,
                              Context $context,
                              CodeBase $code_base
                      Severity: Minor
                      Found in src/Phan/Analysis/ArgumentType.php - About 1 hr to fix

                        Function analyzeRemainingParametersForVariadic has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                        Open

                            private static function analyzeRemainingParametersForVariadic(
                                CodeBase $code_base,
                                Context $context,
                                FunctionInterface $method,
                                int $start_index,
                        Severity: Minor
                        Found in src/Phan/Analysis/ArgumentType.php - About 1 hr to fix

                        Cognitive Complexity

                        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                        A method's cognitive complexity is based on a few simple rules:

                        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                        • Code is considered more complex for each "break in the linear flow of the code"
                        • Code is considered more complex when "flow breaking structures are nested"

                        Further reading

                        Method checkIsDeprecatedOrInternal has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            private static function checkIsDeprecatedOrInternal(CodeBase $code_base, Context $context, FunctionInterface $method): void
                            {
                                // Special common cases where we want slightly
                                // better multi-signature error messages
                                if ($method->isPHPInternal()) {
                        Severity: Minor
                        Found in src/Phan/Analysis/ArgumentType.php - About 1 hr to fix

                          Method warnInvalidArgumentType has 11 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                                  CodeBase $code_base,
                                  Context $context,
                                  FunctionInterface $method,
                                  Parameter $alternate_parameter,
                                  UnionType $alternate_parameter_type,
                          Severity: Major
                          Found in src/Phan/Analysis/ArgumentType.php - About 1 hr to fix

                            Method emitUndeclaredNamedArgument has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                private static function emitUndeclaredNamedArgument(
                                    CodeBase $code_base,
                                    Context $context,
                                    FunctionInterface $method,
                                    Node $argument
                            Severity: Minor
                            Found in src/Phan/Analysis/ArgumentType.php - About 1 hr to fix

                              Function checkAllNamedArgumentsPassed has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  private static function checkAllNamedArgumentsPassed(
                                      CodeBase $code_base,
                                      Context $context,
                                      int $lineno,
                                      FunctionInterface $method,
                              Severity: Minor
                              Found in src/Phan/Analysis/ArgumentType.php - About 1 hr to fix

                              Cognitive Complexity

                              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                              A method's cognitive complexity is based on a few simple rules:

                              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                              • Code is considered more complex for each "break in the linear flow of the code"
                              • Code is considered more complex when "flow breaking structures are nested"

                              Further reading

                              Method checkAllNamedArgumentsPassed has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  private static function checkAllNamedArgumentsPassed(
                                      CodeBase $code_base,
                                      Context $context,
                                      int $lineno,
                                      FunctionInterface $method,
                              Severity: Minor
                              Found in src/Phan/Analysis/ArgumentType.php - About 1 hr to fix

                                Method maybeWarnProvidingUnusedParameter has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    private static function maybeWarnProvidingUnusedParameter(
                                        CodeBase $code_base,
                                        Context $context,
                                        int $lineno,
                                        FunctionInterface $method,
                                Severity: Minor
                                Found in src/Phan/Analysis/ArgumentType.php - About 1 hr to fix

                                  Method analyzeParameterStrict has 9 arguments (exceeds 4 allowed). Consider refactoring.
                                  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
                                  Severity: Major
                                  Found in src/Phan/Analysis/ArgumentType.php - About 1 hr to fix

                                    Method analyzeRemainingParametersForVariadic has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        private static function analyzeRemainingParametersForVariadic(
                                            CodeBase $code_base,
                                            Context $context,
                                            FunctionInterface $method,
                                            int $start_index,
                                    Severity: Minor
                                    Found in src/Phan/Analysis/ArgumentType.php - About 1 hr to fix

                                      Method analyzeParameter has 8 arguments (exceeds 4 allowed). Consider refactoring.
                                      Open

                                          public static function analyzeParameter(CodeBase $code_base, Context $context, FunctionInterface $method, UnionType $argument_type, int $lineno, int $i, $argument_node, ?Node $node): void
                                      Severity: Major
                                      Found in src/Phan/Analysis/ArgumentType.php - About 1 hr to fix

                                        Function maybeWarnProvidingUnusedParameter has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                        Open

                                            private static function maybeWarnProvidingUnusedParameter(
                                                CodeBase $code_base,
                                                Context $context,
                                                int $lineno,
                                                FunctionInterface $method,
                                        Severity: Minor
                                        Found in src/Phan/Analysis/ArgumentType.php - About 55 mins to fix

                                        Cognitive Complexity

                                        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                        A method's cognitive complexity is based on a few simple rules:

                                        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                        • Code is considered more complex for each "break in the linear flow of the code"
                                        • Code is considered more complex when "flow breaking structures are nested"

                                        Further reading

                                        Method analyzeRemainingParametersForVariadic has 7 arguments (exceeds 4 allowed). Consider refactoring.
                                        Open

                                                CodeBase $code_base,
                                                Context $context,
                                                FunctionInterface $method,
                                                int $start_index,
                                                Node $node,
                                        Severity: Major
                                        Found in src/Phan/Analysis/ArgumentType.php - About 50 mins to fix

                                          Method maybeWarnProvidingUnusedParameter has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                          Open

                                                  CodeBase $code_base,
                                                  Context $context,
                                                  int $lineno,
                                                  FunctionInterface $method,
                                                  Parameter $parameter,
                                          Severity: Minor
                                          Found in src/Phan/Analysis/ArgumentType.php - About 45 mins to fix

                                            Function checkIsDeprecatedOrInternal has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                            Open

                                                private static function checkIsDeprecatedOrInternal(CodeBase $code_base, Context $context, FunctionInterface $method): void
                                                {
                                                    // Special common cases where we want slightly
                                                    // better multi-signature error messages
                                                    if ($method->isPHPInternal()) {
                                            Severity: Minor
                                            Found in src/Phan/Analysis/ArgumentType.php - About 45 mins to fix

                                            Cognitive Complexity

                                            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                            A method's cognitive complexity is based on a few simple rules:

                                            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                            • Code is considered more complex for each "break in the linear flow of the code"
                                            • Code is considered more complex when "flow breaking structures are nested"

                                            Further reading

                                            Avoid deeply nested control flow statements.
                                            Open

                                                                            if ($class->isTrait()) {
                                                                                $issue_type = Issue::AbstractStaticMethodCallInTrait;
                                                                            }
                                            Severity: Major
                                            Found in src/Phan/Analysis/ArgumentType.php - About 45 mins to fix

                                              Method checkAllNamedArgumentsPassed has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                              Open

                                                      CodeBase $code_base,
                                                      Context $context,
                                                      int $lineno,
                                                      FunctionInterface $method,
                                                      array $positions_used
                                              Severity: Minor
                                              Found in src/Phan/Analysis/ArgumentType.php - About 35 mins to fix

                                                Method emitParamTooMany has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                Open

                                                        CodeBase $code_base,
                                                        Context $context,
                                                        FunctionInterface $method,
                                                        Node $node,
                                                        int $argcount
                                                Severity: Minor
                                                Found in src/Phan/Analysis/ArgumentType.php - About 35 mins to fix

                                                  Method analyzeForCallback has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                  Open

                                                          FunctionInterface $method,
                                                          array $arg_nodes,
                                                          Context $context,
                                                          CodeBase $code_base,
                                                          Closure $get_argument_type
                                                  Severity: Minor
                                                  Found in src/Phan/Analysis/ArgumentType.php - About 35 mins to fix

                                                    Method analyzeParameterListForCallback has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                                    Open

                                                            CodeBase $code_base,
                                                            FunctionInterface $method,
                                                            array $arg_nodes,
                                                            Context $context,
                                                            Closure $get_argument_type
                                                    Severity: Minor
                                                    Found in src/Phan/Analysis/ArgumentType.php - About 35 mins to fix

                                                      Avoid too many return statements within this method.
                                                      Open

                                                                  return;
                                                      Severity: Major
                                                      Found in src/Phan/Analysis/ArgumentType.php - About 30 mins to fix

                                                        Avoid too many return statements within this method.
                                                        Open

                                                                                return;
                                                        Severity: Major
                                                        Found in src/Phan/Analysis/ArgumentType.php - About 30 mins to fix

                                                          Avoid too many return statements within this method.
                                                          Open

                                                                          return;
                                                          Severity: Major
                                                          Found in src/Phan/Analysis/ArgumentType.php - About 30 mins to fix

                                                            Avoid too many return statements within this method.
                                                            Open

                                                                                        return;
                                                            Severity: Major
                                                            Found in src/Phan/Analysis/ArgumentType.php - About 30 mins to fix

                                                              Avoid too many return statements within this method.
                                                              Open

                                                                          return;
                                                              Severity: Major
                                                              Found in src/Phan/Analysis/ArgumentType.php - About 30 mins to fix

                                                                Avoid too many return statements within this method.
                                                                Open

                                                                                            return true;
                                                                Severity: Major
                                                                Found in src/Phan/Analysis/ArgumentType.php - About 30 mins to fix

                                                                  Avoid too many return statements within this method.
                                                                  Open

                                                                          return false;
                                                                  Severity: Major
                                                                  Found in src/Phan/Analysis/ArgumentType.php - About 30 mins to fix

                                                                    Avoid too many return statements within this method.
                                                                    Open

                                                                                    return;
                                                                    Severity: Major
                                                                    Found in src/Phan/Analysis/ArgumentType.php - About 30 mins to fix

                                                                      Avoid too many return statements within this method.
                                                                      Open

                                                                                  return;
                                                                      Severity: Major
                                                                      Found in src/Phan/Analysis/ArgumentType.php - About 30 mins to fix

                                                                        Avoid too many return statements within this method.
                                                                        Open

                                                                                        return;
                                                                        Severity: Major
                                                                        Found in src/Phan/Analysis/ArgumentType.php - About 30 mins to fix

                                                                          Avoid too many return statements within this method.
                                                                          Open

                                                                                      return $nullable_issue_type;
                                                                          Severity: Major
                                                                          Found in src/Phan/Analysis/ArgumentType.php - About 30 mins to fix

                                                                            Avoid too many return statements within this method.
                                                                            Open

                                                                                        return;
                                                                            Severity: Major
                                                                            Found in src/Phan/Analysis/ArgumentType.php - About 30 mins to fix

                                                                              Avoid too many return statements within this method.
                                                                              Open

                                                                                          return;
                                                                              Severity: Major
                                                                              Found in src/Phan/Analysis/ArgumentType.php - About 30 mins to fix

                                                                                Avoid too many return statements within this method.
                                                                                Open

                                                                                            return;
                                                                                Severity: Major
                                                                                Found in src/Phan/Analysis/ArgumentType.php - About 30 mins to fix

                                                                                  Avoid too many return statements within this method.
                                                                                  Open

                                                                                                  return;
                                                                                  Severity: Major
                                                                                  Found in src/Phan/Analysis/ArgumentType.php - About 30 mins to fix

                                                                                    Avoid too many return statements within this method.
                                                                                    Open

                                                                                                        return false;
                                                                                    Severity: Major
                                                                                    Found in src/Phan/Analysis/ArgumentType.php - About 30 mins to fix

                                                                                      Function isVarargs has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                      Open

                                                                                          private static function isVarargs(CodeBase $code_base, FunctionInterface $method): bool
                                                                                          {
                                                                                              foreach ($method->alternateGenerator($code_base) as $alternate_method) {
                                                                                                  foreach ($alternate_method->getParameterList() as $parameter) {
                                                                                                      if ($parameter->isVariadic()) {
                                                                                      Severity: Minor
                                                                                      Found in src/Phan/Analysis/ArgumentType.php - About 25 mins to fix

                                                                                      Cognitive Complexity

                                                                                      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                                                                      A method's cognitive complexity is based on a few simple rules:

                                                                                      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                                                                      • Code is considered more complex for each "break in the linear flow of the code"
                                                                                      • Code is considered more complex when "flow breaking structures are nested"

                                                                                      Further reading

                                                                                      Function isUnpack has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                                                      Open

                                                                                          private static function isUnpack(array $children): bool
                                                                                          {
                                                                                              foreach ($children as $child) {
                                                                                                  if ($child instanceof Node) {
                                                                                                      if ($child->kind === ast\AST_UNPACK) {
                                                                                      Severity: Minor
                                                                                      Found in src/Phan/Analysis/ArgumentType.php - About 25 mins to fix

                                                                                      Cognitive Complexity

                                                                                      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                                                                                      A method's cognitive complexity is based on a few simple rules:

                                                                                      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                                                                                      • Code is considered more complex for each "break in the linear flow of the code"
                                                                                      • Code is considered more complex when "flow breaking structures are nested"

                                                                                      Further reading

                                                                                      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 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 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 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

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

                                                                                      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 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 warnInvalidArgumentType has 11 parameters. Consider reducing the number of parameters to less than 10.
                                                                                      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

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

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

                                                                                      final class ArgumentType
                                                                                      {
                                                                                      
                                                                                          /**
                                                                                           * @param FunctionInterface $method
                                                                                      Severity: Minor
                                                                                      Found in src/Phan/Analysis/ArgumentType.php by phpmd

                                                                                      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 maybeWarnProvidingUnusedParameter() has a Cyclomatic Complexity of 10. The configured cyclomatic complexity threshold is 10.
                                                                                      Open

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

                                                                                      CyclomaticComplexity

                                                                                      Since: 0.1

                                                                                      Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

                                                                                      Example

                                                                                      // Cyclomatic Complexity = 11
                                                                                      class Foo {
                                                                                      1   public function example() {
                                                                                      2       if ($a == $b) {
                                                                                      3           if ($a1 == $b1) {
                                                                                                      fiddle();
                                                                                      4           } elseif ($a2 == $b2) {
                                                                                                      fiddle();
                                                                                                  } else {
                                                                                                      fiddle();
                                                                                                  }
                                                                                      5       } elseif ($c == $d) {
                                                                                      6           while ($c == $d) {
                                                                                                      fiddle();
                                                                                                  }
                                                                                      7        } elseif ($e == $f) {
                                                                                      8           for ($n = 0; $n < $h; $n++) {
                                                                                                      fiddle();
                                                                                                  }
                                                                                              } else {
                                                                                                  switch ($z) {
                                                                                      9               case 1:
                                                                                                          fiddle();
                                                                                                          break;
                                                                                      10              case 2:
                                                                                                          fiddle();
                                                                                                          break;
                                                                                      11              case 3:
                                                                                                          fiddle();
                                                                                                          break;
                                                                                                      default:
                                                                                                          fiddle();
                                                                                                          break;
                                                                                                  }
                                                                                              }
                                                                                          }
                                                                                      }

                                                                                      Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

                                                                                      The method warnInvalidArgumentType() has a Cyclomatic Complexity of 22. The configured cyclomatic complexity threshold is 10.
                                                                                      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

                                                                                      CyclomaticComplexity

                                                                                      Since: 0.1

                                                                                      Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

                                                                                      Example

                                                                                      // Cyclomatic Complexity = 11
                                                                                      class Foo {
                                                                                      1   public function example() {
                                                                                      2       if ($a == $b) {
                                                                                      3           if ($a1 == $b1) {
                                                                                                      fiddle();
                                                                                      4           } elseif ($a2 == $b2) {
                                                                                                      fiddle();
                                                                                                  } else {
                                                                                                      fiddle();
                                                                                                  }
                                                                                      5       } elseif ($c == $d) {
                                                                                      6           while ($c == $d) {
                                                                                                      fiddle();
                                                                                                  }
                                                                                      7        } elseif ($e == $f) {
                                                                                      8           for ($n = 0; $n < $h; $n++) {
                                                                                                      fiddle();
                                                                                                  }
                                                                                              } else {
                                                                                                  switch ($z) {
                                                                                      9               case 1:
                                                                                                          fiddle();
                                                                                                          break;
                                                                                      10              case 2:
                                                                                                          fiddle();
                                                                                                          break;
                                                                                      11              case 3:
                                                                                                          fiddle();
                                                                                                          break;
                                                                                                      default:
                                                                                                          fiddle();
                                                                                                          break;
                                                                                                  }
                                                                                              }
                                                                                          }
                                                                                      }

                                                                                      Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

                                                                                      The method analyzeForCallback() has a Cyclomatic Complexity of 11. The configured cyclomatic complexity threshold is 10.
                                                                                      Open

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

                                                                                      CyclomaticComplexity

                                                                                      Since: 0.1

                                                                                      Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

                                                                                      Example

                                                                                      // Cyclomatic Complexity = 11
                                                                                      class Foo {
                                                                                      1   public function example() {
                                                                                      2       if ($a == $b) {
                                                                                      3           if ($a1 == $b1) {
                                                                                                      fiddle();
                                                                                      4           } elseif ($a2 == $b2) {
                                                                                                      fiddle();
                                                                                                  } else {
                                                                                                      fiddle();
                                                                                                  }
                                                                                      5       } elseif ($c == $d) {
                                                                                      6           while ($c == $d) {
                                                                                                      fiddle();
                                                                                                  }
                                                                                      7        } elseif ($e == $f) {
                                                                                      8           for ($n = 0; $n < $h; $n++) {
                                                                                                      fiddle();
                                                                                                  }
                                                                                              } else {
                                                                                                  switch ($z) {
                                                                                      9               case 1:
                                                                                                          fiddle();
                                                                                                          break;
                                                                                      10              case 2:
                                                                                                          fiddle();
                                                                                                          break;
                                                                                      11              case 3:
                                                                                                          fiddle();
                                                                                                          break;
                                                                                                      default:
                                                                                                          fiddle();
                                                                                                          break;
                                                                                                  }
                                                                                              }
                                                                                          }
                                                                                      }

                                                                                      Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

                                                                                      The method analyzeParameterListForCallback() has a Cyclomatic Complexity of 27. The configured cyclomatic complexity threshold is 10.
                                                                                      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

                                                                                      CyclomaticComplexity

                                                                                      Since: 0.1

                                                                                      Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

                                                                                      Example

                                                                                      // Cyclomatic Complexity = 11
                                                                                      class Foo {
                                                                                      1   public function example() {
                                                                                      2       if ($a == $b) {
                                                                                      3           if ($a1 == $b1) {
                                                                                                      fiddle();
                                                                                      4           } elseif ($a2 == $b2) {
                                                                                                      fiddle();
                                                                                                  } else {
                                                                                                      fiddle();
                                                                                                  }
                                                                                      5       } elseif ($c == $d) {
                                                                                      6           while ($c == $d) {
                                                                                                      fiddle();
                                                                                                  }
                                                                                      7        } elseif ($e == $f) {
                                                                                      8           for ($n = 0; $n < $h; $n++) {
                                                                                                      fiddle();
                                                                                                  }
                                                                                              } else {
                                                                                                  switch ($z) {
                                                                                      9               case 1:
                                                                                                          fiddle();
                                                                                                          break;
                                                                                      10              case 2:
                                                                                                          fiddle();
                                                                                                          break;
                                                                                      11              case 3:
                                                                                                          fiddle();
                                                                                                          break;
                                                                                                      default:
                                                                                                          fiddle();
                                                                                                          break;
                                                                                                  }
                                                                                              }
                                                                                          }
                                                                                      }

                                                                                      Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

                                                                                      The method analyzeParameterStrict() has a Cyclomatic Complexity of 14. The configured cyclomatic complexity threshold is 10.
                                                                                      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

                                                                                      CyclomaticComplexity

                                                                                      Since: 0.1

                                                                                      Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

                                                                                      Example

                                                                                      // Cyclomatic Complexity = 11
                                                                                      class Foo {
                                                                                      1   public function example() {
                                                                                      2       if ($a == $b) {
                                                                                      3           if ($a1 == $b1) {
                                                                                                      fiddle();
                                                                                      4           } elseif ($a2 == $b2) {
                                                                                                      fiddle();
                                                                                                  } else {
                                                                                                      fiddle();
                                                                                                  }
                                                                                      5       } elseif ($c == $d) {
                                                                                      6           while ($c == $d) {
                                                                                                      fiddle();
                                                                                                  }
                                                                                      7        } elseif ($e == $f) {
                                                                                      8           for ($n = 0; $n < $h; $n++) {
                                                                                                      fiddle();
                                                                                                  }
                                                                                              } else {
                                                                                                  switch ($z) {
                                                                                      9               case 1:
                                                                                                          fiddle();
                                                                                                          break;
                                                                                      10              case 2:
                                                                                                          fiddle();
                                                                                                          break;
                                                                                      11              case 3:
                                                                                                          fiddle();
                                                                                                          break;
                                                                                                      default:
                                                                                                          fiddle();
                                                                                                          break;
                                                                                                  }
                                                                                              }
                                                                                          }
                                                                                      }

                                                                                      Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

                                                                                      The method analyzeParameter() has a Cyclomatic Complexity of 33. The configured cyclomatic complexity threshold is 10.
                                                                                      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

                                                                                      CyclomaticComplexity

                                                                                      Since: 0.1

                                                                                      Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

                                                                                      Example

                                                                                      // Cyclomatic Complexity = 11
                                                                                      class Foo {
                                                                                      1   public function example() {
                                                                                      2       if ($a == $b) {
                                                                                      3           if ($a1 == $b1) {
                                                                                                      fiddle();
                                                                                      4           } elseif ($a2 == $b2) {
                                                                                                      fiddle();
                                                                                                  } else {
                                                                                                      fiddle();
                                                                                                  }
                                                                                      5       } elseif ($c == $d) {
                                                                                      6           while ($c == $d) {
                                                                                                      fiddle();
                                                                                                  }
                                                                                      7        } elseif ($e == $f) {
                                                                                      8           for ($n = 0; $n < $h; $n++) {
                                                                                                      fiddle();
                                                                                                  }
                                                                                              } else {
                                                                                                  switch ($z) {
                                                                                      9               case 1:
                                                                                                          fiddle();
                                                                                                          break;
                                                                                      10              case 2:
                                                                                                          fiddle();
                                                                                                          break;
                                                                                      11              case 3:
                                                                                                          fiddle();
                                                                                                          break;
                                                                                                      default:
                                                                                                          fiddle();
                                                                                                          break;
                                                                                                  }
                                                                                              }
                                                                                          }
                                                                                      }

                                                                                      Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

                                                                                      The method checkAbstractStaticMethodCall() has a Cyclomatic Complexity of 12. The configured cyclomatic complexity threshold is 10.
                                                                                      Open

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

                                                                                      CyclomaticComplexity

                                                                                      Since: 0.1

                                                                                      Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

                                                                                      Example

                                                                                      // Cyclomatic Complexity = 11
                                                                                      class Foo {
                                                                                      1   public function example() {
                                                                                      2       if ($a == $b) {
                                                                                      3           if ($a1 == $b1) {
                                                                                                      fiddle();
                                                                                      4           } elseif ($a2 == $b2) {
                                                                                                      fiddle();
                                                                                                  } else {
                                                                                                      fiddle();
                                                                                                  }
                                                                                      5       } elseif ($c == $d) {
                                                                                      6           while ($c == $d) {
                                                                                                      fiddle();
                                                                                                  }
                                                                                      7        } elseif ($e == $f) {
                                                                                      8           for ($n = 0; $n < $h; $n++) {
                                                                                                      fiddle();
                                                                                                  }
                                                                                              } else {
                                                                                                  switch ($z) {
                                                                                      9               case 1:
                                                                                                          fiddle();
                                                                                                          break;
                                                                                      10              case 2:
                                                                                                          fiddle();
                                                                                                          break;
                                                                                      11              case 3:
                                                                                                          fiddle();
                                                                                                          break;
                                                                                                      default:
                                                                                                          fiddle();
                                                                                                          break;
                                                                                                  }
                                                                                              }
                                                                                          }
                                                                                      }

                                                                                      Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

                                                                                      The method analyzeParameterList() has a Cyclomatic Complexity of 38. The configured cyclomatic complexity threshold is 10.
                                                                                      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

                                                                                      CyclomaticComplexity

                                                                                      Since: 0.1

                                                                                      Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

                                                                                      Example

                                                                                      // Cyclomatic Complexity = 11
                                                                                      class Foo {
                                                                                      1   public function example() {
                                                                                      2       if ($a == $b) {
                                                                                      3           if ($a1 == $b1) {
                                                                                                      fiddle();
                                                                                      4           } elseif ($a2 == $b2) {
                                                                                                      fiddle();
                                                                                                  } else {
                                                                                                      fiddle();
                                                                                                  }
                                                                                      5       } elseif ($c == $d) {
                                                                                      6           while ($c == $d) {
                                                                                                      fiddle();
                                                                                                  }
                                                                                      7        } elseif ($e == $f) {
                                                                                      8           for ($n = 0; $n < $h; $n++) {
                                                                                                      fiddle();
                                                                                                  }
                                                                                              } else {
                                                                                                  switch ($z) {
                                                                                      9               case 1:
                                                                                                          fiddle();
                                                                                                          break;
                                                                                      10              case 2:
                                                                                                          fiddle();
                                                                                                          break;
                                                                                      11              case 3:
                                                                                                          fiddle();
                                                                                                          break;
                                                                                                      default:
                                                                                                          fiddle();
                                                                                                          break;
                                                                                                  }
                                                                                              }
                                                                                          }
                                                                                      }

                                                                                      Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

                                                                                      The method analyze() has a Cyclomatic Complexity of 18. The configured cyclomatic complexity threshold is 10.
                                                                                      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

                                                                                      CyclomaticComplexity

                                                                                      Since: 0.1

                                                                                      Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

                                                                                      Example

                                                                                      // Cyclomatic Complexity = 11
                                                                                      class Foo {
                                                                                      1   public function example() {
                                                                                      2       if ($a == $b) {
                                                                                      3           if ($a1 == $b1) {
                                                                                                      fiddle();
                                                                                      4           } elseif ($a2 == $b2) {
                                                                                                      fiddle();
                                                                                                  } else {
                                                                                                      fiddle();
                                                                                                  }
                                                                                      5       } elseif ($c == $d) {
                                                                                      6           while ($c == $d) {
                                                                                                      fiddle();
                                                                                                  }
                                                                                      7        } elseif ($e == $f) {
                                                                                      8           for ($n = 0; $n < $h; $n++) {
                                                                                                      fiddle();
                                                                                                  }
                                                                                              } else {
                                                                                                  switch ($z) {
                                                                                      9               case 1:
                                                                                                          fiddle();
                                                                                                          break;
                                                                                      10              case 2:
                                                                                                          fiddle();
                                                                                                          break;
                                                                                      11              case 3:
                                                                                                          fiddle();
                                                                                                          break;
                                                                                                      default:
                                                                                                          fiddle();
                                                                                                          break;
                                                                                                  }
                                                                                              }
                                                                                          }
                                                                                      }

                                                                                      Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

                                                                                      The method isExpressionReturningReference() has a Cyclomatic Complexity of 14. The configured cyclomatic complexity threshold is 10.
                                                                                      Open

                                                                                          public static function isExpressionReturningReference(CodeBase $code_base, Context $context, $node): bool
                                                                                          {
                                                                                              if (!($node instanceof Node)) {
                                                                                                  return false;
                                                                                              }
                                                                                      Severity: Minor
                                                                                      Found in src/Phan/Analysis/ArgumentType.php by phpmd

                                                                                      CyclomaticComplexity

                                                                                      Since: 0.1

                                                                                      Complexity is determined by the number of decision points in a method plus one for the method entry. The decision points are 'if', 'while', 'for', and 'case labels'. Generally, 1-4 is low complexity, 5-7 indicates moderate complexity, 8-10 is high complexity, and 11+ is very high complexity.

                                                                                      Example

                                                                                      // Cyclomatic Complexity = 11
                                                                                      class Foo {
                                                                                      1   public function example() {
                                                                                      2       if ($a == $b) {
                                                                                      3           if ($a1 == $b1) {
                                                                                                      fiddle();
                                                                                      4           } elseif ($a2 == $b2) {
                                                                                                      fiddle();
                                                                                                  } else {
                                                                                                      fiddle();
                                                                                                  }
                                                                                      5       } elseif ($c == $d) {
                                                                                      6           while ($c == $d) {
                                                                                                      fiddle();
                                                                                                  }
                                                                                      7        } elseif ($e == $f) {
                                                                                      8           for ($n = 0; $n < $h; $n++) {
                                                                                                      fiddle();
                                                                                                  }
                                                                                              } else {
                                                                                                  switch ($z) {
                                                                                      9               case 1:
                                                                                                          fiddle();
                                                                                                          break;
                                                                                      10              case 2:
                                                                                                          fiddle();
                                                                                                          break;
                                                                                      11              case 3:
                                                                                                          fiddle();
                                                                                                          break;
                                                                                                      default:
                                                                                                          fiddle();
                                                                                                          break;
                                                                                                  }
                                                                                              }
                                                                                          }
                                                                                      }

                                                                                      Source https://phpmd.org/rules/codesize.html#cyclomaticcomplexity

                                                                                      The class ArgumentType has a coupling between objects value of 27. Consider to reduce the number of dependencies under 13.
                                                                                      Open

                                                                                      final class ArgumentType
                                                                                      {
                                                                                      
                                                                                          /**
                                                                                           * @param FunctionInterface $method
                                                                                      Severity: Minor
                                                                                      Found in src/Phan/Analysis/ArgumentType.php by phpmd

                                                                                      CouplingBetweenObjects

                                                                                      Since: 1.1.0

                                                                                      A class with too many dependencies has negative impacts on several quality aspects of a class. This includes quality criteria like stability, maintainability and understandability

                                                                                      Example

                                                                                      class Foo {
                                                                                          /**
                                                                                           * @var \foo\bar\X
                                                                                           */
                                                                                          private $x = null;
                                                                                      
                                                                                          /**
                                                                                           * @var \foo\bar\Y
                                                                                           */
                                                                                          private $y = null;
                                                                                      
                                                                                          /**
                                                                                           * @var \foo\bar\Z
                                                                                           */
                                                                                          private $z = null;
                                                                                      
                                                                                          public function setFoo(\Foo $foo) {}
                                                                                          public function setBar(\Bar $bar) {}
                                                                                          public function setBaz(\Baz $baz) {}
                                                                                      
                                                                                          /**
                                                                                           * @return \SplObjectStorage
                                                                                           * @throws \OutOfRangeException
                                                                                           * @throws \InvalidArgumentException
                                                                                           * @throws \ErrorException
                                                                                           */
                                                                                          public function process(\Iterator $it) {}
                                                                                      
                                                                                          // ...
                                                                                      }

                                                                                      Source https://phpmd.org/rules/design.html#couplingbetweenobjects

                                                                                      Avoid variables with short names like $i. Configured minimum length is 3.
                                                                                      Open

                                                                                                  $i = $original_i;
                                                                                      Severity: Minor
                                                                                      Found in src/Phan/Analysis/ArgumentType.php by phpmd

                                                                                      ShortVariable

                                                                                      Since: 0.2

                                                                                      Detects when a field, local, or parameter has a very short name.

                                                                                      Example

                                                                                      class Something {
                                                                                          private $q = 15; // VIOLATION - Field
                                                                                          public static function main( array $as ) { // VIOLATION - Formal
                                                                                              $r = 20 + $this->q; // VIOLATION - Local
                                                                                              for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                                                                                                  $r += $this->q;
                                                                                              }
                                                                                          }
                                                                                      }

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

                                                                                      Avoid variables with short names like $i. Configured minimum length is 3.
                                                                                      Open

                                                                                              int $i
                                                                                      Severity: Minor
                                                                                      Found in src/Phan/Analysis/ArgumentType.php by phpmd

                                                                                      ShortVariable

                                                                                      Since: 0.2

                                                                                      Detects when a field, local, or parameter has a very short name.

                                                                                      Example

                                                                                      class Something {
                                                                                          private $q = 15; // VIOLATION - Field
                                                                                          public static function main( array $as ) { // VIOLATION - Formal
                                                                                              $r = 20 + $this->q; // VIOLATION - Local
                                                                                              for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                                                                                                  $r += $this->q;
                                                                                              }
                                                                                          }
                                                                                      }

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

                                                                                      Avoid variables with short names like $i. Configured minimum length is 3.
                                                                                      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
                                                                                      Severity: Minor
                                                                                      Found in src/Phan/Analysis/ArgumentType.php by phpmd

                                                                                      ShortVariable

                                                                                      Since: 0.2

                                                                                      Detects when a field, local, or parameter has a very short name.

                                                                                      Example

                                                                                      class Something {
                                                                                          private $q = 15; // VIOLATION - Field
                                                                                          public static function main( array $as ) { // VIOLATION - Formal
                                                                                              $r = 20 + $this->q; // VIOLATION - Local
                                                                                              for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                                                                                                  $r += $this->q;
                                                                                              }
                                                                                          }
                                                                                      }

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

                                                                                      Avoid variables with short names like $i. Configured minimum length is 3.
                                                                                      Open

                                                                                              int $i
                                                                                      Severity: Minor
                                                                                      Found in src/Phan/Analysis/ArgumentType.php by phpmd

                                                                                      ShortVariable

                                                                                      Since: 0.2

                                                                                      Detects when a field, local, or parameter has a very short name.

                                                                                      Example

                                                                                      class Something {
                                                                                          private $q = 15; // VIOLATION - Field
                                                                                          public static function main( array $as ) { // VIOLATION - Formal
                                                                                              $r = 20 + $this->q; // VIOLATION - Local
                                                                                              for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                                                                                                  $r += $this->q;
                                                                                              }
                                                                                          }
                                                                                      }

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

                                                                                      Avoid variables with short names like $i. Configured minimum length is 3.
                                                                                      Open

                                                                                                  $i = $original_i;
                                                                                      Severity: Minor
                                                                                      Found in src/Phan/Analysis/ArgumentType.php by phpmd

                                                                                      ShortVariable

                                                                                      Since: 0.2

                                                                                      Detects when a field, local, or parameter has a very short name.

                                                                                      Example

                                                                                      class Something {
                                                                                          private $q = 15; // VIOLATION - Field
                                                                                          public static function main( array $as ) { // VIOLATION - Formal
                                                                                              $r = 20 + $this->q; // VIOLATION - Local
                                                                                              for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                                                                                                  $r += $this->q;
                                                                                              }
                                                                                          }
                                                                                      }

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

                                                                                      Avoid variables with short names like $i. Configured minimum length is 3.
                                                                                      Open

                                                                                          public static function analyzeParameter(CodeBase $code_base, Context $context, FunctionInterface $method, UnionType $argument_type, int $lineno, int $i, $argument_node, ?Node $node): void
                                                                                      Severity: Minor
                                                                                      Found in src/Phan/Analysis/ArgumentType.php by phpmd

                                                                                      ShortVariable

                                                                                      Since: 0.2

                                                                                      Detects when a field, local, or parameter has a very short name.

                                                                                      Example

                                                                                      class Something {
                                                                                          private $q = 15; // VIOLATION - Field
                                                                                          public static function main( array $as ) { // VIOLATION - Formal
                                                                                              $r = 20 + $this->q; // VIOLATION - Local
                                                                                              for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                                                                                                  $r += $this->q;
                                                                                              }
                                                                                          }
                                                                                      }

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

                                                                                      There are no issues that match your filters.

                                                                                      Category
                                                                                      Status