Function doMoveToExternal
has a Cognitive Complexity of 60 (exceeds 5 allowed). Consider refactoring. Open
private function doMoveToExternal() {
$success = true;
$dbr = $this->getReplicaDB();
$count = $this->maxID - $this->minID + 1;
- 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 doMoveToExternal
has 103 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function doMoveToExternal() {
$success = true;
$dbr = $this->getReplicaDB();
$count = $this->maxID - $this->minID + 1;
File moveToExternal.php
has 262 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Move text from the text table to external storage
*
* This program is free software; you can redistribute it and/or modify
Method execute
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute() {
$this->resolveStubs = new ResolveStubs;
$this->esType = $this->getArg( 0 ); // e.g. "DB" or "mwstore"
$this->esLocation = $this->getArg( 1 ); // e.g. "cluster12" or "global-swift"
$dbw = $this->getPrimaryDB();
Function resolveLegacyEncoding
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
private function resolveLegacyEncoding( $text, $flags ) {
if ( $this->legacyEncoding !== null
&& !in_array( 'utf-8', $flags )
&& !in_array( 'utf8', $flags )
) {
- 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 resolveStubs
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function resolveStubs( $stubIDs ) {
if ( $this->dryRun ) {
print "Note: resolving stubs in dry run mode is expected to fail, " .
"because the main blobs have not been moved to external storage.\n";
}
Function execute
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function execute() {
$this->resolveStubs = new ResolveStubs;
$this->esType = $this->getArg( 0 ); // e.g. "DB" or "mwstore"
$this->esLocation = $this->getArg( 1 ); // e.g. "cluster12" or "global-swift"
$dbw = $this->getPrimaryDB();
- 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 resolveStubs
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function resolveStubs( $stubIDs ) {
if ( $this->dryRun ) {
print "Note: resolving stubs in dry run mode is expected to fail, " .
"because the main blobs have not been moved to external storage.\n";
}
- 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"