Showing 1,432 of 2,096 total issues
Function findPrimaryCoordinateKey
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function findPrimaryCoordinateKey() {
foreach ( $this->preferredPropertiesIds as $id ) {
$key = $this->makeCoordinateKey( $id, Statement::RANK_PREFERRED );
$preferredCount = $this->getCoordinatesGroupCount( $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"
Further reading
Function deserialize
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function deserialize( array $serialization, string $basePath ): array {
if ( !count( $serialization ) || !array_is_list( $serialization ) ) {
$parts = explode( '/', $basePath );
throw new InvalidFieldException( $parts[array_key_last( $parts )], $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 getHtml
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function getHtml( TermFallback $term ) {
$requestedLanguage = $term->getLanguageCode();
$actualLanguage = $term->getActualLanguageCode();
$sourceLanguage = $term->getSourceLanguageCode();
- 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 __construct
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function __construct( array $fields = [] ) {
Assert::parameter(
!array_diff( array_keys( $fields ), self::FIELD_NAMES ),
'$fields',
'must only contain the following keys: termType, termLanguage, termText'
- 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 toStandardUnits
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function toStandardUnits( UnboundedQuantityValue $value ) {
$fromUnit = $value->getUnit();
if ( $fromUnit === '1' ) {
// Won't convert unitless values
- 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 9 (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 getAmountAndPrecisionHtml
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function getAmountAndPrecisionHtml( $precision, $amount = 1 ) {
if ( $amount === 0 ) {
// TODO: Use NumberLocalizer
return '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 getPatchedAliases
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function getPatchedAliases( array $aliases, Diff $patch ) {
foreach ( $patch as $diffOp ) {
switch ( true ) {
case $diffOp instanceof DiffOpAdd:
$aliases[] = $diffOp->getNewValue();
- 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 patchTerm
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function patchTerm( TermList $terms, $lang, AtomicDiffOp $diffOp ) {
$hasLang = $terms->hasTermForLanguage( $lang );
switch ( true ) {
case $diffOp instanceof DiffOpAdd:
- 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 getReferencedEntityId
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public function getReferencedEntityId( EntityId $fromId, PropertyId $propertyId, array $toIds ) {
if ( !$toIds ) {
return 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 buildEntityTypeToDatabaseSourceMapping
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function buildEntityTypeToDatabaseSourceMapping() {
$this->entityTypeToDatabaseSourceMapping = [];
foreach ( $this->sources as $source ) {
if ( $source->getType() === DatabaseEntitySource::TYPE ) {
$entityTypes = $source->getEntityTypes();
- 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 exports
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
module.exports = function (Iterable, NAME, IteratorConstructor, next, DEFAULT, IS_SET, FORCED) {
Method __construct
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
EntityIdParser $entityIdParser,
EntityIdLookup $entityIdLookup,
WikibaseServices $wikibaseServices,
SettingsArray $settings,
TermBuffer $termBuffer,
Method onArticleDeleteComplete
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
$wikiPage,
$user,
$reason,
$id,
$content,
Method onPageMoveComplete
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
$oldLinkTarget,
$newLinkTarget,
$userIdentity,
$pageId,
$redirid,
Method __construct
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
TermFallbackCacheFacade $termFallbackCacheFacade,
RedirectResolvingLatestRevisionLookup $redirectResolvingLatestRevisionLookup,
LanguageFallbackChainFactory $languageFallbackChainFactory,
TermLookup $termLookup,
LanguageFactory $languageFactory,
Method onChangesListSpecialPageQuery
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
public function onChangesListSpecialPageQuery( $name, &$tables, &$fields,
&$conds, &$query_options, &$join_conds, $opts ) {
Method onArticleDeleteComplete
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
public function onArticleDeleteComplete( $wikiPage, $user, $reason, $id,
$content, $logEntry, $archivedRevisionCount
Method __construct
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
SiteLinkLookup $siteLinkLookup,
LoggerInterface $logger,
ClientDomainDb $clientDomainDb,
UserIdentity $user,
$siteId,
Method __construct
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
$userName,
$timestamp,
$comment,
$commentHtml,
$siteId,