Showing 691 of 718 total issues
Function waitForQueueToDrain
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
private function waitForQueueToDrain( $wiki ) {
if ( !$this->queue ) {
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
Function consume
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
public function consume( $query ) {
if ( $this->getOption( 'decode' ) ) {
$query = urldecode( $query );
}
$data = [ 'query' => $query ];
- 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
Consider simplifying this complex logical expression. Open
Open
if ( !array_key_exists( $analyzer, $config['analyzer'] ) // array exists
|| $config['analyzer'][$analyzer]['type'] != 'custom' // array is custom
|| !$this->requiredTokenizerUsed( $config['analyzer'][$analyzer] )
|| $this->disallowedTokenFiltersPresent( $config, $analyzer )
|| $this->disallowedCharFiltersPresent( $config, $analyzer )
Consider simplifying this complex logical expression. Open
Open
if ( !$this->indexUpdates || $this->hasOption( 'limit' )
|| $this->hasOption( 'from' ) || $this->hasOption( 'to' )
|| $this->hasOption( 'fromId' ) || $this->hasOption( 'toId' )
) {
$this->fatalError(
Method build
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
SearchConfig $config,
WANObjectCache $wanCache,
InterwikiLookup $iwLookup,
ExtensionRegistry $extensionRegistry,
MultiHttpClient $client
Method onPageDelete
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public function onPageDelete( ProperPageIdentity $page,
Authority $deleter,
string $reason,
StatusValue $status,
bool $suppress
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
$searchEngineEntryPoint,
array $namespaces,
array $acceptableQueryClasses,
$profileContext,
$score
Method sendResetWeightedTags
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
string $indexSuffix,
array $docIds,
string $tagField,
string $tagPrefix,
int $batchSize = 30
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public function __construct( SearchConfig $config = null,
CirrusDebugOptions $debugOptions = null,
NamespacePrefixParser $namespacePrefixParser = null,
InterwikiResolver $interwikiResolver = null, TitleHelper $titleHelper = null
Method onPageDelete
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
ProperPageIdentity $page,
Authority $deleter,
string $reason,
\StatusValue $status,
bool $suppress
Method onTitleMove
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public function onTitleMove( Title $old, Title $nt, User $user, $reason, Status &$status ) {
Method fromConfig
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public static function fromConfig( $type, $name, $configEntry, Config $config, BagOStuff $cache ) {
Method run
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
SearcherFactory $factory,
CirrusSearchResultSet $initialResult,
MSearchResponses $responses,
NamespacePrefixParser $namespacePrefixParser,
CirrusSearchHookRunner $cirrusSearchHookRunner
Method newRegexField
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
$name,
$target,
$pattern,
$caseInsensitive,
$priority = HighlightedField::COSTLY_EXPERT_SYNTAX_PRIORITY
Method newRegexField
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
$name,
$target,
$pattern,
$caseInsensitive,
$priority = HighlightedField::COSTLY_EXPERT_SYNTAX_PRIORITY
Method maybeSearchAndRewrite
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
FallbackRunnerContext $context,
SearchQuery $originalQuery,
string $suggestedQuery,
$suggestedQuerySnippet = null,
int $resultsThreshold = 1
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
Config $mainConfig,
TitleFormatter $titleFormatter,
SearchConfig $searchConfig,
GlobalIdGenerator $globalIdGenerator,
StreamNameMapper $streamNameMapper
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public function __construct( SearchConfig $config, $requestedNamespaces, $localSearch, $withDefaultBoosts, $weight ) {
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
FetchPhaseConfigBuilder $fetchPhaseBuilder,
$searchContainedSyntax,
TitleHelper $titleHelper,
array $extraFieldsToExtract = [],
bool $deduplicate = false
Method addNewRegexHLField
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
$name,
$target,
$pattern,
$caseInsensitive,
$priority = HighlightedField::COSTLY_EXPERT_SYNTAX_PRIORITY