Showing 2,096 of 2,096 total issues
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
string $itemId,
array $patch,
array $editTags,
bool $isBot,
?string $comment,
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct( string $propertyId,
array $patch,
array $editTags,
bool $isBot,
?string $comment,
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
string $itemId,
array $patch,
array $editTags,
bool $isBot,
?string $comment,
Function deserialize
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function deserialize( array $serialization, string $basePath = '' ): Reference {
if ( count( $serialization ) && array_is_list( $serialization ) ) {
throw new InvalidFieldException( '', $serialization, $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 assertValidStatements
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function assertValidStatements( array $serialization, Item $originalItem, array $originalStatementsSerialization ): void {
$validationError = $this->statementsValidator->validateModifiedStatements(
$originalStatementsSerialization,
$originalItem->getStatements(),
$serialization['statements'] ?? [],
- 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
string $itemId,
string $languageCode,
array $editTags,
bool $isBot,
?string $comment,
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
string $propertyId,
string $statementId,
array $editTags,
bool $isBot,
?string $comment,
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
string $statementId,
array $patch,
array $editTags,
bool $isBot,
?string $comment,
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
string $itemId,
string $siteId,
array $editTags,
bool $isBot,
?string $comment,
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
AddPropertyStatementValidator $validator,
AssertPropertyExists $assertPropertyExists,
PropertyWriteModelRetriever $propertyRetriever,
GuidGenerator $guidGenerator,
PropertyUpdater $propertyUpdater,
Method saveEntity
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
EntityDocument $entity,
$summary,
User $user,
$flags = 0,
$baseRevId = false,
Method saveEntity
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function saveEntity( EntityDocument $entity, $summary, User $user, $flags = 0, $baseRevId = false, array $tags = [] );
Function insertNonExistingRecords
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function insertNonExistingRecords(
array $records,
?callable $recordsToInsertDecoratorCallback = null
): array {
if ( !$records ) {
- 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 addLanguageAndVariantsToChain
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function addLanguageAndVariantsToChain( $language, array &$chain, array &$fetched ): void {
$languageCode = is_string( $language ) ? $language : $language->getCode();
$this->addLanguageToChain( $language, $chain, $fetched );
- 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
LabelDescriptionLookup $labelDescriptionLookup,
LanguageNameLookup $languageNameLookup,
EntityExistenceChecker $entityExistenceChecker,
EntityTitleTextLookup $entityTitleTextLookup,
EntityUrlLookup $entityUrlLookup,
Function resolveGroupedTermInLangIds
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function resolveGroupedTermInLangIds(
array $groupedTermInLangIds,
array $types = null,
array $languages = null
): array {
- 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 resolveTermsViaJoin
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
$joinTable,
$joinColumn,
$groupColumn,
array $conditions,
array $types = null,
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
TemplateFactory $templateFactory,
LanguageNameLookup $languageNameLookup,
LocalizedTextProvider $textProvider,
LanguageDirectionalityLookup $languageDirectionalityLookup,
LanguageFallbackChainFactory $languageFallbackChainFactory,
Method mergeComplexArrays
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
string $key,
array $value,
array $defaultValue,
array $twoDArrayMerge,
array $overrideArrays,
Function loadEntityDataFromWikiPageRevision
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function loadEntityDataFromWikiPageRevision( RevisionRecord $revision, string $slotRole, int $revStoreFlags ) {
// NOTE: Support for cross-wiki content access in RevisionStore is incomplete when,
// reading from the pre-MCR database schema, see T201194.
// For that reason, we have to load and decode the content blob directly,
// instead of using RevisionRecord::getContent() or SlotRecord::getContent().
- 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"