Showing 11,545 of 11,545 total issues
Function processCompletionResults
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
protected function processCompletionResults( $search, SearchSuggestionSet $suggestions ) {
// We over-fetched to determine pagination. Shrink back down if we have extra results
// and mark if pagination is possible
$suggestions->shrink( $this->limit );
- 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 defaultSearchBackend
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function defaultSearchBackend( $namespaces, $search, $limit, $offset ) {
if ( !$namespaces ) {
$namespaces = [ NS_MAIN ];
}
- 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 markPatrolled
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function markPatrolled( Authority $performer, $tags = null ): PermissionStatus {
$services = MediaWikiServices::getInstance();
$mainConfig = $services->getMainConfig();
$useRCPatrol = $mainConfig->get( MainConfigNames::UseRCPatrol );
$useNPPatrol = $mainConfig->get( MainConfigNames::UseNPPatrol );
- 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 fetchScriptList
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
protected function fetchScriptList() {
$data = [
'action' => 'query',
'format' => 'json',
'list' => 'allpages',
- 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 readDump
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
protected function readDump( $input ) {
$this->buffer = "";
$this->openElement = false;
$this->atStart = true;
$this->state = "";
- 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 resolveStub
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function resolveStub( $row, $dryRun ) {
$id = $row->old_id;
$stub = unserialize( $row->old_text );
$flags = SqlBlobStore::explodeFlags( $row->old_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
Function endElement
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
protected function endElement( $parser, $name ) {
$this->checkpointJustWritten = false;
if ( $this->openElement ) {
$this->clearOpenElement( "" );
- 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 validate
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function validate() {
$valid = true;
# Check to make sure we've got all the required options
foreach ( $this->mOptDefs as $opt => $info ) {
if ( $info['require'] && !$this->hasOption( $opt ) ) {
- 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 rebuildRecentChangesTablePass2
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
private function rebuildRecentChangesTablePass2() {
$dbw = $this->getPrimaryDB();
$this->output( "Updating links and size differences...\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"
Further reading
Function execute
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function execute() {
global $IP;
if ( $this->hasOption( 'help' ) ) {
$this->maybeHelp();
- 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 readChars
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function readChars( $callback ) {
$this->getBlocks();
$this->currentBlock = reset( $this->blocks );
$xml = $this->open();
$this->callback = $callback;
- 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 execute
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function execute() {
global $IP;
$data = [];
- 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 execute
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function execute() {
$this->dataDir = $this->getOption( 'data-dir', '.' );
$allkeysPresent = file_exists( "{$this->dataDir}/allkeys.txt" );
$ucdallPresent = file_exists( "{$this->dataDir}/ucd.all.grouped.xml" );
- 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 updateOptions
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
private function updateOptions() {
$dryRun = $this->hasOption( 'dry' );
$settingWord = $dryRun ? 'Would set' : 'Setting';
$option = $this->getArg( 0 );
$fromIsDefault = $this->hasOption( 'old-is-default' );
- 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 fetchMessageInfo
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
protected function fetchMessageInfo( $langCode, array &$messageInfo ) {
$services = $this->getServiceContainer();
$contLang = $services->getContentLanguage();
if ( $langCode ) {
$this->output( "\n... fetching message info for language: $langCode" );
- 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 execute
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
public function execute() {
$config = $this->getConfig();
$objectCaches = $config->get( MainConfigNames::ObjectCaches );
$cacheType = $this->getOption( 'cache', $config->get( MainConfigNames::MainCacheType ) );
- 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 handleBatch
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
private function handleBatch( int $lowId ): array {
$migratedCount = 0;
$res = $this->dbw->newSelectQueryBuilder()
->select( '*' )
->from( 'ipblocks' )
- 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 doPerfTest
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
protected function doPerfTest( FileBackend $backend ) {
$ops1 = [];
$ops2 = [];
$ops3 = [];
$ops4 = [];
- 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 movePage
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
private function movePage( $id, LinkTarget $newLinkTarget ) {
$dbw = $this->getPrimaryDB();
$dbw->newUpdateQueryBuilder()
->update( 'page' )
- 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 scanRevisionsByTimestamp
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
private function scanRevisionsByTimestamp( $fromTimestamp, $total ) {
$count = 0;
$lastRevId = 0;
$firstRevId = 0;
$lastTimestamp = $fromTimestamp;
- 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"