Showing 1,432 of 2,096 total issues
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
StatementGroupRendererFactory $rendererFactory,
SiteLinkLookup $siteLinkLookup,
EntityIdParser $entityIdParser,
RestrictedEntityLookup $restrictedEntityLookup,
$siteId,
Method formatDataForEnhancedLine
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
array &$data,
ExternalChange $externalChange,
Title $title,
int $count,
Language $lang,
Method attemptSave
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Title $title,
EntityContent $content,
string $summary,
int $undidRevId,
int $originalRevId,
Function getRevisionHeader
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function getRevisionHeader( RevisionRecord $rev, $complete = '' ) {
//NOTE: This must be kept in sync with the parent implementation.
// Perhaps some parts could be factored out to reduce code duplication.
$lang = $this->getLanguage();
- 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 saveEntityContent
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
EntityContent $entityContent,
User $user,
$summary = '',
$flags = 0,
$baseRevId = false,
Function filterRequest
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function filterRequest( array $jsonResult, int $limit ) {
$resultsArray = [];
$filteredResultCount = 0;
foreach ( $jsonResult['search'] as $result ) {
- 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
OtherProjectsSidebarGeneratorFactory $otherProjectsSidebarGeneratorFactory,
SiteLinkLookup $siteLinkLookup,
EntityLookup $entityLookup,
UsageAccumulatorFactory $usageAccumulatorFactory,
string $siteId,
Method getRankedSearchResults
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
$text,
$languageCode,
$entityType,
$limit,
$strictLanguage,
Method onSearchDataForIndex2
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
array &$fields,
ContentHandler $handler,
WikiPage $page,
ParserOutput $output,
SearchEngine $engine,
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
LanguageLinkBadgeDisplay $badgeDisplay,
NamespaceChecker $namespaceChecker,
SiteLinksForDisplayLookup $siteLinkForDisplayLookup,
SiteLookup $siteLookup,
string $siteId,
Method getRankedSearchResults
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
$text,
$languageCode,
$entityType,
$limit,
$strictLanguage,
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
EntityNamespaceLookup $entityNamespaceLookup,
EntityIdLookup $entityIdLookup,
RepoDomainDb $repoDomainDb,
array $entityTypes = [],
$redirectMode = EntityIdPager::NO_REDIRECTS,
Function rebuildPropertyInfo
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function rebuildPropertyInfo(): int {
$propertyNamespace = $this->entityNamespaceLookup->getEntityNamespace(
Property::ENTITY_TYPE
);
if ( $propertyNamespace === 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 generateNewId
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function generateNewId( IDatabase $database, $type, $retry = true ) {
$database->startAtomic( __METHOD__ );
$currentId = $database->newSelectQueryBuilder()
->select( 'id_value' )
- 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
HttpRequestFactory $httpRequestFactory,
array $contentModelMappings,
DataTypeDefinitions $dataTypeDefinitions,
EntitySourceDefinitions $entitySourceDefinitions,
string $federatedPropertiesSourceScriptUrl,
Method saveRedirect
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
EntityRedirect $redirect,
$summary,
User $user,
$flags = 0,
$baseRevId = false,
Method saveEntity
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
EntityDocument $entity,
$summary,
User $user,
$flags = 0,
$baseRevId = false,
Method factory
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
DescriptionLookup $descriptionLookup,
FallbackLabelDescriptionLookupFactory $labelDescriptionLookupFactory,
NamespaceChecker $namespaceChecker,
RepoLinker $repoLinker,
SettingsArray $clientSettings,
Method addEntityRevision
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
$sourceEntityIdSerialization,
EntityRevision $entityRevision,
$props = 'all',
array $filterSiteIds = null,
array $filterLangCodes = [],
Function validateParameters
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function validateParameters( array $params ): void {
if ( !( $this->modificationHelper->validateStatementGuid( $params['claim'] ) ) ) {
$this->errorReporter->dieError( 'Invalid claim guid', 'invalid-guid' );
}
- 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"