Showing 691 of 718 total issues
Method onPageMoveComplete
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
public function onPageMoveComplete( $old, $new, $user, $pageid, $redirid, $reason, $revision ) {
Method factory
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
ConfigFactory $configFactory,
Config $mainConfig,
GlobalIdGenerator $globalIdGenerator,
TitleFormatter $titleFormatter,
PageLookup $pageLookup,
Method __construct
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
SearchQuery $query,
$index,
$queryTemplate,
$suggestionField,
array $queryParams,
Method createIndex
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
$rebuild,
$maxShardsPerNode,
$shardCount,
$replicaCount,
$refreshInterval,
Method __construct
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
SearchConfig $searchConfig,
Connection $source,
Connection $target,
Index $index,
Index $oldIndex,
Method onShowSearchHitTitle
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
public function onShowSearchHitTitle( &$title, &$text, $result, $terms, $page, &$query, &$attributes ) {
Method doApplyExtended
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
public function doApplyExtended( SearchContext $context, $key, $value, $quotedValue, $negated, $delimiter, $suffix );
Method doApplyExtended
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
SearchContext $context,
$key,
$value,
$quotedValue,
$negated,
Method doApplyExtended
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
public function doApplyExtended( SearchContext $context, $key, $value, $quotedValue, $negated, $delimiter, $suffix ) {
Method __construct
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Connection $connection,
IReadableDatabase $db,
RevisionStore $revStore,
BacklinkCacheFactory $backlinkCacheFactory,
DocumentSizeLimiter $docSizeLimiter,
Method doApplyExtended
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
public function doApplyExtended( SearchContext $context, $key, $value, $quotedValue, $negated,
$delimiter, $suffix
Method onPageDeleteComplete
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
public function onPageDeleteComplete( ProperPageIdentity $page, Authority $deleter,
string $reason, int $pageID, RevisionRecord $deletedRev, ManualLogEntry $logEntry,
int $archivedRevisionCount
Function decideClusters
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function decideClusters( string $updateGroup ) {
$params = $this->getParams();
$searchConfig = $this->getSearchConfig();
$jobType = $this->getType();
- 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 onPageSaveComplete
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function onPageSaveComplete( $wikiPage, $user, $summary, $flags, $revisionRecord, $editResult ) {
Function pushElasticaWriteJobs
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function pushElasticaWriteJobs( string $updateGroup, array $items, $factory, int $batchSize = 10 ): void {
// Elasticsearch has a queue capacity of 50 so if $documents contains 50 pages it could bump up
// against the max. So we chunk it and do them sequentially.
$jobs = [];
$config = $this->connection->getConfig();
- 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 getRevisionIDs
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function getRevisionIDs(): array {
$result = [];
$warning = false;
foreach ( $this->getPageSet()->getRevisionIDs() as $revId => $pageId ) {
if ( isset( $result[$pageId] ) ) {
- 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 __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
InterwikiResolver $resolver, SearchConfig $hostWikiConfig, BagOStuff $localServerCache,
CirrusSearchHookRunner $cirrusSearchHookRunner, UserOptionsLookup $userOptionsLookup,
ExtensionRegistry $extensionRegistry
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
SearchConfig $config,
array $namespaces = null,
CirrusDebugOptions $options = null,
FallbackRunner $fallbackRunner = null,
FetchPhaseConfigBuilder $fetchPhaseConfigBuilder = null,
Method newRegexField
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
SearchConfig $config,
$name,
$target,
$pattern,
$caseInsensitive,
Function toArray
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function toArray() {
$output = [
'type' => $this->highlighterType
];
- 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"