Showing 2,096 of 2,096 total issues
Function 69f3
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
/***/ (function(module, exports, __webpack_require__) {
var NATIVE_WEAK_MAP = __webpack_require__("7f9a");
var global = __webpack_require__("da84");
var isObject = __webpack_require__("861d");
- 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 da84
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
/***/ (function(module, exports, __webpack_require__) {
/* WEBPACK VAR INJECTION */(function(global) {var check = function (it) {
return it && it.Math == Math && it;
};
- 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 mergeChanges
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function mergeChanges( EntityId $entityId, array $changes ) {
if ( count( $changes ) === 1 ) {
return reset( $changes );
}
- 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 getOtherProjectsSiteIds
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function getOtherProjectsSiteIds( array $siteLinkGroups ) {
$localSite = $this->getLocalSite();
if ( $localSite === null ) {
wfWarn( 'Site not found for ' . $this->localSiteId );
- 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 addTermsToResult
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function addTermsToResult( array $pagesToEntityIds, array $termGroups ): void {
$result = $this->getResult();
foreach ( $pagesToEntityIds as $currentPage => $entityId ) {
if ( !isset( $termGroups[$currentPage] ) ) {
- 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 render
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function render(
EntityId $entityId,
$propertyLabelOrId,
array $acceptableRanks = 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 getEligibleRevisionIdentifiersById
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function getEligibleRevisionIdentifiersById( EntityId $entityId, array $ids ): array {
$revisions = [];
foreach ( $ids as $id ) {
$timestamp = $this->revisionLookup->getTimestampFromId( $id );
- 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 fetchIds
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function fetchIds( $limit ) {
Assert::parameter( is_int( $limit ) && $limit > 0, '$limit', '$limit must be a positive integer' );
$dbr = $this->db->connections()->getReadConnection();
$queryBuilder = $dbr->newSelectQueryBuilder();
- 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 addLinksToOutput
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function addLinksToOutput( array $links, ParserOutput $parserOutput ) {
foreach ( $links as $siteId => $siteLink ) {
$page = $siteLink->getPageName();
$targetSite = $this->siteLookup->getSite( $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 filterRepoLinksByGroup
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function filterRepoLinksByGroup( array $repoLinks, array $allowedGroups ) {
foreach ( $repoLinks as $wiki => $link ) {
if ( !$this->siteLookup->getSite( $wiki ) ) {
unset( $repoLinks[$wiki] );
continue;
- 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 getConflictForSiteLink
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function getConflictForSiteLink( string $itemId, SiteLink $siteLink ): ?array {
$key = $this->cacheKey( $siteLink );
$ttl = BagOStuff::TTL_MINUTE;
$conflict = [
'siteId' => $siteLink->getSiteId(),
- 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 overridePageMetaTags
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function overridePageMetaTags( OutputPage $outputPage ) {
$meta = $this->getOutput()->getProperty( 'wikibase-meta-tags' );
if ( $this->isDiff() ) {
if ( isset( $meta['title'] ) ) {
- 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 getUsedEntityIdStrings
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function getUsedEntityIdStrings( array $idStrings ): array {
// Note: We need to use one (sub)query per entity here, per T116404
$subQueries = $this->getUsedEntityIdStringsQueries( $idStrings );
$readConnection = $this->db->connections()->getReadConnection();
- 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 collectValuesInternal
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private static function collectValuesInternal( array $data, array $flippedIgnoreArray, array &$values = [] ) {
foreach ( $data as $key => $value ) {
if ( isset( $flippedIgnoreArray[$key] ) ) {
continue;
}
- 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 localLinksToArray
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function localLinksToArray( array $flatLinks ) {
$links = [];
$sites = $this->siteLookup->getSites();
foreach ( $flatLinks as $s ) {
- 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 getConflictsForItem
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function getConflictsForItem( ItemId $itemId, SiteLinkList $siteLinkList, int $db = null ) {
if ( $siteLinkList->isEmpty() ) {
return [];
}
- 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 addLinkHeaders
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function addLinkHeaders( OutputPage $outputPage ) {
if ( !$this->isEditable() ) {
return;
}
$variables = $outputPage->getJsConfigVars();
- 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 checkCanCreateRedirect
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function checkCanCreateRedirect( EntityId $entityId ): void {
try {
$revision = $this->entityRevisionLookup->getEntityRevision(
$entityId,
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 getEntityIdMatchingSearchTerm
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function getEntityIdMatchingSearchTerm( $term, $entityType ) {
$entityId = null;
foreach ( $this->getEntityIdCandidatesForSearchTerm( $term ) as $candidate ) {
try {
$entityId = $this->idParser->parse( $candidate );
- 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 validateParameters
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function validateParameters( array $params ): void {
if ( $params['snaktype'] === 'value' xor isset( $params['value'] ) ) {
if ( $params['snaktype'] === 'value' ) {
$this->errorReporter->dieWithError(
[ 'wikibase-api-claim-value-missing' ],
- 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"