Showing 994 of 1,238 total issues
Method getPagesToMove
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function getPagesToMove(
Title $source,
Title $target,
bool $moveSubPages,
bool $fetchTranslatableSubpages,
Method sendEmail
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function sendEmail( User $sender, User $target, string $type ): void {
$emergencyContact = $this->options->get( 'EmergencyContact' );
$targetLang = $this->userOptionsManager->getOption( $target, 'language' );
Method addForm
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function addForm(): void {
$formDescriptor = [
'select' => [
'type' => 'select',
'name' => self::GROUPS,
Method getSubpagesPerType
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getSubpagesPerType( TranslatableBundle $bundle, bool $fetchTalkPages ): array {
$classifiedSubPages = $this->getEmptyResultSet();
$classifiedSubPages['translationPages'] = $bundle->getTranslationPages();
$classifiedSubPages['translationUnitPages'] = $bundle->getTranslationUnitPages();
Method getDefinitions
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getDefinitions() {
global $wgTranslateSandboxLimit;
// This will contain the list of messages shown to the user
$list = [];
Function _resolveDataElementOptions
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
_resolveDataElementOptions: function(element, index) {
var me = this;
var custom = element && element.custom;
var cached = me._cachedDataOpts;
if (cached && !custom) {
Method handleRename
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function handleRename( string $target, string $replacement ): ?Title {
$newSourceTitle = null;
$sourceMessageHandle = new MessageHandle( $this->title );
$movableTitles = TranslateReplaceTitle::getTitlesForMove( $sourceMessageHandle, $replacement );
Method execute
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute( $par ): void {
$out = $this->getOutput();
$lang = $this->getLanguage();
$this->progressStatsTable = $this->progressStatsTableFactory->newFromContext( $this->getContext() );
Method isValid
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function isValid( &$reason ): bool {
$group = $this->group;
$pattern = $group->getSourceFilePath( '*' );
$filename = $group->getSourceFilePath( $this->languageCode );
Method importData
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function importData(
array $messagesWithTranslations,
Authority $authority,
string $comment,
?callable $progressReporter = null
Method getIssues
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getIssues( Message $message, string $targetLanguage ): ValidationIssues {
$issues = new ValidationIssues();
$pluralRule = GettextPlural::getPluralRule( $targetLanguage );
// Skip validation for languages for which we do not know the plural rule
Function computeLabelSizes
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
function computeLabelSizes(ctx, tickFonts, ticks, caches) {
var length = ticks.length;
var widths = [];
var heights = [];
var offsets = [];
Method getAllowedParams
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getAllowedParams() {
return [
'title' => [
ParamValidator::PARAM_TYPE => 'string',
],
Function buildTicks
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
buildTicks: function() {
var me = this;
var min = me.min;
var max = me.max;
var options = me.options;
Method onDeleteTranslationUnit
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function onDeleteTranslationUnit(
WikiPage $unit,
User $user,
$reason,
$id,
Method getAllowedParams
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function getAllowedParams(): array {
return [
'group' => [
ParamValidator::PARAM_TYPE => 'string',
ParamValidator::PARAM_REQUIRED => true,
Method readFromVariable
has 44 lines of code (exceeds 25 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;
Function left
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
left: function ( position, data ) {
var within = data.within,
withinOffset = within.offset.left + within.scrollLeft,
outerWidth = within.width,
offsetLeft = within.isWindow ? within.scrollLeft : within.offset.left,
- 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 14 (exceeds 5 allowed). Consider refactoring. Open
public function execute() {
$groups = MessageGroups::singleton()->getGroups();
$mwInstance = MediaWikiServices::getInstance();
$jobQueueGroup = $mwInstance->getJobQueueGroup();
- 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 listPages
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function listPages(): void {
$out = $this->getOutput();
$res = self::loadPagesFromDB();
$allPages = self::buildPageArray( $res );
- 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"