Showing 1,432 of 2,096 total issues
Method getEntityMetaDataAccessor
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getEntityMetaDataAccessor(): PrefetchingWikiPageEntityMetaDataAccessor {
if ( $this->entityMetaDataAccessor === null ) {
$entityNamespaceLookup = new EntityNamespaceLookup(
$this->entitySource->getEntityNamespaceIds(),
$this->entitySource->getEntitySlotNames()
Function 2d00
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
/***/ (function(module, exports, __webpack_require__) {
var global = __webpack_require__("da84");
var userAgent = __webpack_require__("342f");
- 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 getSiteLinkAddRemoveParams
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function getSiteLinkAddRemoveParams( DiffOp $diffOp, $action, $siteId, Title $title = null ) {
$params = [];
if ( in_array( $action, [ 'remove', 'restore' ] ) ) {
// Messages: wikibase-comment-remove, wikibase-comment-restore
- 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 getTermsSerializationWithFallbackInfo
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function getTermsSerializationWithFallbackInfo( array $serialization ) {
$newSerialization = $serialization;
foreach ( $this->termFallbackChains as $requestedLanguageCode => $fallbackChain ) {
if ( !array_key_exists( $requestedLanguageCode, $serialization ) ) {
$fallbackSerialization = $fallbackChain->extractPreferredValue( $serialization );
- 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 getEntityId
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function getEntityId( $pageTitle, $globalSiteId ) {
$globalSiteId = $globalSiteId ?: $this->siteId;
$entityId = null;
if ( $globalSiteId === $this->siteId ) {
- 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 getNamespaceNameForContentModel
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function getNamespaceNameForContentModel( string $entityContentModel ): ?string {
foreach ( $this->namespaces as $namespace ) {
if ( isset( $namespace['defaultcontentmodel'] ) && $namespace['defaultcontentmodel'] === $entityContentModel ) {
if ( array_key_exists( 'canonical', $namespace ) ) {
return $namespace['canonical'];
- 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 saveEntityContent
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function saveEntityContent(
EntityContent $entityContent,
User $user,
$summary = '',
$flags = 0,
- 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 filterImplicitUsages
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function filterImplicitUsages(
array $itemIdsByPageId,
array $contentLanguagesByPageId,
array $aspects
): 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
Function getEntityId
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function getEntityId( array $params ): EntityId {
$entityId = null;
foreach ( $params['claim'] as $guid ) {
if ( !$this->modificationHelper->validateStatementGuid( $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"
Further reading
Function assertNoPipeCharacterInAliases
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function assertNoPipeCharacterInAliases( Fingerprint $fingerprint ) {
if ( $this->aliases ) {
if ( $fingerprint->hasAliasGroup( $this->languageCode ) ) {
$aliasesInLang = $fingerprint->getAliasGroup( $this->languageCode )->getAliases();
foreach ( $aliasesInLang as $alias ) {
- 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 formatResult
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function formatResult( IResultWrapper $res, int $limit, array $props ): void {
$currentEntity = null;
$count = 0;
$result = $this->getResult();
$props = array_flip( $props );
- 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 modifyEntity
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
protected function modifyEntity( EntityDocument $entity, ChangeOp $changeOp, array $preparedParameters ): Summary {
$data = $preparedParameters[self::PARAM_DATA];
$exists = $this->entityExists( $entity->getId() );
- 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 validateBadgeSerialization
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function validateBadgeSerialization( array $serialization ) {
foreach ( $serialization as $badgeSerialization ) {
if ( !is_string( $badgeSerialization ) ) {
throw new ChangeOpDeserializationException(
'Badges: a string was expected, but not found',
- 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 parseDate
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function parseDate( $input ) {
$pattern = $this->parseDateFormat( $this->getDateFormat() );
AtEase::suppressWarnings();
$success = preg_match( $pattern, $input, $matches );
- 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 convertUnit
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function convertUnit( $unit, $convertUnits, $coherentUnits, $unitUsage, &$reconvert ) {
$unit['unit'] = substr( $unit['unit'], $this->baseLen );
$unit['siUnit'] = substr( $unit['siUnit'], $this->baseLen );
if ( isset( $convertUnits[$unit['unit']] ) ) {
- 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 formatSnak
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function formatSnak( Snak $snak ) {
$warningText = '';
try {
return $this->snakFormatter->formatSnak( $snak );
} catch ( MismatchingDataValueTypeException $ex ) {
- 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 loadRevisionInformation
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function loadRevisionInformation( array $entityIds, $mode ): array {
$rows = [];
$this->assertCanHandleEntityIds( $entityIds );
- 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 loadLatestRevisionIds
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function loadLatestRevisionIds( array $entityIds, $mode ): array {
$revisionIds = [];
$this->assertCanHandleEntityIds( $entityIds );
- 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 getPrefetchedTermsFromLookup
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function getPrefetchedTermsFromLookup(
array $entitiesToPrefetch,
array $languagesToPrefetch,
array $termTypes
): 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
Function getDeserialized
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function getDeserialized( array $serialization ) {
$statementList = new StatementList();
foreach ( $serialization as $key => $statementArray ) {
if ( is_string( $key ) ) {
- 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"