Showing 1,432 of 2,096 total issues
Function buildFromBabel
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function buildFromBabel( array $babel ) {
$chain = [];
$fetched = [];
// validate all the language codes and discard invalid ones
- 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
EntityId $fromId,
PropertyId $propertyId,
array $toIds,
$maxDepth,
$message = null,
Function validateBridgeApplicability
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public validateBridgeApplicability(
path: MainSnakPath,
): Promise<unknown> {
if ( this.state.applicationStatus === ApplicationStatus.SAVED ) {
// saving edits can transition us from applicable to inapplicable states, but that should not be an error
- 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
EntityId $fromId,
PropertyId $propertyId,
array $toIds,
$maxEntityVisits,
$message = null,
Function newDefinitionsFromConfigArray
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function newDefinitionsFromConfigArray( array $sourceConfig, SubEntityTypesMapper $subEntityTypesMapper ) {
$this->assertConfigArrayWellFormed( $sourceConfig );
$sources = [];
- 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 getEntitySourceById
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function getEntitySourceById( EntityId $id ): EntitySource {
foreach ( $this->entitySourceDefinitions->getSources() as $source ) {
if (
strpos( $id->getSerialization(), $source->getConceptBaseUri() ) === 0 &&
$source->getType() === ApiEntitySource::TYPE
- 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 patchAliasGroup
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function patchAliasGroup( AliasGroupList $groups, $lang, DiffOp $diffOp ) {
$hasLang = $groups->hasGroupForLanguage( $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
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
$name,
array $entityTypes,
$conceptBaseUri,
$rdfNodeNamespacePrefix,
$rdfPredicateNamespacePrefix,
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
EntityIdParser $propertyIdParser,
Deserializer $dataValueDeserializer,
PropertyDataTypeLookup $dataTypeLookup,
array $deserializerBuilders,
array $dataTypeToValueTypeMap,
Function getApiQueryResponsePage
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export function getApiQueryResponsePage( response: ApiQueryResponseBody, title: string ): ApiQueryResponsePage|null {
for ( const normalized of ( response.normalized || [] ) ) {
if ( normalized.from === title ) {
title = normalized.to;
break;
- 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 addReference
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function addReference( Reference $reference, $index = null ) {
if ( $index !== null && ( !is_int( $index ) || $index < 0 ) ) {
throw new InvalidArgumentException( '$index must be a non-negative integer or 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
Consider simplifying this complex logical expression. Open
if (
!editEntityResponse.entity ||
!editEntityResponse.entity.id ||
!editEntityResponse.entity.labels ||
!editEntityResponse.entity.descriptions ||
Consider simplifying this complex logical expression. Open
if ( ( $year == 0 && $precision < TimeValue::PRECISION_YEAR )
|| ( $month == 0 && $precision >= TimeValue::PRECISION_MONTH )
|| ( $day == 0 && $precision >= TimeValue::PRECISION_DAY )
) {
throw new InvalidArgumentException( 'Time value insufficient for precision.' );
Function PageConnector
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
repoApi,
firstSiteId,
firstPageName,
secondSiteId,
secondPageName
Function SELF
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
viewState,
$viewPort,
propertyDataTypeStore,
valueViewBuilder,
dataTypeStore
Function getSiteLinkListView
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
SELF.prototype.getSiteLinkListView = function ( startEditingCallback, siteLinks, $sitelinklistview, allowedSiteIds, $counter ) {
Function _attach
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
_attach: function ( source, target, event, handler, options ) {
Function makeAssertionMessage
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function makeAssertionMessage (path, key, type, value, expected) {
Function ApiValueFormatter
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function ( formatValueCaller, additionalOptions, dataTypeId, propertyId, outputType ) {
Function register
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
register: function ( source, target, event, handler, options ) {