src/PageTranslation/MoveTranslatableBundleMaintenanceScript.php
Function displayPagesToMove
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
Open
private function displayPagesToMove( PageMoveCollection $pageCollection, bool $leaveRedirect ): void {
$infoMessage = "\nThe following pages will be moved:\n";
$count = 0;
$subpagesCount = 0;
$talkpagesCount = 0;
- 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 displayPagesToMove
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function displayPagesToMove( PageMoveCollection $pageCollection, bool $leaveRedirect ): void {
$infoMessage = "\nThe following pages will be moved:\n";
$count = 0;
$subpagesCount = 0;
$talkpagesCount = 0;
Method execute
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function execute() {
$this->bundleMover = Services::getInstance()->getTranslatableBundleMover();
$mwService = MediaWikiServices::getInstance();
$this->titleParser = $mwService->getTitleParser();
File MoveTranslatableBundleMaintenanceScript.php
has 265 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
declare( strict_types = 1 );
namespace MediaWiki\Extension\Translate\PageTranslation;
Method __construct
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function __construct() {
parent::__construct();
$this->addDescription( 'Review and move translatable bundles including their subpages' );
$this->addArg(
Function execute
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
public function execute() {
$this->bundleMover = Services::getInstance()->getTranslatableBundleMover();
$mwService = MediaWikiServices::getInstance();
$this->titleParser = $mwService->getTitleParser();
- 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 progressCallback
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
private function progressCallback( Title $previous, Title $new, Status $status, int $total, int $processed ): void {