wikimedia/mediawiki-extensions-Translate

View on GitHub

Showing 994 of 1,238 total issues

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

    public function execute() {
        $this->contentLanguage = MediaWikiServices::getInstance()->getContentLanguage();

        $threads = (int)$this->getOption( 'threads', 1 );
        $outputDir = $this->getOption( 'output-directory' );
Severity: Minor
Found in src/TtmServer/ExportTtmServerDumpMaintenanceScript.php - About 1 hr to fix

    Method createQueryBuilder has 31 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function createQueryBuilder( IReadableDatabase $database, string $caller ): SelectQueryBuilder {
            global $wgTranslateMessageNamespaces;
    
            $fields = [ 'log_timestamp' ];
    
    
    Severity: Minor
    Found in src/Statistics/ReviewPerLanguageStats.php - About 1 hr to fix

      Method normalize has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function normalize( array $validCounts ): void {
              $this->formOptions->validateIntBounds( 'days', 1, 10000 );
              $this->formOptions->validateIntBounds( 'width', 200, 1000 );
              $this->formOptions->validateIntBounds( 'height', 200, 1000 );
      
      
      Severity: Minor
      Found in src/Statistics/TranslationStatsGraphOptions.php - About 1 hr to fix

        Method onArticleViewHeader has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function onArticleViewHeader( $article, &$outputDone, &$pcache ) {
                if ( !$this->enableIntegration ) {
                    return;
                }
        
        
        Severity: Minor
        Found in src/MessageBundleTranslation/Hooks.php - About 1 hr to fix

          Method levenshtein has 31 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function levenshtein( string $str1, string $str2, int $length1, int $length2 ): int {
                  if ( $length1 === 0 ) {
                      return $length2;
                  }
          
          
          Severity: Minor
          Found in src/Utilities/StringComparators/EditDistanceStringComparator.php - About 1 hr to fix

            Method getLatestRevisionsForTags has 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function getLatestRevisionsForTags( PageIdentity $identity, string ...$tags ): ?array {
                    if ( !$identity->exists() ) {
                        return null;
                    }
            
            
            Severity: Minor
            Found in src/MessageGroupProcessing/RevTagStore.php - About 1 hr to fix

              Method addValidator has 31 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function addValidator( array $validatorConfig ): void {
                      $validatorId = $validatorConfig['id'] ?? null;
                      $className = $validatorConfig['class'] ?? null;
              
                      if ( $validatorId !== null ) {
              Severity: Minor
              Found in src/Validation/ValidationRunner.php - About 1 hr to fix

                Method reloadIgnorePatterns has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public static function reloadIgnorePatterns(): void {
                        $validationExclusionFile = Services::getInstance()->getConfigHelper()->getValidationExclusionFile();
                
                        if ( $validationExclusionFile === false ) {
                            self::$ignorePatterns = [];
                Severity: Minor
                Found in src/Validation/ValidationRunner.php - About 1 hr to fix

                  Function descriptors has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      descriptors: function(chart) {
                          var cache = chart.$plugins || (chart.$plugins = {});
                          if (cache.id === this._cacheId) {
                              return cache.descriptors;
                          }
                  Severity: Minor
                  Found in resources/lib/Chart.js/Chart.js - About 1 hr to fix

                    Function changeSettings has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                            changeSettings: function ( changes ) {
                                // Clear current messages
                                this.clear();
                                this.settings = $.extend( this.settings, changes );
                    
                    
                    Severity: Minor
                    Found in resources/js/ext.translate.messagetable.js - About 1 hr to fix

                      Function showTranslations has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          function showTranslations( translations ) {
                              var $target = $( '.translations' );
                      
                              $target.empty();
                      
                      
                      Severity: Minor
                      Found in resources/js/ext.translate.special.managetranslatorsandbox.js - About 1 hr to fix

                        Function _drawLabels has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            _drawLabels: function() {
                                var me = this;
                                var optionTicks = me.options.ticks;
                        
                                if (!optionTicks.display) {
                        Severity: Minor
                        Found in resources/lib/Chart.js/Chart.js - About 1 hr to fix

                          Method tryMatch has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              protected function tryMatch( $code, $mws, $gtLanguages, $clLanguages ) {
                                  if ( $mws !== '' ) {
                                      $mwExp = true;
                                      $lang = MediaWikiServices::getInstance()->getLanguageFactory()->getLanguage( $code );
                                  } else {
                          Severity: Minor
                          Found in scripts/plural-comparison.php - About 1 hr to fix

                            Function computeLinearBoundary has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            function computeLinearBoundary(source) {
                                var model = source.el._model || {};
                                var scale = source.el._scale || {};
                                var fill = source.fill;
                                var target = null;
                            Severity: Minor
                            Found in resources/lib/Chart.js/Chart.js - About 1 hr to fix

                              Function drawRadiusLine has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              function drawRadiusLine(scale, gridLineOpts, radius, index) {
                                  var ctx = scale.ctx;
                                  var circular = gridLineOpts.circular;
                                  var valueCount = scale.chart.data.labels.length;
                                  var lineColor = valueAtIndexOrDefault$1(gridLineOpts.color, index - 1);
                              Severity: Minor
                              Found in resources/lib/Chart.js/Chart.js - About 1 hr to fix

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

                                    public function execute() {
                                        $groups = MessageGroups::singleton()->getGroups();
                                        $mwInstance = MediaWikiServices::getInstance();
                                        $jobQueueGroup = $mwInstance->getJobQueueGroup();
                                
                                
                                Severity: Minor
                                Found in scripts/refresh-translatable-pages.php - About 1 hr to fix

                                  Method parseUnit has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      public function parseUnit( string $content ): TranslationUnit {
                                          $re = '~<!--T:(.*?)-->~';
                                          $matches = [];
                                          $count = preg_match_all( $re, $content, $matches, PREG_SET_ORDER );
                                  
                                  
                                  Severity: Minor
                                  Found in src/PageTranslation/TranslatablePageParser.php - About 1 hr to fix

                                    Method store has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        public function store( array $array, array $diff ): void {
                                            $updates = [];
                                    
                                            foreach ( [ $diff['add'], $diff['mod'] ] as $changes ) {
                                                foreach ( $changes as $key => $data ) {
                                    Severity: Minor
                                    Found in src/MessageLoading/DatabaseMessageIndex.php - About 1 hr to fix

                                      Method createIndex has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          private function createIndex( bool $rebuild ): void {
                                              $indexSettings = [
                                                  'settings' => [
                                                      'index' => [
                                                          'number_of_shards' => $this->getShardCount(),
                                      Severity: Minor
                                      Found in src/TtmServer/ElasticSearchTtmServer.php - About 1 hr to fix

                                        Method showPage has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            private function showPage(): void {
                                                $out = $this->getOutput();
                                        
                                                $nojs = Html::errorBox(
                                                    $this->msg( 'tux-nojs' )->escaped(),
                                        Severity: Minor
                                        Found in src/TranslatorSandbox/ManageTranslatorSandboxSpecialPage.php - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language