wikimedia/mediawiki-extensions-Translate

View on GitHub

Showing 994 of 1,238 total issues

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

    private function processQueryResults( IResultWrapper $res, string $text, string $targetLanguage ): array {
        $timeLimit = microtime( true ) + 5;

        $lenA = mb_strlen( $text );
        $results = [];
Severity: Minor
Found in src/TtmServer/DatabaseTtmServer.php - About 1 hr to fix

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

        public function getDocuments(): array {
            $documents = [];
            $offset = $this->params['offset'];
            $limit = $this->params['limit'];
    
    
    Severity: Minor
    Found in src/TtmServer/CrossLanguageTranslationSearchQuery.php - About 1 hr to fix

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

          private function getErrorMessageHtml(
              string $groupId,
              MessageUpdateParameter $message,
              Language $language,
              string $wrapperClass
      Severity: Minor
      Found in src/Synchronization/DisplayGroupSynchronizationInfo.php - About 1 hr to fix

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

            private function makeRow(
                StatsTable $table,
                string $languageCode,
                array $stats,
                MessageGroup $group,
        Severity: Minor
        Found in src/Statistics/MessageGroupStatsTable.php - About 1 hr to fix

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

              public function hasOnly( $language, $type ) {
                  $deletions = $this->getDeletions( $language );
                  $additions = $this->getAdditions( $language );
                  $renames = $this->getRenames( $language );
                  $changes = $this->getChanges( $language );
          Severity: Minor
          Found in src/MessageSync/MessageSourceChange.php - About 1 hr to fix

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

                public function execute(): void {
                    if ( !$this->groupSubscription->isEnabled() ) {
                        $this->dieWithError( 'apierror-translate-messagegroupsubscription-disabled' );
                    }
            
            
            Severity: Minor
            Found in src/MessageGroupProcessing/MessageGroupSubscriptionActionApi.php - About 1 hr to fix

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

                  protected function getPossibleRenames(
                      MessageSourceChange $sourceChanges,
                      int $groupNamespace,
                      string $msgKey,
                      string $languageCode
              Severity: Minor
              Found in src/MessageGroupProcessing/QueryManageMessageGroupsActionApi.php - About 1 hr to fix

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

                    public function write( MessageCollection $collection ): void {
                        $writePath = $this->writePath;
                
                        if ( $writePath === null ) {
                            throw new LogicException( 'Write path is not set. Set write path before calling write()' );
                Severity: Minor
                Found in src/FileFormatSupport/SimpleFormat.php - About 1 hr to fix

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

                      public function getIssues( Message $message, string $targetLanguage ): ValidationIssues {
                          $issues = new ValidationIssues();
                  
                          $definition = $message->definition();
                          $translation = $message->translation();
                  Severity: Minor
                  Found in src/Validation/Validators/MediaWikiLinkValidator.php - About 1 hr to fix

                    Function update has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        update: function(reset) {
                            var me = this;
                            var meta = me.getMeta();
                            var line = meta.dataset;
                            var points = meta.data || [];
                    Severity: Minor
                    Found in resources/lib/Chart.js/Chart.js - About 1 hr to fix

                      Function getAxesLabelsAndData has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                              function getAxesLabelsAndData( jsonGraphData ) {
                                  var labels = [], graphData = [],
                                      labelIndex = 0,
                                      maxValue = 0, minValue = 0;
                      
                      
                      Severity: Minor
                      Found in resources/js/ext.translate.translationstats.graphbuilder.js - About 1 hr to fix

                        Function listen has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                listen: function () {
                                    var messageTable = this,
                                        $filterInput = this.$container.parent().find( '.tux-message-filter-box' );
                        
                                    // Vector has transitions of 250ms which affect layout. Let those finish.
                        Severity: Minor
                        Found in resources/js/ext.translate.messagetable.js - About 1 hr to fix

                          Function init has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  init: function () {
                                      var that = this;
                          
                                      this.render();
                          
                          
                          Severity: Minor
                          Found in resources/js/ext.translate.proofread.js - About 1 hr to fix

                            Function showAssistantLanguages has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                    showAssistantLanguages: function ( translations ) {
                                        if ( translations.error ) {
                                            return;
                                        }
                            
                            
                            Severity: Minor
                            Found in resources/js/ext.translate.editor.helpers.js - About 1 hr to fix

                              Function listenArrayEvents has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              function listenArrayEvents(array, listener) {
                                  if (array._chartjs) {
                                      array._chartjs.listeners.push(listener);
                                      return;
                                  }
                              Severity: Minor
                              Found in resources/lib/Chart.js/Chart.js - About 1 hr to fix

                                Function getFuzzyTimestamp has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    function getFuzzyTimestamp( pageTitle ) {
                                        var api = new mw.Api();
                                
                                        // This api call returns the timestamp of FuzzyBot's edit
                                        return api.get( {
                                Severity: Minor
                                Found in resources/js/ext.translate.special.pagemigration.js - About 1 hr to fix

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

                                      public function __construct() {
                                          parent::__construct();
                                          $this->addDescription( 'Script to bootstrap TtmServer.' );
                                          $this->addOption(
                                              'threads',
                                  Severity: Minor
                                  Found in scripts/ttmserver-export.php - About 1 hr to fix

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

                                        public function execute() {
                                            $mwLanguages = $this->loadMediaWiki();
                                            $gtLanguages = $this->loadGettext();
                                            $clLanguages = $this->loadCLDR();
                                    
                                    
                                    Severity: Minor
                                    Found in scripts/plural-comparison.php - About 1 hr to fix

                                      Function calculateTickRotation has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          calculateTickRotation: function() {
                                              var me = this;
                                              var options = me.options;
                                              var tickOpts = options.ticks;
                                              var numTicks = me.getTicks().length;
                                      Severity: Minor
                                      Found in resources/lib/Chart.js/Chart.js - About 1 hr to fix

                                        Method needsFuzzy has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            public function needsFuzzy( string $text ): bool {
                                                // Docs are exempt for checks
                                                if ( $this->isDoc() ) {
                                                    return false;
                                                }
                                        Severity: Minor
                                        Found in src/MessageLoading/MessageHandle.php - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language