Showing 1,432 of 2,096 total issues
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"
Further reading
Function onSetupAfterCache
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function onSetupAfterCache() {
global $wgContentHandlers,
$wgNamespaceContentModels;
if ( WikibaseRepo::getSettings()->getSetting( 'defaultEntityNamespaces' ) ) {
- 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 detectLabelDescriptionEqual
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function detectLabelDescriptionEqual(
array $labels,
array $descriptions
) {
foreach ( $labels as $languageCode => $label ) {
- 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 formatValue
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function formatValue( array $params, DataValue $value, ?string $dataTypeId ): string {
$snak = null;
if ( isset( $params['property'] ) ) {
$snak = new PropertyValueSnak( $this->parsePropertyId( $params['property'] ), $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 inheritDefaultRateLimits
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function inheritDefaultRateLimits( array &$rateLimits ) {
if ( isset( $rateLimits['wikibase-idgenerator']['&inherit-create-edit'] ) ) {
unset( $rateLimits['wikibase-idgenerator']['&inherit-create-edit'] );
$limits = $rateLimits['create'] ?? $rateLimits['edit'] ?? [];
foreach ( $limits as $group => $limit ) {
- 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"