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
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
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)
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
Method analyzeOverrideRealSignature
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
CodeBase $code_base,
Method $method,
Clazz $class,
Method $o_method,
Clazz $o_class
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
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
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
Method checkInvalidArrayShapeCombination
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
CodeBase $code_base,
Context $context,
Node $node,
UnionType $left,
UnionType $right
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
Method warnAboutInvalidUnaryOp
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Node $node,
Closure $is_valid_type,
UnionType $type,
string $operator,
string $issue_type
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
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
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
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
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);
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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);
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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();
}
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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();
}
- Read upRead up
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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) {
- Read upRead up
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"