File recompressTracked.php
has 600 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Moves blobs indexed by trackBlobs.php to a specified list of destination
* clusters, and recompresses them in the process.
*
Function doPage
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
private function doPage( $pageId ) {
$title = Title::newFromID( $pageId );
if ( $title ) {
$titleText = $title->getPrefixedText();
} else {
- 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
RecompressTracked
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
class RecompressTracked {
public $destClusters;
public $batchSize = 1000;
public $orphanBatchSize = 1000;
public $reportingInterval = 10;
Method commit
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function commit() {
$originalCount = count( $this->texts );
if ( !$originalCount ) {
return;
}
Method doAllOrphans
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function doAllOrphans() {
$dbr = MediaWikiServices::getInstance()->getConnectionProvider()->getReplicaDatabase();
$startId = 0;
$i = 0;
if ( $this->noCount ) {
Method doPage
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function doPage( $pageId ) {
$title = Title::newFromID( $pageId );
if ( $title ) {
$titleText = $title->getPrefixedText();
} else {
Function doAllOrphans
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
private function doAllOrphans() {
$dbr = MediaWikiServices::getInstance()->getConnectionProvider()->getReplicaDatabase();
$startId = 0;
$i = 0;
if ( $this->noCount ) {
- 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 commit
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function commit() {
$originalCount = count( $this->texts );
if ( !$originalCount ) {
return;
}
- 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 doAllPages
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function doAllPages() {
$dbr = MediaWikiServices::getInstance()->getConnectionProvider()->getReplicaDatabase();
$i = 0;
$startId = 0;
if ( $this->noCount ) {
Function doAllPages
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
private function doAllPages() {
$dbr = MediaWikiServices::getInstance()->getConnectionProvider()->getReplicaDatabase();
$i = 0;
$startId = 0;
if ( $this->noCount ) {
- 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 startChildProcs
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function startChildProcs() {
$wiki = WikiMap::getCurrentWikiId();
$cmd = 'php ' . Shell::escape( __FILE__ );
foreach ( self::$cmdLineOptionMap as $cmdOption => $classOption ) {
Function startChildProcs
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private function startChildProcs() {
$wiki = WikiMap::getCurrentWikiId();
$cmd = 'php ' . Shell::escape( __FILE__ );
foreach ( self::$cmdLineOptionMap as $cmdOption => $classOption ) {
- 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 doOrphanList
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function doOrphanList( $textIds ) {
// Finish incomplete moves
if ( !$this->copyOnly ) {
$this->finishIncompleteMoves( [ 'bt_text_id' => $textIds ] );
$this->syncDBs();
Method finishIncompleteMoves
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function finishIncompleteMoves( $conds ) {
$dbr = MediaWikiServices::getInstance()->getConnectionProvider()->getReplicaDatabase();
$lbFactory = MediaWikiServices::getInstance()->getDBLoadBalancerFactory();
$startId = 0;
Function finishIncompleteMoves
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function finishIncompleteMoves( $conds ) {
$dbr = MediaWikiServices::getInstance()->getConnectionProvider()->getReplicaDatabase();
$lbFactory = MediaWikiServices::getInstance()->getDBLoadBalancerFactory();
$startId = 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
Function doOrphanList
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function doOrphanList( $textIds ) {
// Finish incomplete moves
if ( !$this->copyOnly ) {
$this->finishIncompleteMoves( [ 'bt_text_id' => $textIds ] );
$this->syncDBs();
- 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 executeChild
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function executeChild() {
$this->debug( 'starting' );
$this->syncDBs();
while ( !feof( STDIN ) ) {
- 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"