Showing 691 of 718 total issues
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
TitleHelper $titleHelper,
FetchPhaseConfigBuilder $builder,
ElasticaResultSet $results,
$searchContainedSyntax,
array $extraFieldsToExtract,
Function resolveRedirectHighlight
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function resolveRedirectHighlight( \Elastica\Result $r, $redirectTitleString, array $docRedirects, $namespaces ) {
// The match was against a redirect so we should replace the $title with one that
// represents the redirect.
// The first step is to strip the actual highlighting from the title.
$redirectTitleString = str_replace( [ Searcher::HIGHLIGHT_PRE, Searcher::HIGHLIGHT_POST ],
- 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 buildSettings
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
$maxShardsPerNode,
$shardCount,
$replicaCount,
$refreshInterval,
array $mergeSettings,
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
$profileName, $pushJobFreq, $chunkSize, $minLoopDuration, $logger = null, \JobQueueGroup $jobQueueGroup = null
Method parseValue
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
$key, $value, $quotedValue, $valueDelimiter, $suffix, WarningCollector $warningCollector
Function extractHits
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
protected function extractHits( array $responseData ) {
$hits = [];
if ( isset( $responseData['hits']['hits'] ) ) {
foreach ( $responseData['hits']['hits'] as $hit ) {
if ( !isset( $hit['_source']['namespace'] )
- 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 defaults
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function defaults( $language ) {
$defaults = [
'analyzer' => [
'text' => [
'type' => $this->getDefaultTextAnalyzerType( $language ),
- 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
public function __construct( Client $client, $aliasName, $specificIndexName, $startOver, $type, Printer $out = null ) {
Method parseValue
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function parseValue( $key, $value, $quotedValue, $valueDelimiter, $suffix, WarningCollector $warningCollector ) {
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Index $index,
ConfigUtils $utils,
array $analysisConfig,
array $mappings,
array $similarityConfig = null,
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Index $index,
$masterTimeout,
$optimizeIndexForExperimentalHighlighter,
array $availablePlugins,
array $mappingConfig,
Function isIndexLive
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function isIndexLive( $indexName ): Status {
try {
// primary check, verify no aliases point at our index. This invokes
// the endpoint directly, rather than Index::getAliases, as that method
// does not check http status codes and can incorrectly report no aliases.
- 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 onBeforeInitialize
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function onBeforeInitialize( $title, $unused, $outputPage, $user, $request, $mediaWiki ) {
Function checkAllMatches
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function checkAllMatches( $transformer, $transformedTerm, $allMatchedTitles ) {
if ( isset( $allMatchedTitles[ 'titleMatch' ] ) &&
$this->checkOneMatch( $transformer, $transformedTerm, $allMatchedTitles[ 'titleMatch' ] ) ) {
return $allMatchedTitles[ 'titleMatch' ];
}
- 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
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 looksLikeAutomation
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function looksLikeAutomation( SearchConfig $config, string $ip, array $headers ): bool {
// Is there an http header that can be matched with regex to flag automation,
// such as the user-agent or a flag applied by some infrastructure?
$automationHeaders = $config->get( 'CirrusSearchAutomationHeaderRegexes' ) ?? [];
foreach ( $automationHeaders as $name => $pattern ) {
- 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 buildSuggestion
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
private function buildSuggestion( $suggestionType, $docId, array $inputs, $score, array $inputDoc, array $scoreExplanation = null ) {
Method parseValue
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function parseValue( $key, $value, $quotedValue, $valueDelimiter, $suffix, WarningCollector $warningCollector ) {