Showing 1,238 of 1,238 total issues
Method import
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function import(
string $importFilePath,
string $interwikiPrefix,
bool $assignKnownUsers,
UserIdentity $user,
Method execute
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute() {
$user = $this->getUser();
$requestParams = $this->extractRequestParams();
$group = MessageGroups::getGroup( $requestParams['group'] );
Function languages
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public static function languages( $data, $params, $parser ) {
global $wgPageTranslationLanguageList;
if ( $wgPageTranslationLanguageList === 'sidebar-only' ) {
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 execute
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function execute(): void {
$params = $this->extractRequestParams();
$title = Title::newFromText( $params['title'] );
if ( !$title ) {
- 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 getLanguageExportActions
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
private function getLanguageExportActions(
string $groupId,
array $requestedLanguages,
array $alwaysExportLanguages,
int $exportThreshold = 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 processGroups
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
protected function processGroups( array $groups ): array {
$fixedGroups = [];
foreach ( $groups as $g ) {
$name = $g['name'];
$sanitizedName = preg_replace( '/\s+/', '', strtolower( $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 getTranslationsWithFallback
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
private function getTranslationsWithFallback(
MessageBundle $messageBundle,
string $languageCode,
bool $skipFallbacks
): array {
- 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 normalize
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function normalize( array $validCounts ): void {
$this->formOptions->validateIntBounds( 'days', 1, 10000 );
$this->formOptions->validateIntBounds( 'width', 200, 1000 );
$this->formOptions->validateIntBounds( 'height', 200, 1000 );
- 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 doExport
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
private function doExport(): Status {
$out = $this->getOutput();
$group = MessageGroups::getGroup( $this->groupId );
$collection = $this->setupCollection( $group );
- 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 getMessages
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function getMessages(): array {
if ( $this->messages !== null ) {
return $this->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 isTranslatableMessage
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public static function isTranslatableMessage( MessageHandle $handle, string $targetLanguage ): bool {
static $cache = [];
if ( !$handle->isValid() ) {
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 execute
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
public function execute() {
$csvFilePath = $this->getArg( 0 );
$username = $this->getOption( 'user' );
$summary = $this->getOption( 'summary' );
- 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 12 (exceeds 5 allowed). Consider refactoring. Open
public function readFromVariable( string $data ): array {
$reader = new SimpleXMLElement( $data );
$messages = [];
$mangler = $this->group->getMangler();
- 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 fixMessageParams
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
private function fixMessageParams( IContextSource $context, array $params ): array {
$out = [];
$lang = $context->getLanguage();
foreach ( $params as $param ) {
- 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 init
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
LanguageFilter.prototype.init = function () {
var languageFilter = this;
var $clearButton = $( '<button>' )
.addClass( 'clear-language-selector hide' )
Function alignHeaders
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
function alignHeaders( units, translationUnits ) {
// The content does not have information about the page title. Add an empty string
// at the beginning of the translationUnits array to match the length of units and
// translationUnits.
if ( units.length && units[ 0 ].identifier === 'Page_display_title' ) {
Function getMaxBorderWidth
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
getMaxBorderWidth: function(arcs) {
var me = this;
var max = 0;
var chart = me.chart;
var i, ilen, meta, arc, controller, options, borderWidth, hoverWidth;
Method getPageList
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getPageList( array $pages, string $type ): string {
$items = [];
$tagsTextCache = [];
$tagDiscouraged = $this->msg( 'tpt-tag-discouraged' )->escaped();
Method deleteAsynchronously
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function deleteAsynchronously(
Title $title,
bool $isTranslation,
UserIdentity $user,
array $subpageList,
Method requeueError
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function requeueError( string $serviceName, Exception $e ): void {
$this->logger->warning(
'Exception thrown while running {command} on ' .
'service {service}: {errorMessage}',
[