Showing 1,238 of 1,238 total issues
Method showAggregateGroup
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function showAggregateGroup( AggregateMessageGroup $group ): string {
$id = $group->getId();
$label = $group->getLabel();
$desc = $group->getDescription( $this->getContext() );
$sourceLanguage = $this->messageGroupMetadata->get( $id, 'sourcelanguagecode' );
File MessageIndex.php
has 301 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
declare( strict_types = 1 );
namespace MediaWiki\Extension\Translate\MessageLoading;
Function load
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
load: function ( limit ) {
var self = this,
offset = this.$loader.data( 'offset' ),
pageSize = limit || this.$loader.data( 'pagesize' );
Method execute
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute() {
$this->checkUserRightsAny( 'pagetranslation' );
$params = $this->extractRequestParams();
$title = $this->getTitleFromTitleOrPageId( $params );
Method __construct
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct() {
parent::__construct();
$this->addDescription( 'Export translations to files.' );
$this->addOption(
File ExternalMessageSourceStateComparator.php
has 300 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
declare( strict_types = 1 );
namespace MediaWiki\Extension\Translate\Synchronization;
HookHandler
has 27 functions (exceeds 20 allowed). Consider refactoring. Open
class HookHandler implements
ChangeTagsListActiveHook,
ListDefinedTagsHook,
ParserFirstCallInitHook,
RevisionRecordInsertedHook,
MessageGroupStats
has 27 functions (exceeds 20 allowed). Consider refactoring. Open
class MessageGroupStats {
/** Name of the database table */
private const TABLE = 'translate_groupstats';
/** Cache key for storage of all language stats */
private const LANGUAGE_STATS_KEY = 'translate-all-language-stats';
Method execute
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function execute() {
$dbr = $this->getDB( DB_REPLICA );
$users = $dbr->newSelectQueryBuilder()
->select( [
Function determineDataLimits
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
determineDataLimits: function() {
var me = this;
var opts = me.options;
var chart = me.chart;
var datasets = chart.data.datasets;
Method addMessageUpdateChanges
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function addMessageUpdateChanges(
FileBasedMessageGroup $group,
string $language,
MessageSourceChange $changes,
int $reason,
Function execute
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
public function execute() {
$dbr = $this->getDB( DB_REPLICA );
$users = $dbr->newSelectQueryBuilder()
->select( [
- 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 replaceSubtitle
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
public static function replaceSubtitle( &$subpages, ?Skin $skin, OutputPage $out ) {
$linker = MediaWikiServices::getInstance()->getLinkRenderer();
$isTranslationPage = TranslatablePage::isTranslationPage( $out->getTitle() );
if ( !$isTranslationPage
- 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 processSubmit
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
protected function processSubmit(): void {
$req = $this->getRequest();
$out = $this->getOutput();
$errorGroups = [];
- 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 setupTranslate
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
public static function setupTranslate(): void {
global $wgTranslateYamlLibrary, $wgLogTypes;
$hooks = [];
/*
- 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 getParentGroups
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
public static function getParentGroups( MessageGroup $targetGroup ): array {
$ids = self::getSharedGroups( $targetGroup );
if ( $ids === [] ) {
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 getTranslatableLanguages
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
public function getTranslatableLanguages() {
$groupConfiguration = $this->getConfiguration();
if ( !isset( $groupConfiguration['LANGUAGES'] ) ) {
// No LANGUAGES section in the configuration.
return null;
- 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 showTranslationSettings
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function showTranslationSettings( Title $target, ?ErrorPageError $block ): void {
$out = $this->getOutput();
$out->setPageTitle( $this->msg( 'tpt-translation-settings-page-title' )->text() );
$currentState = $this->translatablePageStateStore->get( $target );
Function update
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
update: function(changed) {
var me = this;
var opts = me._options;
// Need to regenerate the model because its faster than using extend and it is necessary due to the optimization in Chart.Element.transition
Function render
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
render: function () {
// List of all reviewers
var reviewers = this.message.properties.reviewers || [];
// The id of the current user, converted to string as the are in reviewers
var userId = String( mw.config.get( 'wgUserId' ) );