Showing 691 of 718 total issues
Avoid too many return
statements within this method. Open
return false;
Avoid too many return
statements within this method. Open
return false;
Avoid too many return
statements within this method. Open
return true;
Avoid too many return
statements within this method. Open
return null;
Avoid too many return
statements within this method. Open
return $page;
Avoid too many return
statements within this method. Open
return Status::newGood( $result );
Avoid too many return
statements within this method. Open
return false;
Avoid too many return
statements within this function. Open
return "Index on wrong cluster of replica, expected in " + ', '.join(
Avoid too many return
statements within this method. Open
return $mresponses->transformAndGetMulti( $this->searchContext->getResultsType(), array_keys( $iwQueries ),
static function ( array $v ) use ( $blockScorer ) {
return $blockScorer->reorder( $v );
} );
Avoid too many return
statements within this method. Open
return false;
Avoid too many return
statements within this function. Open
return (
Avoid too many return
statements within this function. Open
return (
Avoid too many return
statements within this method. Open
return true;
Avoid too many return
statements within this method. Open
return $result;
Avoid too many return
statements within this method. Open
return false;
Avoid too many return
statements within this function. Open
return 'Duplicate of live index ' + live_index + '. ' + reason
Function getExtraIndexesForNamespaces
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function getExtraIndexesForNamespaces( SearchConfig $config, array $namespaces ) {
$extraIndexes = [];
foreach ( $config->get( 'CirrusSearchExtraIndexes' ) ?: [] as $namespace => $indexes ) {
if ( !in_array( $namespace, $namespaces ) ) {
continue;
- 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 hasProfile
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function hasProfile( $type, $name ) {
if ( isset( $this->repositories[$type] ) ) {
foreach ( $this->repositories[$type] as $repo ) {
if ( $repo->hasProfile( $name ) ) {
return true;
- 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 loadInterwikiOverrides
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function loadInterwikiOverrides( SearchProfileService $service, SearchConfig $config ) {
if ( $config->isLocalWiki() || $config === $this->hostWikiConfig ) {
return;
}
$iwPrefix = $this->interwikiResolver->getInterwikiPrefix( $config->getWikiId() );
- 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 newHighlightField
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function newHighlightField(
$name,
$target,
$priority = HighlightedField::DEFAULT_TARGET_PRIORITY
): BaseHighlightedField {
- 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"