Function getPageMoveCollection
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
public function getPageMoveCollection(
Title $source,
?Title $target,
User $user,
string $reason,
- 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
File TranslatableBundleMover.php
has 321 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
declare( strict_types = 1 );
namespace MediaWiki\Extension\Translate\PageTranslation;
Method getPageMoveCollection
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getPageMoveCollection(
Title $source,
?Title $target,
User $user,
string $reason,
Method getPagesToMove
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getPagesToMove(
Title $source,
Title $target,
bool $moveSubPages,
bool $fetchTranslatableSubpages,
Method move
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function move(
TranslatableBundle $sourceBundle,
User $performer,
array $pagesToMove,
array $pagesToRedirect,
Function getPagesToMove
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function getPagesToMove(
Title $source,
Title $target,
bool $moveSubPages,
bool $fetchTranslatableSubpages,
- 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 __construct
has 8 arguments (exceeds 4 allowed). Consider refactoring. Open
MovePageFactory $movePageFactory,
JobQueueGroup $jobQueue,
LinkBatchFactory $linkBatchFactory,
TranslatableBundleFactory $bundleFactory,
SubpageListBuilder $subpageBuilder,
Method moveAsynchronously
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Title $source,
Title $target,
bool $moveSubPages,
User $user,
string $moveReason,
Method moveSynchronously
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Title $source,
Title $target,
array $pagesToMove,
array $pagesToRedirect,
User $performer,
Method getPageMoveCollection
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Title $source,
?Title $target,
User $user,
string $reason,
bool $moveSubPages,
Method getPagesToMove
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Title $source,
Title $target,
bool $moveSubPages,
bool $fetchTranslatableSubpages,
bool $moveTalkPages,
Function move
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function move(
TranslatableBundle $sourceBundle,
User $performer,
array $pagesToMove,
array $pagesToRedirect,
- 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 move
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
TranslatableBundle $sourceBundle,
User $performer,
array $pagesToMove,
array $pagesToRedirect,
string $reason,