Showing 1,238 of 1,238 total issues
Method onTitleQuickPermissions
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function onTitleQuickPermissions( $title, $user, $action, &$errors, $doExpensiveQueries, $short ) {
Method formatChange
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
MessageGroup $group,
MessageSourceChange $changes,
string $language,
string $type,
array $params,
Function validate
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function validate( array $config ): void {
$schema = $this->baseSchema;
foreach ( $config as $key => $section ) {
$extra = [];
- 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 getData
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function getData(): array {
$text = $this->dataProvider->getDefinition();
if ( trim( $text ) === '' ) {
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 getGroupErrorInfo
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function getGroupErrorInfo( string $groupId ): GroupSynchronizationResponse {
$groupMessageErrorTag = $this->getGroupMessageErrorTag( $groupId );
$groupMessageEntries = $this->cache->getByTag( $groupMessageErrorTag );
$groupErrorKey = $this->getGroupErrorKey( $groupId );
- 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 formatRename
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
MessageGroup $group,
array $addedMsg,
array $deletedMsg,
string $language,
bool $isEqual,
Method getRenameJobParams
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
array $currentMsg,
MessageSourceChange $sourceChanges,
string $languageCode,
int $groupNamespace,
string $selectedVal,
Method onEditFilterMergedContent
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
IContextSource $context,
Content $content,
Status $status,
$summary,
User $user,
Method addNonSourceRenames
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
MessageSourceChange $changes,
string $key,
string $renameKey,
string $sourceContent,
string $wikiContent,
Function onPageSaveComplete
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function onPageSaveComplete(
$wikiPage,
$user,
$summary,
$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
Method newRenameJob
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Title $target,
string $targetStr,
string $replacement,
$fuzzy,
string $content,
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
LoggerInterface $logger,
MessageBundleStore $messageBundleStore,
LinkRenderer $linkRenderer,
TitleFactory $titleFactory,
JobQueueGroup $jobQueueGroup,
Method onPageSaveComplete
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
$wikiPage,
$user,
$summary,
$flags,
$revisionRecord,
Function registerHookHandlers
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private static function registerHookHandlers( array $hooks ): void {
if ( defined( 'MW_PHPUNIT_TEST' ) && MediaWikiServices::hasInstance() ) {
// When called from a test case's setUp() method,
// we can use HookContainer, but we cannot use SettingsBuilder.
$hookContainer = MediaWikiServices::getInstance()->getHookContainer();
- 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 8 (exceeds 5 allowed). Consider refactoring. Open
public function execute( $par ): void {
$graphOpts = new TranslationStatsGraphOptions();
$graphOpts->bindArray( $this->getRequest()->getValues() );
$pars = explode( ';', (string)$par );
- 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 indexOf
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function indexOf( stdClass $row ): ?array {
if ( $this->opts->getValue( 'count' ) === 'reviewers' ) {
$date = $this->formatTimestamp( $row->log_timestamp );
if ( isset( $this->seenUsers[$date][$row->log_actor] ) ) {
- 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 findAndMarkSourceRenames
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function findAndMarkSourceRenames( MessageSourceChange $changes, string $sourceLanguage ): void {
// Now check for renames. To identify renames we need to compare
// the contents of the added messages with the deleted ones and
// identify messages that match.
$deletions = $changes->getDeletions( $sourceLanguage );
- 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 __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
string $groupId,
string $name,
int $pageId,
int $revisionId,
?string $description,
Function execute
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function execute() {
$this->checkUserRightsAny( self::RIGHT );
$block = $this->getUser()->getBlock();
if ( $block && $block->isSitewide() ) {
$this->dieBlocked( $block );
- 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 syncStatus
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function syncStatus( array $bundlesWithDifference, string $differenceType ): void {
if ( !$bundlesWithDifference ) {
$this->output( "No \"$differenceType\" bundle statuses\n" );
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"