Showing 1,238 of 1,238 total issues
Function save
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function save(
Title $pageTitle,
RevisionRecord $revisionRecord,
MessageBundleContent $content
): void {
- 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 removeFromCache
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function removeFromCache( Title $title ): void {
$config = MediaWikiServices::getInstance()->getMainConfig();
if ( !$config->get( 'TranslateGroupSynchronizationCache' ) ) {
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 getTalkPages
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function getTalkPages( array $pages ): array {
$lb = $this->linkBatchFactory->newLinkBatch();
$talkPageList = [];
foreach ( $pages as $page ) {
- 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 getLatestRevisionsForTags
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function getLatestRevisionsForTags( PageIdentity $identity, string ...$tags ): ?array {
if ( !$identity->exists() ) {
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 queueUpdates
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private static function queueUpdates( int $flags ): void {
$mwInstance = MediaWikiServices::getInstance();
if ( self::$updates === [] || $mwInstance->getReadOnlyMode()->isReadOnly() ) {
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 getPluralRule
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function getPluralRule( $code ) {
global $wgTranslateDocumentationLanguageCode;
if ( $code === $wgTranslateDocumentationLanguageCode ) {
return 'nplurals=1; plural=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 getTable
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function getTable( array $stats ): string {
$table = $this->table;
$out = '';
// This avoids a database query per translatable page, which would be caused by
- 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 forItemInternal
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private static function forItemInternal(
array &$stats,
MessageGroup $group,
string $languageCode,
int $flags
- 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 isAuthorExcluded
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function isAuthorExcluded( string $groupId, string $languageCode, string $username ): bool {
$hash = "$groupId;$languageCode;$username";
$authorExclusionList = $this->getTranslateAuthorExclusionList();
$excluded = 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 moveMetadata
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function moveMetadata( string $oldGroupId, string $newGroupId ): void {
// Make the changes in aggregate groups metadata, if present in any of them.
$aggregateGroups = MessageGroups::getGroupsByType( AggregateMessageGroup::class );
$this->messageGroupMetadata->preloadGroups( array_keys( $aggregateGroups ), __METHOD__ );
- 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 getLanguagesFromHeader
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function getLanguagesFromHeader( array $csvHeader ): Status {
if ( count( $csvHeader ) < 2 ) {
return Status::newFatal(
'CSV has < 2 columns. Assuming that there are no languages to import'
);
- 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 filterValidations
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function filterValidations(
string $messageKey,
ValidationIssues $issues,
string $targetLanguage
): ValidationIssues {
- 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 writeReal
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function writeReal( MessageCollection $collection ): string {
$messages = [];
$mangler = $this->group->getMangler();
/** @var Message $m */
- 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 pluralFormsCheck
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function pluralFormsCheck(
Message $message, string $code, ValidationIssues $issues
): void {
$translation = $message->translation();
// Are there any plural forms for this language in this message?
- 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 writeReal
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function writeReal( MessageCollection $collection ): string {
$header = $this->doHeader( $collection );
$header .= $this->doAuthors( $collection );
$header .= "\n";
- 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 getIssues
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function getIssues( Message $message, string $targetLanguage ): ValidationIssues {
$issues = new ValidationIssues();
$definition = $message->definition();
$translation = $message->translation();
- 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 getMangler
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function getMangler() {
if ( $this->mangler === null ) {
$class = $this->getFromConf( 'MANGLER', 'class' ) ?? StringMatcher::class;
if ( $class === 'StringMatcher' || $class === StringMatcher::class ) {
- 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 mapCode
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function mapCode( $code ) {
if ( !isset( $this->conf['FILES']['codeMap'] ) ) {
return $code;
}
- 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 writeReal
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function writeReal( MessageCollection $collection ): string {
$template = $this->read( $collection->getLanguage() ) ?: [];
$authors = $this->filterAuthors( $collection->getAuthors(), $collection->getLanguage() );
$messages = [];
- 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 readFromVariable
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function readFromVariable( string $data ): array {
$parts = explode( self::PART_SEPARATOR, $data );
if ( count( $parts ) !== 2 ) {
throw new InvalidArgumentException( 'Wrong number of parts.' );
- 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"