wikimedia/mediawiki-extensions-Translate

View on GitHub

Showing 1,238 of 1,238 total issues

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

    public function execute(): void {
        $days = (int)$this->getOption( 'days' ) ?: 7;
        $top = (int)$this->getOption( 'top' ) ?: 10;
        $bots = $this->hasOption( 'bots' );

Severity: Minor
Found in src/Statistics/LanguageEditStatsMaintenanceScript.php - About 1 hr to fix

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

        public function findMessage( $language, $key, $possibleStates = [], &$modificationType = null ) {
            $allChanges = [];
            $allChanges[self::ADDITION] = $this->getAdditions( $language );
            $allChanges[self::DELETION] = $this->getDeletions( $language );
            $allChanges[self::CHANGE] = $this->getChanges( $language );
    Severity: Minor
    Found in src/MessageSync/MessageSourceChange.php - About 1 hr to fix

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

          public function changeState( MessageGroup $group, string $code, string $newState, User $user ): bool {
              $currentState = $this->getState( $group, $code );
              if ( $currentState === $newState ) {
                  return false;
              }
      Severity: Minor
      Found in src/MessageGroupProcessing/MessageGroupReviewStore.php - About 1 hr to fix

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

            protected function getAllowedParams() {
                return [
                    'count' => [
                        ParamValidator::PARAM_TYPE => $this->dataProvider->getGraphTypes(),
                        ParamValidator::PARAM_REQUIRED => true,
        Severity: Minor
        Found in src/Statistics/QueryTranslationStatsActionApi.php - 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( 'Fuzzy bot command line script.' );
                  $this->addArg(
                      'arg',
          Severity: Minor
          Found in src/Diagnostics/FuzzyTranslationsMaintenanceScript.php - About 1 hr to fix

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

                private function markPageForTranslation(
                    Title $bundleTitle,
                    TranslatablePageSettings $translatablePageSettings,
                    UserIdentity $importUser
                ): void {

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

                  public function execute() {
                      $params = $this->extractRequestParams();
                      $groupId = $params['groupId'];
                      $msgKey = $params['messageKey'];
                      $name = $params['changesetName'] ?? MessageChangeStorage::DEFAULT_NAME;
              Severity: Minor
              Found in src/MessageGroupProcessing/QueryManageMessageGroupsActionApi.php - About 1 hr to fix

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

                    public function readFromVariable( string $data ): array {
                        $reader = new SimpleXMLElement( $data );
                
                        $messages = [];
                        $mangler = $this->group->getMangler();
                Severity: Minor
                Found in src/FileFormatSupport/AndroidXmlFormat.php - About 1 hr to fix

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

                      protected function getTranslationUnitPagesByTitle( PageReference $title, ?string $code = null ): array {
                          $mwServices = MediaWikiServices::getInstance();
                  
                          $dbw = $mwServices->getDBLoadBalancer()->getConnection( DB_PRIMARY );
                          $base = $mwServices->getTitleFormatter()->getPrefixedDBkey( $title );
                  Severity: Minor
                  Found in src/MessageGroupProcessing/TranslatableBundle.php - About 1 hr to fix

                    Method __construct has 9 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                            LanguageFactory $languageFactory,
                            LinkBatchFactory $linkBatchFactory,
                            JobQueueGroup $jobQueueGroup,
                            PermissionManager $permissionManager,
                            TranslatablePageMarker $translatablePageMarker,
                    Severity: Major
                    Found in src/PageTranslation/PageTranslationSpecialPage.php - About 1 hr to fix

                      Method __construct has 9 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                              ApiMain $mainModule,
                              string $moduleName,
                              UserFactory $userFactory,
                              UserNameUtils $userNameUtils,
                              UserOptionsManager $userOptionsManager,
                      Severity: Major
                      Found in src/TranslatorSandbox/TranslatorSandboxActionApi.php - About 1 hr to fix

                        Function updateElement has 28 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 xScale = me.getScaleForId(meta.xAxisID);
                        Severity: Minor
                        Found in resources/lib/Chart.js/Chart.js - About 1 hr to fix

                          Function addInsertables has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  addInsertables: function ( insertables ) {
                                      var count = insertables.length,
                                          $sourceMessage = this.$editor.find( '.sourcemessage' ),
                                          $buttonArea = this.$editor.find( '.tux-editor-insert-buttons' ),
                                          $textarea = this.$editor.find( '.tux-textarea-translation' );
                          Severity: Minor
                          Found in resources/js/ext.translate.editor.helpers.js - About 1 hr to fix

                            Function helper has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                function helper( list, maxRetries ) {
                                    var deferred = $.Deferred();
                            
                                    if ( list.length === 0 ) {
                                        deferred.resolve( [] );
                            Severity: Minor
                            Found in resources/js/jquery.ajaxdispatcher.js - About 1 hr to fix

                              Function initialize has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              mw.translate.MessageRenameDialog.prototype.initialize = function () {
                                  mw.translate.MessageRenameDialog.super.prototype.initialize.call( this );
                              
                                  this.messageSearch = new OO.ui.TextInputWidget( {
                                      placeholder: mw.msg( 'translate-smg-rename-search' )
                              Severity: Minor
                              Found in resources/js/ext.translate.messagerenamedialog.js - About 1 hr to fix

                                Function createNewUnit has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    function createNewUnit( sourceText, targetText ) {
                                        var $newUnit = $( '<div>' ).addClass( 'mw-tpm-sp-unit row' );
                                        var $sourceUnit = $( '<textarea>' ).addClass( 'mw-tpm-sp-unit__source five columns' )
                                            .prop( 'readonly', true ).attr( 'tabindex', '-1' ).val( sourceText );
                                        var $target = $( '<div>' ).addClass( 'five columns' );
                                Severity: Minor
                                Found in resources/js/ext.translate.special.pagemigration.js - About 1 hr to fix

                                  Function updateDescription has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      function updateDescription( group ) {
                                          var
                                              api = new mw.Api(),
                                              $description = $( '.tux-editor-header .description' );
                                  
                                  
                                  Severity: Minor
                                  Found in resources/js/ext.translate.special.translate.js - About 1 hr to fix

                                    Function generateTicks$1 has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    function generateTicks$1(generationOptions, dataRange) {
                                        var ticks = [];
                                    
                                        var tickVal = valueOrDefault$b(generationOptions.min, Math.pow(10, Math.floor(log10(dataRange.min))));
                                    
                                    
                                    Severity: Minor
                                    Found in resources/lib/Chart.js/Chart.js - About 1 hr to fix

                                      Function buildOrUpdateControllers has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          buildOrUpdateControllers: function() {
                                              var me = this;
                                              var newControllers = [];
                                              var datasets = me.data.datasets;
                                              var i, ilen;
                                      Severity: Minor
                                      Found in resources/lib/Chart.js/Chart.js - About 1 hr to fix

                                        Method getServers has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                            private function getServers(
                                                bool $isDryRun,
                                                bool $shouldReindex,
                                                ?string $ttmServerId = null
                                            ): array {
                                        Severity: Minor
                                        Found in scripts/ttmserver-export.php - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language