wikimedia/mediawiki-extensions-Translate

View on GitHub

Showing 994 of 1,238 total issues

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

    update: function(reset) {
        var me = this;
        var chart = me.chart;
        var chartArea = chart.chartArea;
        var opts = chart.options;
Severity: Major
Found in resources/lib/Chart.js/Chart.js - About 2 hrs to fix

    Function getCaretPosition has 52 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        getCaretPosition: function(tooltipPoint, size, vm) {
            var x1, x2, x3, y1, y2, y3;
            var caretSize = vm.caretSize;
            var cornerRadius = vm.cornerRadius;
            var xAlign = vm.xAlign;
    Severity: Major
    Found in resources/lib/Chart.js/Chart.js - About 2 hrs to fix

      Method translationPageHeader has 52 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private static function translationPageHeader( IContextSource $context, TranslatablePage $page ) {
              global $wgTranslateKeepOutdatedTranslations;
      
              $title = $context->getTitle();
              if ( !$title->exists() ) {
      Severity: Major
      Found in src/PageTranslation/Hooks.php - About 2 hrs to fix

        Method messageSelector has 52 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private function messageSelector(): string {
                $output = Html::openElement( 'div', [ 'class' => 'row tux-messagetable-header hide' ] );
                $output .= Html::openElement( 'div', [ 'class' => 'nine columns' ] );
                $output .= Html::openElement( 'ul', [ 'class' => 'row tux-message-selector' ] );
                $userId = $this->getUser()->getId();
        Severity: Major
        Found in src/TranslatorInterface/TranslateSpecialPage.php - About 2 hrs to fix

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

              public function execute( $par ) {
                  $output = $this->getOutput();
                  $this->setHeaders();
                  $this->checkPermissions();
                  $this->addHelpLink( 'Help:Extension:Translate/Page translation administration' );
          Severity: Major
          Found in src/PageTranslation/MigrateTranslatablePageSpecialPage.php - About 2 hrs to fix

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

                public function execute() {
                    $services = MediaWikiServices::getInstance();
                    $db = $services->getDBLoadBalancer()->getConnection( DB_PRIMARY );
            
                    $dbGroupIds = $db->newSelectQueryBuilder()
            Severity: Major
            Found in src/Statistics/CleanupTranslationProgressStatsMaintenanceScript.php - About 2 hrs to fix

              Method showAggregateGroups has 52 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  private function showAggregateGroups( array $aggregates ): void {
                      $out = $this->getOutput();
                      $out->addModules( 'ext.translate.special.aggregategroups' );
              
                      $nojs = Html::errorBox(
              Severity: Major
              Found in src/MessageGroupProcessing/AggregateGroupsSpecialPage.php - About 2 hrs to fix

                Function getLookupMenuOptionsFromData has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                EntitySelectorWidget.prototype.getLookupMenuOptionsFromData = function ( response ) {
                    var groups = response.groups || [];
                    var messages = response.messages || [];
                    var finalResult = [];
                    var i = 0;
                Severity: Major
                Found in resources/src/ext.translate.entity.selector/index.js - About 2 hrs to fix

                  Method listPages has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function listPages(): void {
                          $out = $this->getOutput();
                  
                          $res = self::loadPagesFromDB();
                          $allPages = self::buildPageArray( $res );
                  Severity: Major
                  Found in src/PageTranslation/PageTranslationSpecialPage.php - About 2 hrs to fix

                    Method setup has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        private function setup( ?string $parameters ): void {
                            $request = $this->getRequest();
                    
                            $defaults = [
                                'language' => $this->getLanguage()->getCode(),
                    Severity: Major
                    Found in src/TranslatorInterface/TranslateSpecialPage.php - About 2 hrs to fix

                      Method getAllowedParams has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          protected function getAllowedParams(): array {
                              $available = $this->getSearchableTtmServers();
                      
                              $filters = $this->getAllowedFilters();
                      
                      
                      Severity: Major
                      Found in src/TtmServer/SearchTranslationsActionApi.php - About 2 hrs to fix

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

                            public function execute( $parameters ) {
                                $this->setHeaders();
                        
                                // Security and validity checks
                                if ( !$this->userCanExecute( $this->getUser() ) ) {
                        Severity: Major
                        Found in src/Synchronization/ImportTranslationsSpecialPage.php - About 2 hrs to fix

                          Method unflattenCLDRPlurals has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function unflattenCLDRPlurals( string $key, string $message ) {
                                  // Quick escape.
                                  if ( !str_contains( $message, '{{PLURAL' ) ) {
                                      return false;
                                  }
                          Severity: Major
                          Found in src/MessageProcessing/ArrayFlattener.php - About 2 hrs to fix

                            File ValidationRunner.php has 251 lines of code (exceeds 250 allowed). Consider refactoring.
                            Open

                            <?php
                            /**
                             * Message validation framework.
                             *
                             * @file
                            Severity: Minor
                            Found in src/Validation/ValidationRunner.php - About 2 hrs to fix

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

                                      listen: function () {
                                          var groupSelector = this;
                              
                                          // Hide the selector panel when clicking outside of it
                                          $( document.documentElement ).on( 'click', this.hide.bind( this ) );
                              Severity: Minor
                              Found in resources/src/ext.translate.groupselector/index.js - About 2 hrs to fix

                                Method run has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    public function run(): bool {
                                        // WARNING: Nothing here must not depend on message index being up to date.
                                        // For performance reasons, message index rebuild is run a separate job after
                                        // everything else is updated.
                                
                                
                                Severity: Minor
                                Found in src/PageTranslation/UpdateTranslatablePageJob.php - About 2 hrs to fix

                                  Method fullTable has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      public function fullTable(): string {
                                          $modules = [];
                                          Services::getInstance()->getHookRunner()->onTranslateBeforeAddModules( $modules );
                                          $this->getOutput()->addModules( $modules );
                                  
                                  
                                  Severity: Minor
                                  Found in src/TranslatorInterface/MessageTable.php - About 2 hrs to fix

                                    Method factory has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        public static function factory( string $serviceName, array $config ): ?TranslationWebService {
                                            $handlers = [
                                                'microsoft' => [
                                                    'class' => MicrosoftWebService::class,
                                                    'deps' => [ 'HttpRequestFactory' ]
                                    Severity: Minor
                                    Found in src/WebService/TranslationWebService.php - About 2 hrs to fix

                                      Method makeList has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          private function makeList(): string {
                                              $items = [];
                                              $requests = [];
                                              $users = $this->translateSandbox->getUsers();
                                      
                                      
                                      Severity: Minor
                                      Found in src/TranslatorSandbox/ManageTranslatorSandboxSpecialPage.php - About 2 hrs to fix

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

                                            public function execute() {
                                                $mwServices = MediaWikiServices::getInstance();
                                                $config = $mwServices->getMainConfig();
                                        
                                                if ( !$config->get( 'TranslateGroupSynchronizationCache' ) ) {
                                        Severity: Minor
                                        Found in src/Synchronization/CompleteExternalTranslationMaintenanceScript.php - About 2 hrs to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language