wikimedia/mediawiki-extensions-Translate

View on GitHub

Showing 994 of 1,238 total issues

Function roundedRect has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    roundedRect: function(ctx, x, y, width, height, radius) {
        if (radius) {
            var r = Math.min(radius, height / 2, width / 2);
            var left = x + r;
            var top = y + r;
Severity: Minor
Found in resources/lib/Chart.js/Chart.js - About 1 hr to fix

    Function onShowTranslationMemorySources has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            onShowTranslationMemorySources: function ( e, suggestion ) {
                e.stopPropagation();
    
                if ( suggestion.$sourcesElement ) {
                    suggestion.$sourcesElement.toggleClass( 'hide' );
    Severity: Minor
    Found in resources/js/ext.translate.editor.helpers.js - About 1 hr to fix

      Function eventHandler has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          eventHandler: function(e) {
              var me = this;
              var tooltip = me.tooltip;
      
              if (core_plugins.notify(me, 'beforeEvent', [e]) === false) {
      Severity: Minor
      Found in resources/lib/Chart.js/Chart.js - About 1 hr to fix

        Method showTitles has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private function showTitles( array $messageGroupsIds ): string {
                if ( count( $messageGroupsIds ) >= 100 ) {
                    return $this->msg( 'tpt-manage-message-group-subscriptions-too-many' )->parse();
                }
        
        
        Severity: Minor
        Found in src/PageTranslation/ManageMessageGroupSubscriptionsSpecialPage.php - About 1 hr to fix

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

              public function execute() {
                  $dbw = $this->getDB( DB_PRIMARY );
          
                  if ( !$dbw->tableExists( 'revtag', __METHOD__ ) ) {
                      $this->fatalError( "Table revtag doesn't exist. Translate extension is not installed?" );
          Severity: Minor
          Found in scripts/migrate-schema2.php - About 1 hr to fix

            Method translatablePageHeader has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public static function translatablePageHeader( $article, &$outputDone, &$pcache ) {
                    if ( $article->getOldID() ) {
                        return;
                    }
            
            
            Severity: Minor
            Found in src/PageTranslation/Hooks.php - About 1 hr to fix

              Method isValid has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function isValid(): bool {
                      static $jobHasBeenScheduled = false;
              
                      if ( !$this->isMessageNamespace() ) {
                          return false;
              Severity: Minor
              Found in src/MessageLoading/MessageHandle.php - About 1 hr to fix

                Method getNewTitle has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function getNewTitle( Title $title ): Title {
                        $instructions = $this->map[$title->getNamespace()] ?? null;
                        if ( $instructions === null ) {
                            throw new InvalidPageTitleRename(
                                'Trying to move a page which is not part of the translatable page', self::UNKNOWN_PAGE
                Severity: Minor
                Found in src/PageTranslation/PageTitleRenamer.php - About 1 hr to fix

                  Method handleModificationsSubmit has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      private function handleModificationsSubmit(
                          MessageGroup $group,
                          MessageSourceChange $sourceChanges,
                          WebRequest $req,
                          string $language,
                  Severity: Minor
                  Found in src/Synchronization/ManageGroupsSpecialPage.php - About 1 hr to fix

                    Method populateQueries has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function populateQueries(): void {
                            $definition = $this->dataProvider->getDefinition();
                            $translations = $this->dataProvider->getGoodTranslations();
                            $sourceLanguage = $this->group->getSourceLanguage();
                            $targetLanguage = $this->handle->getCode();
                    Severity: Minor
                    Found in src/TranslatorInterface/Aid/MachineTranslationAid.php - About 1 hr to fix

                      Method markAsResolved has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          private function markAsResolved( string $groupId, ?string $messageTitle = null ): void {
                              if ( $messageTitle === null ) {
                                  $currentGroupStatus = $this->groupSyncCache->markGroupAsResolved( $groupId );
                                  $this->groupSyncLog->info(
                                      '{user} resolved group {groupId}.',
                      Severity: Minor
                      Found in src/Synchronization/ManageGroupSynchronizationCacheActionApi.php - About 1 hr to fix

                        Method inLanguage has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function inLanguage( string $code ): array {
                                $dbr = $this->loadBalancer->getConnection( DB_REPLICA, 'vslow' );
                        
                                $res = $dbr->newSelectQueryBuilder()
                                    ->select( [
                        Severity: Minor
                        Found in src/Statistics/TranslatorActivityQuery.php - About 1 hr to fix

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

                              protected function getAllowedParams(): array {
                                  return [
                                      'groupId' => [
                                          ParamValidator::PARAM_TYPE => 'string',
                                          ParamValidator::PARAM_REQUIRED => true,
                          Severity: Minor
                          Found in src/MessageGroupProcessing/ManageMessageGroupsActionApi.php - About 1 hr to fix

                            Method isTranslatableMessage has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public static function isTranslatableMessage( MessageHandle $handle, string $targetLanguage ): bool {
                                    static $cache = [];
                            
                                    if ( !$handle->isValid() ) {
                                        return false;
                            Severity: Minor
                            Found in src/MessageGroupProcessing/MessageGroups.php - About 1 hr to fix

                              Method writeReal has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  protected function writeReal( MessageCollection $collection ): string {
                                      $header = $this->doHeader( $collection );
                                      $header .= $this->doAuthors( $collection );
                                      $header .= "\n";
                              
                              
                              Severity: Minor
                              Found in src/FileFormatSupport/AppleFormat.php - About 1 hr to fix

                                Method writeReal has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    protected function writeReal( MessageCollection $collection ): string {
                                        $output = '';
                                        $mangler = $this->group->getMangler();
                                
                                        /** @var Message $m */
                                Severity: Minor
                                Found in src/FileFormatSupport/IniFormat.php - About 1 hr to fix

                                  Method writeReal has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      protected function writeReal( MessageCollection $collection ): string {
                                          $output = $this->doHeader( $collection );
                                          $output .= $this->doAuthors( $collection );
                                  
                                          $mangler = $this->group->getMangler();
                                  Severity: Minor
                                  Found in src/FileFormatSupport/YamlFormat.php - About 1 hr to fix

                                    Function updateElement has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        updateElement: function(point, index, reset) {
                                            var me = this;
                                            var custom = point.custom || {};
                                            var dataset = me.getDataset();
                                            var scale = me.chart.scale;
                                    Severity: Minor
                                    Found in resources/lib/Chart.js/Chart.js - About 1 hr to fix

                                      Function updateBezierControlPoints has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

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

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

                                            public function execute() {
                                                global $wgTranslateGroupFiles, $wgTranslateYamlLibrary;
                                                $documents = [];
                                                $times = [];
                                                $mems = [];
                                        Severity: Minor
                                        Found in scripts/yaml-tests.php - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language