Showing 2,096 of 2,096 total issues
Function getBadgeInfo
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getBadgeInfo( array $badgeIds ) {
$classes = [];
$labels = [];
foreach ( $badgeIds as $badgeId ) {
- 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 compareAndReturnNewUsagesAccountingForDeduplication
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function compareAndReturnNewUsagesAccountingForDeduplication(
array $newUsages,
array $oldUsages
): array {
$result = [];
- 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 getClientWikis
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function getClientWikis( SettingsArray $repoSettings ): array {
$clientWikis = $repoSettings->getSetting( 'localClientDatabases' );
// make sure we have a mapping from siteId to database name in clientWikis:
foreach ( $clientWikis as $siteID => $dbName ) {
if ( is_int( $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 setKeys
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function setKeys( array $entityIds, array $termTypes, array $languageCodes ): void {
foreach ( $entityIds as $entityId ) {
foreach ( $termTypes as $termType ) {
foreach ( $languageCodes as $languageCode ) {
$key = $this->getKey( $entityId, $termType, $languageCode );
- 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 doWikibaseHandleChange
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function doWikibaseHandleChange( Change $change ) {
if ( $this->sendEchoNotification !== true ) {
return false;
}
- 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 doHandle
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function doHandle( Parser $parser, $shortDesc, $controlArg ) {
$noReplace = $this->parseNoReplace( $parser, $controlArg );
$out = $parser->getOutput();
if ( $out->getPageProperty( 'wikibase-shortdesc' ) !== null && $noReplace ) {
- 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 getEntitySourceForConceptURI
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function getEntitySourceForConceptURI( $idSerialization ): ?ApiEntitySource {
$baseUri = $this->baseUriExtractor->getBaseUriFromSerialization( $idSerialization );
$conceptBaseURIsToSources = array_flip( $this->entitySourceDefinitions->getConceptBaseUris() );
if ( array_key_exists( $baseUri, $conceptBaseURIsToSources ) ) {
- 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 getChangeOp
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function getChangeOp( array $preparedParameters, EntityDocument $entity ): ChangeOp {
$changeOps = [];
$language = $preparedParameters['language'];
// Set the list of aliases to a user given one OR add/ remove certain entries
- 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( $subPage ) {
parent::execute( $subPage );
$this->checkPermissions();
$this->checkBlocked();
- 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 processArguments
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function processArguments( $subPage ) {
$this->extractInput( $subPage );
// Parse the 'id' parameter and throw an exception if the entity cannot be loaded
parent::processArguments( $subPage );
- 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 parseStringValue
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function parseStringValue( ValueParser $parser, string $value, ?ValueValidator $validator ): array {
$result = [
'raw' => $value,
];
- 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 getOptionsObject
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function getOptionsObject( ?string $optionsParam ): ParserOptions {
$parserOptions = new ParserOptions();
$parserOptions->setOption( ValueParser::OPT_LANG, $this->getLanguage()->getCode() );
if ( is_string( $optionsParam ) && $optionsParam !== '' ) {
- 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( $subPage ) {
parent::execute( $subPage );
[ $sites, $itemString ] = $this->getArguments( $subPage );
if ( $itemString !== '' ) {
- 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( $subPage ): void {
$this->setHeaders();
$this->outputHeader();
$this->getOutput()->addWikiMsg( 'wikibase-mylanguagefallbackchain-text' );
- 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 processArguments
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function processArguments( $subPage ) {
parent::processArguments( $subPage );
$request = $this->getRequest();
// explode the subpage from the format Special:SetSitelink/q123/enwiki
- 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 onOutputPageParserOutput
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function onOutputPageParserOutput( OutputPage $outputPage, ParserOutput $parserOutput ) {
// Set in PlaceholderEmittingEntityTermsView.
$placeholders = $parserOutput->getExtensionData( 'wikibase-view-chunks' );
if ( $placeholders !== null ) {
$outputPage->setProperty( 'wikibase-view-chunks', $placeholders );
- 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 attemptSaveEntity
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function attemptSaveEntity(
EntityDocument $entity,
$summary,
array $requestParams,
IContextSource $context,
- 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 statementMainSnakAlreadyExists
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function statementMainSnakAlreadyExists(
Statement $statement,
StatementList $existingStatements
): bool {
$propertyId = $statement->getPropertyId();
- 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 mergeSearchResults
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function mergeSearchResults( array $searchResults, array $newSearchResults, $limit ) {
$searchResultEntityIdSerializations = array_keys( $searchResults );
foreach ( $newSearchResults as $searchResultToAdd ) {
$entityIdString = $searchResultToAdd->getEntityId()->getSerialization();
- 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 validate
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function validate( $value ): Result {
if ( !is_string( $value ) ) {
throw new InvalidArgumentException( 'Expected a string' );
}
- 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"