Showing 3,272 of 4,939 total issues

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

    public function visitClass(Node $node): void
    {
        if (!Config::get_track_references()) {
            return;
        }
Severity: Minor
Found in .phan/plugins/PHPUnitNotDeadCodePlugin.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 __construct has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

        string $label = null,
        int $kind = null,
        string $detail = null,
        string $documentation = null,
        string $sortText = null,
Severity: Major
Found in src/Phan/LanguageServer/Protocol/CompletionItem.php - About 50 mins to fix

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

            Responder $responder,
            array $file_names,
            CodeBase $code_base,
            Closure $file_path_lister,
            FileMapping $file_mapping,
    Severity: Major
    Found in src/Phan/Daemon/Request.php - About 50 mins to fix

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

              Context $child_context,
              Context $fallthrough_context,
              ?Closure $match_variable_condition,
              ?Closure $match_variable_negated_condition,
              Node $arm_node,
      Severity: Major
      Found in src/Phan/BlockAnalysisVisitor.php - About 50 mins to fix

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

                CodeBase $code_base,
                Context $context,
                string $issue_type,
                int $lineno,
                array $parameters,
        Severity: Major
        Found in src/Phan/Issue.php - About 50 mins to fix

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

                  Node $node,
                  UnionType $left,
                  UnionType $right,
                  string $issue_name,
                  Closure $is_still_issue,
          Severity: Major
          Found in src/Phan/Plugin/Internal/RedundantConditionVisitor.php - About 50 mins to fix

            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 emitInstance has 7 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                      $node,
                      CodeBase $code_base,
                      Context $context,
                      string $issue_name,
                      array $issue_args,
              Severity: Major
              Found in src/Phan/Analysis/RedundantCondition.php - About 50 mins to fix

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

                    public static function parseCodePolyfill(CodeBase $code_base, Context $context, string $file_path, string $file_contents, bool $suppress_parse_errors, ?Request $request, array &$errors = []): Node
                Severity: Major
                Found in src/Phan/AST/Parser.php - About 50 mins to fix

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

                      private static function checkPassingPropertyByReference(CodeBase $code_base, Context $context, FunctionInterface $method, Parameter $parameter, Node $argument, Property $property, int $parameter_offset): void
                  Severity: Major
                  Found in src/Phan/Analysis/PostOrderAnalysisVisitor.php - About 50 mins to fix

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

                            CodeBase $code_base,
                            Context $context,
                            string $file_path,
                            string $file_contents,
                            bool $suppress_parse_errors,
                    Severity: Major
                    Found in src/Phan/AST/Parser.php - About 50 mins to fix

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

                          private static function astNodeParam(bool $is_nullable, bool $by_ref, bool $variadic, ?\ast\Node $type, string $name, $default, int $line): ast\Node
                      Severity: Major
                      Found in src/Phan/AST/TolerantASTConverter/TolerantASTConverter.php - About 50 mins to fix

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

                            public static function getExpandedTypesDetails(): string
                            {
                                $result = [];
                                foreach (\debug_backtrace() as $frame) {
                                    if (($frame['function'] ?? null) === 'asExpandedTypes' && isset($frame['object'])) {
                        Severity: Minor
                        Found in src/Phan/Debug/Frame.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

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

                            private static function checkPluginsExist(): void
                            {
                                $all_plugins_exist = true;
                                foreach (Config::getValue('plugins') as $plugin_path_or_name) {
                                    // @phan-suppress-next-line PhanAccessMethodInternal
                        Severity: Minor
                        Found in src/Phan/CLI.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

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

                            public static function outputProgressLine(string $msg, float $p, float $memory, float $peak, ?int $offset = null, ?int $count = null): void
                        Severity: Minor
                        Found in src/Phan/CLI.php - About 45 mins to fix

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

                              public static function progress(
                                  string $msg,
                                  float $p,
                                  $details = null,
                                  ?int $offset = null,
                          Severity: Minor
                          Found in src/Phan/CLI.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

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

                                  CompletionRequest $request,
                                  CodeBase $code_base,
                                  Context $context,
                                  Node $node,
                                  bool $is_static,
                          Severity: Minor
                          Found in src/Phan/LanguageServer/CompletionResolver.php - About 45 mins to fix

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

                                    CompletionRequest $request,
                                    CodeBase $code_base,
                                    Context $context,
                                    Node $node,
                                    bool $is_static,
                            Severity: Minor
                            Found in src/Phan/LanguageServer/CompletionResolver.php - About 45 mins to fix

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

                                  public static function createCompletionClosure(CompletionRequest $request, CodeBase $code_base): Closure
                                  {
                                      /**
                                       * @param list<Node> $parent_node_list
                                       */
                              Severity: Minor
                              Found in src/Phan/LanguageServer/CompletionResolver.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

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

                                  private function addClassesByNames(array $class_name_list): void
                                  {
                                      $included_extension_subset = self::getIncludedExtensionSubset();
                                      foreach ($class_name_list as $class_name) {
                                          $reflection_class = new \ReflectionClass($class_name);
                              Severity: Minor
                              Found in src/Phan/CodeBase.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

                              Severity
                              Category
                              Status
                              Source
                              Language