Showing 1,238 of 1,238 total issues
Function run
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function run(): bool {
// WARNING: Nothing here must not depend on message index being up to date.
// For performance reasons, message index rebuild is run a separate job after
// everything else is updated.
- 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 getInternalKey
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function getInternalKey(): string {
$mwServices = MediaWikiServices::getInstance();
$nsInfo = $mwServices->getNamespaceInfo();
$contentLanguage = $mwServices->getContentLanguage();
- 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 preventDirectEditing
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function preventDirectEditing( Title $title, User $user, $action, &$result ) {
if ( self::$allowTargetEdit ) {
return 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 deleteAsynchronously
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function deleteAsynchronously(
Title $title,
bool $isTranslation,
UserIdentity $user,
array $subpageList,
- 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 renderTagPage
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function renderTagPage( $wikitextParser, &$text, $state ): void {
if ( $text === null ) {
// SMW is unhelpfully sending null text if the source contains section tags. Do not explode.
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 translationPageHeader
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private static function translationPageHeader( IContextSource $context, TranslatablePage $page ) {
global $wgTranslateKeepOutdatedTranslations;
$title = $context->getTitle();
if ( !$title->exists() ) {
- 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 onSpecialRecentChangesPanel
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function onSpecialRecentChangesPanel( &$extraOpts, $opts ) {
global $wgLang, $wgRequest;
if ( !$this->config->get( 'TranslateRecentChangesLanguageFilter' ) ) {
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 getFallbacks
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function getFallbacks( string $code ): array {
global $wgTranslateLanguageFallbacks;
$mwServices = MediaWikiServices::getInstance();
// User preference has the final say
- 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 update
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function update( MessageHandle $handle, ?string $targetText ): bool {
if ( !$handle->isValid() || $handle->getCode() === '' ) {
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 getSupportUrl
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function getSupportUrl( MessageHandle $handle ): string {
$title = $handle->getTitle();
$config = self::getConfig( $handle );
$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 getData
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function getData( IReadableDatabase $db ): array {
$autoload = $groups = $value = [];
$parser = $this->messageGroupConfigurationParser;
foreach ( $this->groupFiles as $configFile ) {
$yaml = file_get_contents( $configFile );
- 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 formatRename
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function formatRename(
MessageGroup $group,
array $addedMsg,
array $deletedMsg,
string $language,
- 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 searchStaticMessageGroups
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function searchStaticMessageGroups( string $query, int $maxResults, array $types = [] ): array {
$cache = $this->cache;
// None of the static groups currently use language-dependent labels. This
// may need revisiting later and splitting the cache by language.
$key = $cache->makeKey( 'Translate', 'EntitySearch', 'static-groups', '-v2' );
- 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 getLanguages
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function getLanguages( array $facet ): array {
$output = [];
$nonDefaults = $this->opts->getChangedValues();
$selected = $this->opts->getValue( 'language' );
- 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 startSync
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function startSync( array $modificationJobs, array $renameJobs ): void {
// We are adding an empty array for groups that have no jobs. This is mainly done to
// avoid adding unnecessary checks. Remove those using array_filter
$modificationGroupIds = array_keys( array_filter( $modificationJobs ) );
$renameGroupIds = array_keys( array_filter( $renameJobs ) );
- 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 create
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function create( string $name ): TtmServer {
if ( !$this->has( $name ) ) {
throw new ServiceCreationFailure( "No configuration for name '$name'" );
}
- 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 tabify
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public static function tabify( Skin $skin, array &$tabs ): void {
$title = $skin->getTitle();
if ( !$title->isSpecialPage() ) {
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 makeUserList
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function makeUserList( array $userStats ): void {
$day = 60 * 60 * 24;
// Scale of the activity colors, anything
// longer than this is just inactive
- 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 matches
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function matches( string $key ): bool {
if ( in_array( $key, $this->aExact ) ) {
return 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 canImportGroup
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function canImportGroup( MessageGroup $group, bool $skipGroupSyncCache ): Status {
$groupId = $group->getId();
if ( !$group instanceof FileBasedMessageGroup ) {
$error = "Group $groupId expected to be FileBasedMessageGroup, got " . get_class( $group ) . " instead.";
return Status::newFatal( new RawMessage( $error ) );
- 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"