Showing 2,096 of 2,096 total issues
Method __construct
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
array $tags,
ChangeOpFactoryProvider $changeOpFactoryProvider,
SpecialPageCopyrightView $copyrightView,
SummaryFormatter $summaryFormatter,
EntityTitleLookup $entityTitleLookup,
Method __construct
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
ApiMain $mainModule,
string $moduleName,
callable $errorReporterInstantiator,
StatementChangeOpFactory $statementChangeOpFactory,
StatementModificationHelper $modificationHelper,
Method factory
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
LanguageNameUtils $languageNameUtils,
Config $mwConfig,
AnonymousEditWarningBuilder $anonymousEditWarningBuilder,
ChangeOpFactoryProvider $changeOpFactoryProvider,
MediaWikiEditEntityFactory $editEntityFactory,
Function filterEntitySerializationUsingProps
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private function filterEntitySerializationUsingProps( array $serialization, $props ) {
if ( $props !== 'all' ) {
if ( !in_array( 'labels', $props ) ) {
unset( $serialization['labels'] );
}
- 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 10 arguments (exceeds 4 allowed). Consider refactoring. Open
ApiMain $mainModule,
string $moduleName,
IBufferingStatsdDataFactory $statsdDataFactory,
EntityRevisionLookup $revisionLookup,
EntityIdParser $idParser,
Function onBeforePageDisplay
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public static function onBeforePageDisplay( OutputPage $out, Skin $skin ) {
$entityNamespaceLookup = WikibaseRepo::getEntityNamespaceLookup();
$namespace = $out->getTitle()->getNamespace();
$isEntityTitle = $entityNamespaceLookup->isNamespaceWithEntities( $namespace );
$settings = WikibaseRepo::getSettings();
- 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 validateEntitySpecificParameters
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
protected function validateEntitySpecificParameters(
array $preparedParameters,
EntityDocument $entity,
int $baseRevId
): void {
- 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 10 arguments (exceeds 4 allowed). Consider refactoring. Open
ApiMain $mainModule,
string $moduleName,
SiteLinkStore $siteLinkStore,
SiteLinkGlobalIdentifiersProvider $siteLinkGlobalIdentifiersProvider,
SiteLinkTargetProvider $siteLinkTargetProvider,
Method __construct
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
ApiMain $mainModule,
string $moduleName,
ApiErrorReporter $errorReporter,
StatementChangeOpFactory $statementChangeOpFactory,
StatementModificationHelper $modificationHelper,
Method __construct
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
OutputPageEntityViewChecker $entityViewChecker,
OutputPageJsConfigBuilder $outputPageJsConfigBuilder,
ContentLanguages $termsLanguages,
UserLanguageLookup $userLanguageLookup,
UserPreferredContentLanguagesLookup $userPreferredContentLanguagesLookup,
Function addValue
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function addValue(
RdfWriter $writer,
$propertyValueNamespace,
$propertyValueLName,
$dataType,
- 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 createEntityChangeOp
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function createEntityChangeOp( array $changeRequest ) {
$this->assertArray( $changeRequest['sitelinks'], 'List of sitelinks must be an array' );
$siteLinksChangeOps = new ChangeOps();
$sites = $this->siteLinkTargetProvider->getSiteList( $this->siteLinkGroups );
- 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 fixEditConflict
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private function fixEditConflict( EntityDocument $newEntity ): ?EntityDocument {
$baseRev = $this->getBaseRevision();
$latestRev = $this->getLatestRevision();
if ( !$latestRev ) {
- 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 deserialize
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function deserialize( string $siteId, array $serialization, string $basePath = '' ): SiteLink {
if ( !array_key_exists( 'title', $serialization ) ) {
throw new MissingFieldException( 'title', $basePath );
}
- 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 getCacheKeys
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private function getCacheKeys( array $entityIds, array $termTypes, array $languageCodes ): array {
$cacheKeys = [];
$unresolvedIds = [];
$keyPartsMap = [];
foreach ( $entityIds as $entityId ) {
- 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 acquireTermInLangIds
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function acquireTermInLangIds( array $termsArray, $callback = null ): array {
$ids = [];
foreach ( $termsArray as $type => $termsOfType ) {
foreach ( $termsOfType as $lang => $terms ) {
- 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 updateQueryBuilder
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private function updateQueryBuilder( SelectQueryBuilder $queryBuilder, array $entityIds, IReadableDatabase $db ) {
$where = [];
$joinSlotsTable = false;
foreach ( $entityIds as $entityId ) {
- 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 getEntityRevisionFromCache
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public function getEntityRevisionFromCache(
EntityId $entityId,
$revisionId = 0,
$mode = LookupConstants::LATEST_FROM_REPLICA
) {
- 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 trimStatementGroup
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private trimStatementGroup(
newStatements: readonly Statement[],
baseStatements: readonly Statement[],
): Statement[] | null {
const baseStatementsById = statementListById( baseStatements );
- 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 10 arguments (exceeds 4 allowed). Consider refactoring. Open
EntityIdParser $entityIdParser,
EntityIdComposer $entityIdComposer,
Deserializer $dataValueDeserializer,
NameTableStoreFactory $nameTableStoreFactory,
DataAccessSettings $dataAccessSettings,