Showing 3,272 of 4,939 total issues

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

        CodeBase $code_base,
        Method $method,
        Method $o_method,
        string $issue_type,
        string $internal_issue_type,
Severity: Major
Found in src/Phan/Analysis/ParameterTypesAnalyzer.php - About 1 hr to fix

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

            bool $by_ref,
            string $name,
            ast\Node $params,
            ?\ast\Node $return_type,
            ?\ast\Node $stmts,
    Severity: Major
    Found in src/Phan/AST/TolerantASTConverter/TolerantASTConverter.php - About 1 hr to fix

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

          private static function newAstDecl(int $kind, int $flags, array $children, int $lineno, string $doc_comment = null, string $name = null, int $end_lineno = 0, int $decl_id = -1): ast\Node
      Severity: Major
      Found in src/Phan/AST/TolerantASTConverter/TolerantASTConverter.php - About 1 hr to fix

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

                int $flags,
                ?string $name,
                ?\ast\Node $extends,
                ?\Microsoft\PhpParser\node\classinterfaceclause $implements,
                ?\ast\Node $stmts,
        Severity: Major
        Found in src/Phan/AST/TolerantASTConverter/TolerantASTConverter.php - About 1 hr to fix

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

              public function restartWithoutProblematicExtensions(): void
              {
                  $extensions_to_disable = [];
                  if (self::shouldRestartToExclude('xdebug')) {
                      $extensions_to_disable[] = 'xdebug';
          Severity: Minor
          Found in src/Phan/CLI.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

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

              private static function checkValidFileConfig(): void
              {
                  $include_analysis_file_list = Config::getValue('include_analysis_file_list');
                  if ($include_analysis_file_list) {
                      $valid_files = 0;
          Severity: Minor
          Found in src/Phan/CLI.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

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

              private static function locateMethodCompletion(
                  CompletionRequest $request,
                  CodeBase $code_base,
                  Context $context,
                  Node $node,
          Severity: Minor
          Found in src/Phan/LanguageServer/CompletionResolver.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

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

              private function maybeReadConfigFile(bool $require_config_exists): void
              {
          
                  // If the file doesn't exist here, try a directory up
                  $config_file_name = $this->config_file;
          Severity: Minor
          Found in src/Phan/CLI.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

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

              public static function locatePropertyCompletion(
                  CompletionRequest $request,
                  CodeBase $code_base,
                  Context $context,
                  Node $node,
          Severity: Minor
          Found in src/Phan/LanguageServer/CompletionResolver.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

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

              private static function locateVariableCompletion(
                  CompletionRequest $request,
                  CodeBase $code_base,
                  Context $context,
                  string $incomplete_variable_name
          Severity: Minor
          Found in src/Phan/LanguageServer/CompletionResolver.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

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

              private function flush(): void
              {
                  $keepWriting = true;
                  while ($keepWriting) {
                      $message = $this->messages[0]['message'];
          Severity: Minor
          Found in src/Phan/LanguageServer/ProtocolStreamWriter.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

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

              private static function locateGlobalFunctionDefinitionFromComment(
                  GoToDefinitionRequest $request,
                  CodeBase $code_base,
                  Context $context,
                  string $selected_fragment
          Severity: Minor
          Found in src/Phan/LanguageServer/DefinitionResolver.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

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

              public function importConstantsFromAncestorClasses(CodeBase $code_base): void
              {
                  if (!$this->isFirstExecution(__METHOD__)) {
                      return;
                  }
          Severity: Minor
          Found in src/Phan/Language/Element/Clazz.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

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

              public function getMarkupDescription(): string
              {
                  $fqsen = $this->getFQSEN();
                  $string = '';
                  $namespace = \ltrim($fqsen->getNamespace(), '\\');
          Severity: Minor
          Found in src/Phan/Language/Element/Clazz.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

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

              private static function locateGlobalConstantDefinitionFromComment(
                  GoToDefinitionRequest $request,
                  CodeBase $code_base,
                  Context $context,
                  string $selected_fragment
          Severity: Minor
          Found in src/Phan/LanguageServer/DefinitionResolver.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

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

              public function isReturnTypeModifiable(): bool
              {
                  if ($this->isReturnTypeUndefined()) {
                      return true;
                  }
          Severity: Minor
          Found in src/Phan/Language/Element/FunctionTrait.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

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

              private function makeAssertionUnionTypeExtractor(CodeBase $code_base, UnionType $type, int $asserted_param_index): ?Closure
              {
                  if (!$this->comment) {
                      return null;
                  }
          Severity: Minor
          Found in src/Phan/Language/Element/FunctionTrait.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

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

              public function isEqualTo(UnionType $union_type): bool
              {
                  if ($this === $union_type) {
                      return true;
                  }
          Severity: Minor
          Found in src/Phan/Language/AnnotatedUnionType.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

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

              public function toStub(bool $class_is_interface = false): string
              {
                  $string = '    ';
                  if ($this->isFinal()) {
                      $string .= 'final ';
          Severity: Minor
          Found in src/Phan/Language/Element/Method.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

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

              public function analyzeWithNewParams(Context $context, CodeBase $code_base, array $parameter_list): Context
              {
                  $hash = $this->computeParameterListHash($parameter_list);
                  $has_pass_by_reference_variable = null;
                  // Nothing to do, except if PassByReferenceVariable was used
          Severity: Minor
          Found in src/Phan/Language/Element/FunctionTrait.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

          Severity
          Category
          Status
          Source
          Language