Showing 2,096 of 2,096 total issues
Function getEditCommentMulti
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function getEditCommentMulti( EntityChange $change, Title $target = null ) {
$info = $change->getInfo();
if ( isset( $info['changes'] ) ) {
if ( $info['changes'] === [] ) {
- 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() {
$referenceJson = $this->getParameter( 'reference' );
$referenceJsonStatus = FormatJson::parse( $referenceJson, FormatJson::FORCE_ASSOC );
if ( !$referenceJsonStatus->isGood() ) {
- 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 prepareChangeAttributes
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function prepareChangeAttributes( EntityChange $change ) {
$rcinfo = $change->getMetadata();
$fields = $change->getFields();
$fields['entity_type'] = $change->getEntityId()->getEntityType();
- 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 addFilter
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function addFilter( ChangesListSpecialPage $specialPage ): void {
$filterName = $this->getFilterName();
$changeTypeGroup = $specialPage->getFilterGroup( 'changeType' );
$out = $specialPage->getOutput();
- 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 getClientUserId
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function getClientUserId( $repoUserId, array $metadata, bool $changeComesFromLocalDb ) {
if ( $repoUserId === 0 ) {
// Logged out on repo just copied to client
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 injectRCRecords
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function injectRCRecords( array $titles, EntityChange $change, array $rootJobParams = [] ) {
if ( $titles === [] ) {
return;
}
- 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 getLink
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getLink( Title $title, $action, $hasLangLinks, ?array $noExternalLangLinks, $prefixedId ) {
if ( $this->canHaveLink( $title, $action, $noExternalLangLinks ) ) {
$entityId = null;
if ( is_string( $prefixedId ) ) {
- 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 renumber
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function renumber( array &$entityArr ) {
foreach ( $entityArr as &$value ) {
if ( !is_array( $value ) ) {
continue;
}
- 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 onPageMoveComplete
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function onPageMoveComplete(
$oldLinkTarget,
$newLinkTarget,
$userIdentity,
$pageId,
- 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 isPrefetched
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function isPrefetched( EntityId $entityId, array $termTypes, array $languageCodes ): bool {
foreach ( $termTypes as $termType ) {
foreach ( $languageCodes as $languageCode ) {
$key = $this->getKey( $entityId, $termType, $languageCode );
if ( !isset( $this->termKeys[$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 indexLinksByInterwiki
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function indexLinksByInterwiki( array $links ) {
$indexed = [];
foreach ( $links as $link ) {
$siteId = $link->getSiteId();
- 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 rebuild
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function rebuild() {
$ticket = $this->db->getEmptyTransactionTicket( __METHOD__ );
foreach ( $this->getIdBatches() as $itemIds ) {
$this->progressReporter->reportMessage(
- 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 getOrCreatePingbackId
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function getOrCreatePingbackId() {
if ( !$this->id ) {
$dbr = $this->repoConnections->getReadConnection();
$id = $dbr->newSelectQueryBuilder()
- 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 extractSummaryProperties
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function extractSummaryProperties( $result ): array {
$propertyIds = [];
foreach ( $result as $revisionRow ) {
$comment = $this->getCommentText( $revisionRow );
if ( $comment === 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 onOutputPageParserOutput
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function onOutputPageParserOutput( $outputPage, $parserOutput ): void {
$title = $outputPage->getTitle();
if ( !$title || !$this->namespaceChecker->isWikibaseEnabled( $title->getNamespace() ) ) {
// shorten out
return;
- 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 generateOpHtml
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected function generateOpHtml( array $path, DiffOp $op ): string {
if ( $op instanceof AtomicDiffOp ) {
$localizedPath = $path;
$translatedLinkSubPath = $this->messageLocalizer->msg(
- 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 onLoadExtensionSchemaUpdates
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function onLoadExtensionSchemaUpdates( $updater ) {
$db = $updater->getDB();
$type = $db->getType();
if ( $type !== 'mysql' && $type !== 'sqlite' && $type !== 'postgres' ) {
- 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 buildPreliminarySidebarFromSiteLinks
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function buildPreliminarySidebarFromSiteLinks( array $siteLinks ) {
$linksByGroup = [];
foreach ( $siteLinks as $siteLink ) {
if ( !in_array( $siteLink->getSiteId(), $this->siteIdsToOutput ) ) {
- 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 addJsModules
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function addJsModules( OutputPage $outputPage, Title $title, $actionName, Skin $skin ): void {
$user = $outputPage->getUser();
if ( $this->hasLinkItemWidget( $user, $outputPage, $title, $actionName ) ) {
// Add the JavaScript which lazy-loads the link item widget
- 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 onSidebarBeforeOutput
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function onSidebarBeforeOutput( $skin, &$sidebar ): void {
// Add the 'In other projects' section
$otherProjectsSidebar = $this->buildOtherProjectsSidebar( $skin );
$sidebar['wikibase-otherprojects'] = $otherProjectsSidebar === null ? [] : $otherProjectsSidebar;
- 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"