Showing 691 of 718 total issues
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
\CirrusSearch\Parser\KeywordRegistry $keywordRegistry,
Escaper $escaper,
$qmarkStripLevel,
ParsedQueryClassifiersRepository $classifierRepository,
NamespacePrefixParser $namespacePrefixParser,
Method parseValue
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function parseValue( $key, $value, $quotedValue, $valueDelimiter, $suffix, WarningCollector $warningCollector ) {
Function getFixablePart
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function getFixablePart() {
if ( !$this->visited ) {
$this->visited = true;
$this->parsedQuery->getRoot()->accept( $this );
}
- 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 extractDisplayTitle
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private static function extractDisplayTitle( Title $title, ParserOutput $output ): ?string {
$titleText = $title->getText();
$titlePrefixedText = $title->getPrefixedText();
$raw = $output->getDisplayTitle();
- 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 parseValue
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function parseValue( $key, $value, $quotedValue, $valueDelimiter, $suffix, WarningCollector $warningCollector ) {
Method parseValue
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
$key,
$value,
$quotedValue,
$valueDelimiter,
$suffix,
Method parseValue
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function parseValue( $key, $value, $quotedValue, $valueDelimiter, $suffix, WarningCollector $warningCollector ) {
Method parseValue
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function parseValue( $key, $value, $quotedValue, $valueDelimiter, $suffix, WarningCollector $warningCollector ) {
Function parseValue
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function parseValue( $key, $value, $quotedValue, $valueDelimiter, $suffix, WarningCollector $warningCollector ) {
// en:Programming|id:3041512\
$categories = explode( '|', $value );// en:programming
if ( count( $categories ) > $this->maxConditions ) {
$warningCollector->addWarning(
- 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 setIfDefined
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
array $sourceArray,
$sourceKey,
array &$destArray,
$destKey = null,
$mapFn = null,
Method parseValue
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function parseValue( $key, $value, $quotedValue, $valueDelimiter, $suffix, WarningCollector $warningCollector ) {
Method parseValue
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function parseValue( $key, $value, $quotedValue, $valueDelimiter, $suffix, WarningCollector $warningCollector ) {
Function processSearchRawReturn
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function processSearchRawReturn( $result, WebRequest $request,
CirrusDebugOptions $debugOptions ) {
$output = null;
$header = null;
if ( $debugOptions->getCirrusExplainFormat() !== null ) {
- 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 finishInitializeBatch
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function finishInitializeBatch(): void {
if ( !$this->linkCountClosures ) {
return;
}
$linkCountClosureCount = count( $this->linkCountClosures );
- 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 parseValue
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
$key, $value, $quotedValue, $valueDelimiter, $suffix, WarningCollector $warningCollector
Function doApplyExtended
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function doApplyExtended( SearchContext $context, $key, $value, $quotedValue, $negated, $delimiter, $suffix ) {
$parsedValue = $this->parseValue( $key, $value, $quotedValue, $delimiter, $suffix, $context );
if ( $this->isRegexQuery( $parsedValue ) ) {
if ( !$this->enabled ) {
return [ null, false ];
- 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 parseValue
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function parseValue( $key, $value, $quotedValue, $valueDelimiter, $suffix,
WarningCollector $warningCollector ) {
Function getInterwikiResults
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function getInterwikiResults( SearchQuery $query ): Status {
$sources = MediaWikiServices::getInstance()
->getService( InterwikiResolver::SERVICE )
->getSisterProjectConfigs();
if ( !$sources ) {
- 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 accept
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def accept(self, cluster_state: ElasticsearchState) -> Sequence[str]:
# metastore should exist on all cirrussearch clusters
try:
yield cluster_state.aliases['mw_cirrus_metastore']
except KeyError:
- 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 check
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function check( $name, $expected, $actual ) {
$this->output( str_repeat( "\t", count( $this->path ) ) );
$this->output( "$name..." );
if ( is_array( $expected ) ) {
if ( in_array( $actual, $expected ) ) {
- 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"