Showing 2,096 of 2,096 total issues
Function mapToTermInLangIds
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function mapToTermInLangIds(
array $termsArray,
ReplicaPrimaryAwareRecordIdsAcquirer $termInLangIdsAcquirer,
array $idsToRestore = []
) {
- 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 parseWellKnownProperty
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private static function parseWellKnownProperty(
array $wellKnownPropertyIds,
string $wellKnownName,
LoggerInterface $logger
): ?NumericPropertyId {
- 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 getSummaryMessage
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function getSummaryMessage( $name ) {
if ( isset( $this->messages[$name] ) ) {
return $this->messages[$name];
}
- 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 prefetch
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function prefetch( array $entityIds ) {
$entityIdCount = count( $entityIds );
if ( $entityIdCount > $this->cache->getMaxSize() ) {
// Ouch... fetching everything wouldn't fit into the cache, thus
- 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 buildTermResult
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function buildTermResult( array $results, ?int $limit = null ): array {
$matchingTerms = [];
// Union in SQL doesn't have limit, we need to enforce it here
$counter = 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 addInterwikiIdsToGroup
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function addInterwikiIdsToGroup( array $sites, $siteGroup ) {
foreach ( $sites as $site ) {
if ( $site->getGroup() === $siteGroup ) {
$localId = $site->getLanguageCode();
- 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 getByPropertyId
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getByPropertyId( ?PropertyId $certainPropertyId ): array {
if ( $certainPropertyId === null ) {
if ( $this->hasUnknownPropertyId ) {
return [];
} else {
- 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 formatReference
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function formatReference( Reference $reference ): string {
$referenceSnaks = new ByCertainPropertyIdGrouper( $reference->getSnaks(), [
$this->properties->referenceUrlPropertyId,
$this->properties->titlePropertyId,
$this->properties->statedInPropertyId,
- 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 getMultipleTermsByLanguageFromCache
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function getMultipleTermsByLanguageFromCache( EntityId $entityId, string $termType, array $languages ) {
$terms = [];
$languagesToCacheKeys = [];
- 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 getLinks
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getLinks(
?array $numericIds = null,
?array $siteIds = null,
?array $pageNames = 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
Function moveObjectToIndex
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function moveObjectToIndex( $object, $toIndex ) {
$this->assertIndexIsBuild();
if ( !in_array( $object, $this->toFlatArray() ) ) {
throw new OutOfBoundsException( 'Object not present in 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 getMultiple
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getMultiple( $keys, $default = null ) {
$values = $this->inner->getMultiple( $keys, self::DEFAULT_VALUE );
$misses = 0;
$hits = 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 equals
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function equals( $target ) {
if ( $this === $target ) {
return true;
}
- 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 newFromUpdate
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function newFromUpdate(
$action,
EntityDocument $oldEntity = null,
EntityDocument $newEntity = null
): EntityChange {
- 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 execute
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function execute() {
$stripProtocols = (bool)$this->getOption( 'strip-protocols', false );
$forceProtocol = $this->getOption( 'force-protocol', null );
$url = $this->getOption( 'load-from', 'https://meta.wikimedia.org/w/api.php' );
$scriptPath = $this->getOption( 'script-path', '/w/$1' );
- 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 equals
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function equals( $target ) {
if ( $this === $target ) {
return true;
}
- 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"