Showing 1,238 of 1,238 total issues
Function showTitles
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function showTitles( array $messageGroupsIds ): string {
if ( count( $messageGroupsIds ) >= 100 ) {
return $this->msg( 'tpt-manage-message-group-subscriptions-too-many' )->parse();
}
- 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
Avoid deeply nested control flow statements. Open
if (isNaN(value.min) || isNaN(value.max) || meta.data[i].hidden || value.min < 0 || value.max < 0) {
continue;
}
Function handlePriorityLanguages
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function handlePriorityLanguages(
TranslatablePage $page,
TranslatablePageSettings $pageSettings,
UserIdentity $user
): 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
Method deleteAsynchronously
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Title $title,
bool $isTranslation,
UserIdentity $user,
array $subpageList,
bool $deleteSubpages,
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
ApiMain $main,
string $moduleName,
RevisionLookup $revisionLookup,
TitleFormatter $titleFormatter,
ILoadBalancer $loadBalancer,
Function getPages
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function getPages(): array {
$namespace = $this->namespace;
if ( isset( $this->pages ) ) {
return $this->pages;
}
- 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 addTranstagAfterSave
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
WikiPage $wikiPage,
UserIdentity $userIdentity,
string $summary,
int $flags,
RevisionRecord $revisionRecord,
Method getPagesToMove
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Title $source,
Title $target,
bool $moveSubPages,
bool $fetchTranslatableSubpages,
bool $moveTalkPages,
Function move
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function move(
TranslatableBundle $sourceBundle,
User $performer,
array $pagesToMove,
array $pagesToRedirect,
- 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 disallowLangTranslations
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public static function disallowLangTranslations(
Title $title,
User $user,
string $action,
&$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
Method onDeleteTranslationUnit
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
WikiPage $unit,
User $user,
$reason,
$id,
$content,
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
ObjectFactory $objectFactory,
PermissionManager $permissionManager,
TranslatableBundleMover $bundleMover,
TranslatableBundleFactory $bundleFactory,
FormatterFactory $formatterFactory,
Function parseUnit
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function parseUnit( string $content ): TranslationUnit {
$re = '~<!--T:(.*?)-->~';
$matches = [];
$count = preg_match_all( $re, $content, $matches, PREG_SET_ORDER );
- 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 onSaveComplete
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
WikiPage $wikiPage,
UserIdentity $userIdentity,
string $summary,
int $flags,
RevisionRecord $revisionRecord,
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
ApiQuery $query,
string $moduleName,
ConfigHelper $configHelper,
LanguageNameUtils $languageNameUtils,
ILoadBalancer $loadBalancer,
Function getArrayDiff
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function getArrayDiff( array $old, array $new ): array {
$values = [];
$record = static function ( $groups ) use ( &$values ) {
foreach ( $groups as $group ) {
$values[$group] = true;
- 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 getTranslationRestrictions
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private static function getTranslationRestrictions( MessageHandle $handle, $groupId ) {
global $wgTranslateDocumentationLanguageCode;
// Allow adding message documentation even when translation is restricted
if ( $handle->getCode() === $wgTranslateDocumentationLanguageCode ) {
- 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 move
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
TranslatableBundle $sourceBundle,
User $performer,
array $pagesToMove,
array $pagesToRedirect,
string $reason,
Function getDocuments
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function getDocuments(): array {
$documents = [];
$offset = $this->params['offset'];
$limit = $this->params['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"
Further reading
Method handleModificationsSubmit
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
MessageGroup $group,
MessageSourceChange $sourceChanges,
WebRequest $req,
string $language,
array &$postponed,