wikimedia/mediawiki-extensions-Translate

View on GitHub

Showing 1,238 of 1,238 total issues

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

                            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
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language