Function import
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
public function import( array $changeData, string $name, int $importStrategy ): array {
$processed = [];
$skipped = [];
$jobs = [];
- 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"
Further reading
Function identifySafeLanguages
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
private function identifySafeLanguages(
FileBasedMessageGroup $group,
MessageSourceChange $changesForGroup,
int $importStrategy
): array {
- 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"
Further reading
Method import
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function import( array $changeData, string $name, int $importStrategy ): array {
$processed = [];
$skipped = [];
$jobs = [];
Method identifySafeLanguages
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function identifySafeLanguages(
FileBasedMessageGroup $group,
MessageSourceChange $changesForGroup,
int $importStrategy
): array {
Method __construct
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
GroupSynchronizationCache $groupSynchronizationCache,
JobQueueGroup $jobQueueGroup,
LoggerInterface $logger,
MessageIndex $messageIndex,
TitleFactory $titleFactory,
Function canImportGroup
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function canImportGroup( MessageGroup $group, bool $skipGroupSyncCache ): Status {
$groupId = $group->getId();
if ( !$group instanceof FileBasedMessageGroup ) {
$error = "Group $groupId expected to be FileBasedMessageGroup, got " . get_class( $group ) . " instead.";
return Status::newFatal( new RawMessage( $error ) );
- 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"
Further reading
Function createUpdateMessageJobs
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function createUpdateMessageJobs(
FileBasedMessageGroup $group,
array $additions,
string $language
): array {
- 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"