wikimedia/mediawiki-extensions-Translate

View on GitHub

Showing 994 of 1,238 total issues

Function render has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        render: function () {
            var sourceLangDir = $.uls.data.getDir( this.options.sourcelangcode );

            var targetLangAttrib;
            if ( this.options.targetlangcode === mw.config.get( 'wgTranslateDocumentationLanguageCode' ) ) {
Severity: Minor
Found in resources/js/ext.translate.pagemode.js - About 1 hr to fix

    Function rgb has 33 lines of code (exceeds 25 allowed). Consider refactoring.
    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;
    Severity: Minor
    Found in resources/lib/Chart.js/Chart.js - About 1 hr to fix

      Function longestText has 33 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          helpers$1.longestText = function(ctx, font, arrayOfThings, cache) {
              cache = cache || {};
              var data = cache.data = cache.data || {};
              var gc = cache.garbageCollect = cache.garbageCollect || [];
      
      
      Severity: Minor
      Found in resources/lib/Chart.js/Chart.js - About 1 hr to fix

        Method filterChanged has 33 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private function filterChanged( array $keys, bool $condition ): array {
                $this->loadData( $keys );
        
                $origKeys = [];
                if ( !$condition ) {
        Severity: Minor
        Found in src/MessageLoading/MessageCollection.php - About 1 hr to fix

          Method translateTab has 33 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public static function translateTab( Skin $skin, array &$tabs ) {
                  $title = $skin->getTitle();
                  $handle = new MessageHandle( $title );
                  $code = $handle->getCode();
                  $page = TranslatablePage::isTranslationPage( $title );
          Severity: Minor
          Found in src/PageTranslation/Hooks.php - About 1 hr to fix

            Method getOutput has 33 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private function getOutput( MessageGroup $group ): array {
                    $out = [];
            
                    $groupId = $group->getId();
                    $sourceLanguage = $group->getSourceLanguage();
            Severity: Minor
            Found in src/TtmServer/ExportTtmServerDumpMaintenanceScript.php - About 1 hr to fix

              Method update has 33 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function update( MessageHandle $handle, ?string $targetText ): bool {
                      if ( !$handle->isValid() || $handle->getCode() === '' ) {
                          return false;
                      }
              
              
              Severity: Minor
              Found in src/TtmServer/ElasticSearchTtmServer.php - About 1 hr to fix

                Method getTranslationsWithFallback has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    private function getTranslationsWithFallback(
                        MessageBundle $messageBundle,
                        string $languageCode,
                        bool $skipFallbacks
                    ): array {
                Severity: Minor
                Found in src/MessageBundleTranslation/MessageBundleTranslationLoader.php - About 1 hr to fix

                  Method __construct has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function __construct() {
                          parent::__construct();
                          $this->addDescription( 'Backport translations from one branch to another.' );
                  
                          $this->addOption(
                  Severity: Minor
                  Found in src/Synchronization/BackportTranslationsMaintenanceScript.php - About 1 hr to fix

                    Method removeFromCache has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        private function removeFromCache( Title $title ): void {
                            $config = MediaWikiServices::getInstance()->getMainConfig();
                    
                            if ( !$config->get( 'TranslateGroupSynchronizationCache' ) ) {
                                return;
                    Severity: Minor
                    Found in src/Synchronization/UpdateMessageJob.php - About 1 hr to fix

                      Method checkInput has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          private function checkInput(): Status {
                              $status = Status::newGood();
                      
                              $msgGroup = MessageGroups::getGroup( $this->groupId );
                              if ( $msgGroup === null ) {
                      Severity: Minor
                      Found in src/Synchronization/ExportTranslationsSpecialPage.php - About 1 hr to fix

                        Function validateTranslation has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                validateTranslation: function () {
                                    var translateEditor = this,
                                        $textarea = translateEditor.$editor.find( '.tux-textarea-translation' );
                        
                                    var api = new mw.Api();
                        Severity: Minor
                        Found in resources/js/ext.translate.editor.js - About 1 hr to fix

                          Function updateElement has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              updateElement: function(point, index, reset) {
                                  var me = this;
                                  var meta = me.getMeta();
                                  var custom = point.custom || {};
                                  var dataset = me.getDataset();
                          Severity: Minor
                          Found in resources/lib/Chart.js/Chart.js - About 1 hr to fix

                            Function useULS has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                function useULS( trigger ) {
                                    const showButton = document.createElement( 'span' );
                            
                                    showButton.classList.add( 'ext-translate-cc-language-selector__trigger' );
                            
                            
                            Severity: Minor
                            Found in resources/src/ext.translate.cleanchanges/index.js - About 1 hr to fix

                              Function initCanvas has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                              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.
                              Severity: Minor
                              Found in resources/lib/Chart.js/Chart.js - About 1 hr to fix

                                Function getSourceUnits has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    function getSourceUnits( page ) {
                                        var api = new mw.Api();
                                
                                        return api.get( {
                                            action: 'query',
                                Severity: Minor
                                Found in resources/js/ext.translate.special.pagemigration.js - About 1 hr to fix

                                  Function loadMessages has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  function loadMessages() {
                                      var $messageTable = $( '.tux-messagelist' ),
                                          messagegroup = '!sandbox';
                                  
                                      $( '<div>' )
                                  Severity: Minor
                                  Found in resources/src/ext.translate.specialTranslationStash/index.js - About 1 hr to fix

                                    Function handleTickRangeOptions has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        handleTickRangeOptions: function() {
                                            var me = this;
                                            var tickOpts = me.options.ticks;
                                            var DEFAULT_MIN = 1;
                                            var DEFAULT_MAX = 10;
                                    Severity: Minor
                                    Found in resources/lib/Chart.js/Chart.js - About 1 hr to fix

                                      Method execute has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          public function execute() {
                                              $target = rtrim( $this->getOption( 'target' ), '/' );
                                              $sourceLanguage = $this->getOption( 'source-language' );
                                              $targetLanguage = $this->getOption( 'target-language' );
                                      
                                      
                                      Severity: Minor
                                      Found in scripts/export-rename-language.php - About 1 hr to fix

                                        Method execute has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            public function execute() {
                                                global $wgTranslateTranslationServices;
                                        
                                                $name = $this->getOption( 'service' );
                                        
                                        
                                        Severity: Minor
                                        Found in scripts/test-mt.php - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language