Showing 994 of 1,238 total issues
Function getPageMoveCollection
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
public function getPageMoveCollection(
Title $source,
?Title $target,
User $user,
string $reason,
- 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 27 (exceeds 5 allowed). Consider refactoring. Open
public function readFromVariable( string $data ): array {
$data = TextContent::normalizeLineEndings( $data );
$lines = array_map( 'ltrim', explode( "\n", $data ) );
$authors = $messages = [];
$lineContinuation = 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 readFromVariable
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
public function readFromVariable( string $data ): array {
$lines = explode( "\n", $data );
$authors = $messages = [];
$linecontinuation = 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
Method onLoadExtensionSchemaUpdates
has 97 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function onLoadExtensionSchemaUpdates( $updater ) {
$dir = dirname( __DIR__, 1 ) . '/sql';
$dbType = $updater->getDB()->getType();
if ( $dbType === 'mysql' || $dbType === 'sqlite' ) {
File ext.translate.special.searchtranslations.js
has 327 lines of code (exceeds 250 allowed). Consider refactoring. Open
( function () {
'use strict';
var resultGroups;
Function drawPoint
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
drawPoint: function(ctx, style, radius, x, y, rotation) {
var type, xOffset, yOffset, size, cornerRadius;
var rad = (rotation || 0) * RAD_PER_DEG;
if (style && typeof style === 'object') {
Method handleFuzzy
has 94 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function handleFuzzy( Title $title, bool $invalidate, PageUpdater $updater, int $baseTranver ): void {
global $wgTranslateDocumentationLanguageCode;
$editResult = $updater->getEditResult();
if ( !$invalidate && !$editResult->isExactRevert() ) {
return;
Function execute
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
public function execute() {
$dryRun = $this->hasOption( 'dry-run' );
$ttmServerId = $this->getOption( 'ttmserver' );
$shouldReindex = $this->getOption( 'reindex', 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 showPage
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
private function showPage( TranslatablePageMarkOperation $operation ): void {
$page = $operation->getPage();
$out = $this->getOutput();
$out->addWikiMsg( 'tpt-showpage-intro' );
- 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 formatChange
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
protected function formatChange(
MessageGroup $group,
MessageSourceChange $changes,
string $language,
string $type,
- 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 successFunction
has 93 lines of code (exceeds 25 allowed). Consider refactoring. Open
var successFunction = function ( data ) {
var aggregateGroupId = data.aggregategroups.aggregategroupId;
var subGroupId = 'tp-subgroup-' + aggregateGroupId;
var $removeSpan = $( '<span>' ).attr( 'id', aggregateGroupId )
File TranslatableBundleMover.php
has 321 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
declare( strict_types = 1 );
namespace MediaWiki\Extension\Translate\PageTranslation;
Method execute
has 92 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute() {
$config = $this->getConfig();
$logger = LoggerFactory::getInstance( 'Translate.GroupSynchronization' );
$groupPattern = $this->getOption( 'group' ) ?? '';
$logger->info(
MessageGroups
has 30 functions (exceeds 20 allowed). Consider refactoring. Open
class MessageGroups {
/** @var MessageGroup[]|null Map of (group ID => MessageGroup) */
private $groups;
/** @var MessageGroupLoader[]|null */
private $groupLoaders;
Method showTranslations
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function showTranslations( Title $title ): void {
$handle = new MessageHandle( $title );
$namespace = $title->getNamespace();
$message = $handle->getKey();
Function import
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
public function import( array $changeData, string $name, int $importStrategy ): array {
$processed = [];
$skipped = [];
$jobs = [];
- 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 processSubmit
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function processSubmit(): void {
$req = $this->getRequest();
$out = $this->getOutput();
$errorGroups = [];
Function _computeGridLineItems
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
_computeGridLineItems: function(chartArea) {
var me = this;
var chart = me.chart;
var options = me.options;
var gridLines = options.gridLines;
File ext.translate.special.managegroups.js
has 313 lines of code (exceeds 250 allowed). Consider refactoring. Open
( function () {
var RenameDropdown,
GroupSynchronization;
$( function () {
File ttmserver-export.php
has 313 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* Script to bootstrap TtmServer translation memory
*
* @author Niklas Laxström