Showing 4,939 of 4,939 total issues

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

            Node $node,
            Context $context,
            Closure $should_filter_cb,
            Closure $filter_union_type_cb,
            bool $suppress_issues
    Severity: Minor
    Found in src/Phan/Analysis/ConditionVisitorUtil.php - About 35 mins to fix

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

          public function __construct(CodeBase $code_base, Context $context, $loop_condition_node, bool $allow_false, bool $loop_body_unconditionally_proceeds)
      Severity: Minor
      Found in src/Phan/Analysis/LoopConditionVisitor.php - About 35 mins to fix

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

                CodeBase $code_base,
                iterable $element_list,
                string $issue_type,
                int $total_count,
                int &$i
        Severity: Minor
        Found in src/Phan/Analysis/ReferenceCountsAnalyzer.php - About 35 mins to fix

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

                  CodeBase $code_base,
                  Method $method,
                  Clazz $class,
                  Method $o_method,
                  Clazz $o_class
          Severity: Minor
          Found in src/Phan/Analysis/ParameterTypesAnalyzer.php - About 35 mins to fix

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

                private function emitTypeMismatchReturnIssue(UnionType $expression_type, FunctionInterface $method, UnionType $method_return_type, int $lineno, $inner_node): void
            Severity: Minor
            Found in src/Phan/Analysis/PostOrderAnalysisVisitor.php - About 35 mins to fix

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

                  private function compareYieldFromAgainstDeclaredType(Node $node, FunctionInterface $method, Context $context, array $template_type_list, UnionType $yield_from_type): Context
              Severity: Minor
              Found in src/Phan/Analysis/PostOrderAnalysisVisitor.php - About 35 mins to fix

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

                        Node $var_node,
                        Context $context,
                        UnionType $new_union_type,
                        bool $suppress_issues,
                        bool $is_weak_type_assertion
                Severity: Minor
                Found in src/Phan/Analysis/ConditionVisitorUtil.php - About 35 mins to fix

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

                          CodeBase $code_base,
                          Context $context,
                          Node $node,
                          UnionType $left,
                          UnionType $right
                  Severity: Minor
                  Found in src/Phan/Analysis/BinaryOperatorFlagVisitor.php - About 35 mins to fix

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

                        private static function astNodeMethodCall(int $kind, $expr, $method, ast\Node $args, int $start_line): ast\Node
                    Severity: Minor
                    Found in src/Phan/AST/TolerantASTConverter/TolerantASTConverter.php - About 35 mins to fix

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

                              Node $node,
                              Closure $is_valid_type,
                              UnionType $type,
                              string $operator,
                              string $issue_type
                      Severity: Minor
                      Found in src/Phan/AST/UnionTypeVisitor.php - About 35 mins to fix

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

                            protected function analyzePrintfPattern(CodeBase $code_base, Context $context, FunctionInterface $function, $pattern_node, $arg_nodes): void
                        Severity: Minor
                        Found in .phan/plugins/PrintfCheckerPlugin.php - About 35 mins to fix

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

                                  AddressableElement $element,
                                  string $issue_type_for_empty,
                                  string $message_for_empty,
                                  string $issue_type_for_unknown_array,
                                  string $message_for_unknown_array
                          Severity: Minor
                          Found in .phan/plugins/UnknownElementTypePlugin.php - About 35 mins to fix

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

                                private function warnAboutInlineHTML(CodeBase $code_base, Context $context, array $token, int $i, int $n): void
                            Severity: Minor
                            Found in .phan/plugins/InlineHTMLPlugin.php - About 35 mins to fix

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

                                  private function checkMovedArg(FunctionInterface $function, array $args, Node $node, array $arg_names, array $places_set = []): void
                              Severity: Minor
                              Found in .phan/plugins/SuspiciousParamOrderPlugin.php - About 35 mins to fix

                                Similar blocks of code found in 2 locations. Consider refactoring.
                                Open

                                    protected function updatePHPDocConstantSummaries(): void
                                    {
                                        $old_constant_documentation = $this->readConstantDocumentationMap();
                                        $new_constant_documentation = $this->getAvailableConstantPHPDocSummaries();
                                        $new_constant_documentation = self::mergeSignatureMaps($old_constant_documentation, $new_constant_documentation);
                                Severity: Minor
                                Found in internal/lib/IncompatibleSignatureDetectorBase.php and 1 other location - About 35 mins to fix
                                internal/lib/IncompatibleSignatureDetectorBase.php on lines 184..195

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 92.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Similar blocks of code found in 2 locations. Consider refactoring.
                                Open

                                    protected function updatePHPDocClassSummaries(): void
                                    {
                                        $old_class_documentation = $this->readClassDocumentationMap();
                                        $new_class_documentation = $this->getAvailableClassPHPDocSummaries();
                                        $new_class_documentation = self::mergeSignatureMaps($old_class_documentation, $new_class_documentation);
                                Severity: Minor
                                Found in internal/lib/IncompatibleSignatureDetectorBase.php and 1 other location - About 35 mins to fix
                                internal/lib/IncompatibleSignatureDetectorBase.php on lines 166..177

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 92.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Similar blocks of code found in 2 locations. Consider refactoring.
                                Open

                                    public static function unionAll(array $set_list): Set
                                    {
                                        if (\count($set_list) === 0) {
                                            return new Set();
                                        }
                                Severity: Minor
                                Found in src/Phan/Library/Set.php and 1 other location - About 35 mins to fix
                                src/Phan/Library/Set.php on lines 83..99

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 92.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Similar blocks of code found in 2 locations. Consider refactoring.
                                Open

                                    public static function intersectAll(array $set_list): Set
                                    {
                                        if (\count($set_list) === 0) {
                                            return new Set();
                                        }
                                Severity: Minor
                                Found in src/Phan/Library/Set.php and 1 other location - About 35 mins to fix
                                src/Phan/Library/Set.php on lines 128..144

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 92.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Function forceLoadingInternalFunctions has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    public function forceLoadingInternalFunctions(): void
                                    {
                                        $internal_function_fqsen_set = $this->internal_function_fqsen_set;
                                        try {
                                            foreach ($internal_function_fqsen_set as $function_fqsen) {
                                Severity: Minor
                                Found in src/Phan/CodeBase.php - About 35 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