wikimedia/mediawiki-extensions-Translate

View on GitHub

Showing 994 of 1,238 total issues

Method fetchTranslatableTemplateAndTitle has 42 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function fetchTranslatableTemplateAndTitle(
        ?LinkTarget $contextLink,
        ?LinkTarget $templateLink,
        bool &$skip,
        ?RevisionRecord &$revRecord
Severity: Minor
Found in src/PageTranslation/Hooks.php - About 1 hr to fix

    Method sourcePageHeader has 42 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        private static function sourcePageHeader( IContextSource $context ) {
            $linker = MediaWikiServices::getInstance()->getLinkRenderer();
    
            $language = $context->getLanguage();
            $title = $context->getTitle();
    Severity: Minor
    Found in src/PageTranslation/Hooks.php - About 1 hr to fix

      Method processGroups has 42 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected function processGroups( array $groups ): array {
              $fixedGroups = [];
              foreach ( $groups as $g ) {
                  $name = $g['name'];
                  $sanitizedName = preg_replace( '/\s+/', '', strtolower( $name ) );
      Severity: Minor
      Found in src/MessageGroupConfiguration/PremadeIntuitionTextdomains.php - About 1 hr to fix

        Method beginBootstrap has 42 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function beginBootstrap(): void {
                $this->checkElasticsearchVersion();
                $index = $this->getIndex();
                if ( $this->updateMapping ) {
                    $this->logOutput( 'Updating the index mappings...' );
        Severity: Minor
        Found in src/TtmServer/ElasticSearchTtmServer.php - About 1 hr to fix

          Method extractMessages has 42 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private function extractMessages( array $documents ): array {
                  $messages = $ret = [];
          
                  $language = $this->params['language'];
                  foreach ( $documents as $document ) {
          Severity: Minor
          Found in src/TtmServer/CrossLanguageTranslationSearchQuery.php - About 1 hr to fix

            Method identifySafeLanguages has 42 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                private function identifySafeLanguages(
                    FileBasedMessageGroup $group,
                    MessageSourceChange $changesForGroup,
                    int $importStrategy
                ): array {
            Severity: Minor
            Found in src/Synchronization/ExternalMessageSourceStateImporter.php - About 1 hr to fix

              Method getParentGroups has 42 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public static function getParentGroups( MessageGroup $targetGroup ): array {
                      $ids = self::getSharedGroups( $targetGroup );
                      if ( $ids === [] ) {
                          return [];
                      }
              Severity: Minor
              Found in src/MessageGroupProcessing/MessageGroups.php - About 1 hr to fix

                Function showTranslationHelpers has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        showTranslationHelpers: function () {
                            // API call to get translation suggestions from other languages
                            // callback should render suggestions to the editor's info column
                            var api = new mw.Api();
                
                
                Severity: Minor
                Found in resources/js/ext.translate.editor.helpers.js - About 1 hr to fix

                  Function prepareMessageGroupRow has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          prepareMessageGroupRow: function ( messagegroup ) {
                              var $row = $( '<div>' )
                                  .addClass( 'row tux-grouplist__item' )
                                  .attr( 'data-msggroupid', messagegroup.id )
                                  .data( 'msggroup', messagegroup );
                  Severity: Minor
                  Found in resources/src/ext.translate.groupselector/index.js - About 1 hr to fix

                    Function doFill has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function doFill(ctx, points, mapper, view, color, loop) {
                        var count = points.length;
                        var span = view.spanGaps;
                        var curve0 = [];
                        var curve1 = [];
                    Severity: Minor
                    Found in resources/lib/Chart.js/Chart.js - About 1 hr to fix

                      Method onSpecialRecentChangesPanel has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function onSpecialRecentChangesPanel( &$extraOpts, $opts ) {
                              global $wgLang, $wgRequest;
                              if ( !$this->config->get( 'TranslateRecentChangesLanguageFilter' ) ) {
                                  return;
                              }
                      Severity: Minor
                      Found in src/TranslatorInterface/CleanChangesFilters.php - About 1 hr to fix

                        Method showSearch has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            private function showSearch(
                                string $search,
                                string $count,
                                string $facets,
                                string $results,
                        Severity: Minor
                        Found in src/TtmServer/SearchTranslationsSpecialPage.php - About 1 hr to fix

                          Method getMessageInfoHtml has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              private function getMessageInfoHtml( MessageUpdateParameter $message, Language $language ): string {
                                  $output = Html::openElement( 'dl' );
                          
                                  $tags = [];
                                  if ( $message->isFuzzy() ) {
                          Severity: Minor
                          Found in src/Synchronization/DisplayGroupSynchronizationInfo.php - About 1 hr to fix

                            Method validateMessage has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public static function validateMessage(
                                    IContextSource $context,
                                    Content $content,
                                    Status $status,
                                    string $summary,
                            Severity: Minor
                            Found in src/HookHandler.php - About 1 hr to fix

                              Method tagFuzzy has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function tagFuzzy( array $problematic ): void {
                                      if ( $problematic === [] ) {
                                          return;
                                      }
                              
                              
                              Severity: Minor
                              Found in scripts/createCheckIndex.php - About 1 hr to fix

                                Method getMarkOperation has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    public function getMarkOperation(
                                        PageRecord $page,
                                        ?int $revision,
                                        bool $validateUnitTitle
                                    ): TranslatablePageMarkOperation {
                                Severity: Minor
                                Found in src/PageTranslation/TranslatablePageMarker.php - About 1 hr to fix

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

                                      public function execute(): void {
                                          $params = $this->extractRequestParams();
                                  
                                          // The user we are operating on, not necessarily the user making the request
                                          $user = $this->getUser();
                                  Severity: Minor
                                  Found in src/TranslatorSandbox/TranslationStashActionApi.php - About 1 hr to fix

                                    Method searchMessages has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        public function searchMessages( string $query, int $maxResults ): array {
                                            // Optimized based on requirements:
                                            // * "Natural" sorting of results
                                            // * No need to show which message group things belong to
                                            // * Match at any point in the message
                                    Severity: Minor
                                    Found in src/TranslatorInterface/EntitySearch.php - About 1 hr to fix

                                      Method searchProfileForm has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          public static function searchProfileForm(
                                              SpecialSearch $search,
                                              string &$form,
                                              string $profile,
                                              string $term,
                                      Severity: Minor
                                      Found in src/HookHandler.php - About 1 hr to fix

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

                                            public function run() {
                                                $title = $this->title;
                                                $fuzzyBot = FuzzyBot::getUser();
                                                $summary = $this->getSummary();
                                                $base = $this->getBase();
                                        Severity: Minor
                                        Found in src/MessageGroupProcessing/DeleteTranslatableBundleJob.php - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language