Showing 994 of 1,238 total issues
Function render
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render: function () {
var sourceLangDir = $.uls.data.getDir( this.options.sourcelangcode );
var targetLangAttrib;
if ( this.options.targetlangcode === mw.config.get( 'wgTranslateDocumentationLanguageCode' ) ) {
Function rgb
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
convert.hwb.rgb = function (hwb) {
var h = hwb[0] / 360;
var wh = hwb[1] / 100;
var bl = hwb[2] / 100;
var ratio = wh + bl;
Function longestText
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
helpers$1.longestText = function(ctx, font, arrayOfThings, cache) {
cache = cache || {};
var data = cache.data = cache.data || {};
var gc = cache.garbageCollect = cache.garbageCollect || [];
Method filterChanged
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function filterChanged( array $keys, bool $condition ): array {
$this->loadData( $keys );
$origKeys = [];
if ( !$condition ) {
Method translateTab
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public static function translateTab( Skin $skin, array &$tabs ) {
$title = $skin->getTitle();
$handle = new MessageHandle( $title );
$code = $handle->getCode();
$page = TranslatablePage::isTranslationPage( $title );
Method getOutput
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function getOutput( MessageGroup $group ): array {
$out = [];
$groupId = $group->getId();
$sourceLanguage = $group->getSourceLanguage();
Method update
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function update( MessageHandle $handle, ?string $targetText ): bool {
if ( !$handle->isValid() || $handle->getCode() === '' ) {
return false;
}
Method getTranslationsWithFallback
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function getTranslationsWithFallback(
MessageBundle $messageBundle,
string $languageCode,
bool $skipFallbacks
): array {
Method __construct
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function __construct() {
parent::__construct();
$this->addDescription( 'Backport translations from one branch to another.' );
$this->addOption(
Method removeFromCache
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function removeFromCache( Title $title ): void {
$config = MediaWikiServices::getInstance()->getMainConfig();
if ( !$config->get( 'TranslateGroupSynchronizationCache' ) ) {
return;
Method checkInput
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
private function checkInput(): Status {
$status = Status::newGood();
$msgGroup = MessageGroups::getGroup( $this->groupId );
if ( $msgGroup === null ) {
Function validateTranslation
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
validateTranslation: function () {
var translateEditor = this,
$textarea = translateEditor.$editor.find( '.tux-textarea-translation' );
var api = new mw.Api();
Function updateElement
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
updateElement: function(point, index, reset) {
var me = this;
var meta = me.getMeta();
var custom = point.custom || {};
var dataset = me.getDataset();
Function useULS
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function useULS( trigger ) {
const showButton = document.createElement( 'span' );
showButton.classList.add( 'ext-translate-cc-language-selector__trigger' );
Function initCanvas
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function initCanvas(canvas, config) {
var style = canvas.style;
// NOTE(SB) canvas.getAttribute('width') !== canvas.width: in the first case it
// returns null or '' if no explicit value has been set to the canvas attribute.
Function getSourceUnits
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function getSourceUnits( page ) {
var api = new mw.Api();
return api.get( {
action: 'query',
Function loadMessages
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function loadMessages() {
var $messageTable = $( '.tux-messagelist' ),
messagegroup = '!sandbox';
$( '<div>' )
Function handleTickRangeOptions
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
handleTickRangeOptions: function() {
var me = this;
var tickOpts = me.options.ticks;
var DEFAULT_MIN = 1;
var DEFAULT_MAX = 10;
Method execute
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function execute() {
$target = rtrim( $this->getOption( 'target' ), '/' );
$sourceLanguage = $this->getOption( 'source-language' );
$targetLanguage = $this->getOption( 'target-language' );
Method execute
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function execute() {
global $wgTranslateTranslationServices;
$name = $this->getOption( 'service' );