wikimedia/mediawiki-extensions-Translate

View on GitHub

Showing 994 of 1,238 total issues

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

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

    Function determineDataLimits has 34 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        determineDataLimits: function() {
            var me = this;
            var opts = me.options;
            var chart = me.chart;
            var datasets = chart.data.datasets;
    Severity: Minor
    Found in resources/lib/Chart.js/Chart.js - About 1 hr to fix

      Method validateUnitNames has 34 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private function validateUnitNames(
              TranslatablePage $page,
              array $units,
              bool $includePageDisplayTitle
          ): Status {
      Severity: Minor
      Found in src/PageTranslation/TranslatablePageMarker.php - About 1 hr to fix

        Method prepareTranslationUnits has 34 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private function prepareTranslationUnits( TranslatablePage $page, ParserOutput $parserOutput ): array {
                $highest = (int)$this->messageGroupMetadata->get( $page->getMessageGroupId(), 'maxid' );
        
                $store = $this->translationUnitStoreFactory->getReader( $page->getPageIdentity() );
                $storedUnits = $store->getUnits();
        Severity: Minor
        Found in src/PageTranslation/TranslatablePageMarker.php - About 1 hr to fix

          Method showPage has 34 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private function showPage(): void {
                  $out = $this->getOutput();
                  $user = $this->getUser();
          
                  $count = count( $this->stash->getTranslations( $user ) );
          Severity: Minor
          Found in src/TranslatorSandbox/TranslationStashSpecialPage.php - About 1 hr to fix

            Method getData has 34 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function getData(): array {
                    $pageTitle = $this->handle->getTitle();
                    if ( !$pageTitle->exists() ) {
                        return [];
                    }
            Severity: Minor
            Found in src/TranslatorInterface/Aid/EditSummariesAid.php - About 1 hr to fix

              Method tuxLanguageSelector has 34 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  private function tuxLanguageSelector(): string {
                      // The name will be displayed in the UI language,
                      // so use for lang and dir
                      $language = $this->getTargetLanguage();
                      $targetLangName = $this->languageNameUtils->getLanguageName( $language->getCode() );
              Severity: Minor
              Found in src/TranslatorSandbox/TranslationStashSpecialPage.php - About 1 hr to fix

                Method addGroupErrors has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function addGroupErrors( GroupSynchronizationResponse $response ): void {
                        $groupId = $response->getGroupId();
                        $remainingMessages = $response->getRemainingMessages();
                
                        if ( !$remainingMessages ) {
                Severity: Minor
                Found in src/Synchronization/GroupSynchronizationCache.php - About 1 hr to fix

                  Method outputForm has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      private function outputForm(): void {
                          $fields = [
                              'group' => [
                                  'type' => 'select',
                                  'name' => 'group',
                  Severity: Minor
                  Found in src/Synchronization/ExportTranslationsSpecialPage.php - About 1 hr to fix

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

                        public function execute() {
                            $ignoreTrailingWhitespace = $this->getOption( 'ignore-trailing-whitespace' );
                            $groups = $this->getGroups( $this->getArg( 0 ) );
                            $matched = count( $groups );
                            $this->output( "Pattern matched $matched file based message group(s).\n" );
                    Severity: Minor
                    Found in src/Diagnostics/FindUnsynchronizedDefinitionsMaintenanceScript.php - About 1 hr to fix

                      Method handleSourceRename has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          protected function handleSourceRename(
                              MessageSourceChange $sourceChanges,
                              string $code,
                              string $msgKey,
                              string $keyToRename
                      Severity: Minor
                      Found in src/MessageGroupProcessing/ManageMessageGroupsActionApi.php - About 1 hr to fix

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

                            protected function getAllowedParams(): array {
                                $allowedParams = [
                                    'depth' => [
                                        ParamValidator::PARAM_TYPE => 'integer',
                                        ParamValidator::PARAM_DEFAULT => 100,
                        Severity: Minor
                        Found in src/MessageGroupProcessing/QueryMessageGroupsActionApi.php - About 1 hr to fix

                          Method breakRename has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function breakRename( $languageCode, $msgKey ) {
                                  $msg = $this->findMessage( $languageCode, $msgKey, [ self::RENAME ] );
                                  if ( $msg === null ) {
                                      return null;
                                  }
                          Severity: Minor
                          Found in src/MessageSync/MessageSourceChange.php - About 1 hr to fix

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

                                public function readFromVariable( string $data ): array {
                                    $lines = explode( "\n", $data );
                                    $authors = $messages = [];
                                    $linecontinuation = false;
                            
                            
                            Severity: Minor
                            Found in src/FileFormatSupport/AppleFormat.php - About 1 hr to fix

                              Method getExtraSchema has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public static function getExtraSchema(): array {
                                      $schema = [
                                          'root' => [
                                              '_type' => 'array',
                                              '_children' => [
                              Severity: Minor
                              Found in messagegroups/FileBasedMessageGroup.php - About 1 hr to fix

                                Consider simplifying this complex logical expression.
                                Open

                                        if (circumference < DOUBLE_PI$1) {
                                            var startAngle = opts.rotation % DOUBLE_PI$1;
                                            startAngle += startAngle >= PI$1 ? -DOUBLE_PI$1 : startAngle < -PI$1 ? DOUBLE_PI$1 : 0;
                                            var endAngle = startAngle + circumference;
                                            var startX = Math.cos(startAngle);
                                Severity: Critical
                                Found in resources/lib/Chart.js/Chart.js - About 1 hr to fix

                                  Function editGroup has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      function editGroup( event ) {
                                          var $target = $( event.target ),
                                              $parent = $target.closest( '.mw-tpa-group' ),
                                              aggregateGroupId = $parent.data( 'groupid' ),
                                              $displayGroup = $parent.children( '.tp-display-group' ),
                                  Severity: Minor
                                  Found in resources/js/ext.translate.special.aggregategroups.js - About 1 hr to fix

                                    Function construct has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        construct: function(item, config) {
                                            var me = this;
                                    
                                            config = initConfig(config);
                                    
                                    
                                    Severity: Minor
                                    Found in resources/lib/Chart.js/Chart.js - About 1 hr to fix

                                      Function left has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          left: function ( position, data ) {
                                              var within = data.within,
                                                  withinOffset = within.offset.left + within.scrollLeft,
                                                  outerWidth = within.width,
                                                  offsetLeft = within.isWindow ? within.scrollLeft : within.offset.left,
                                      Severity: Minor
                                      Found in resources/src/ext.translate.groupselector/ui.position.js - About 1 hr to fix

                                        Function showMachineTranslations has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                                showMachineTranslations: function ( suggestions ) {
                                                    if ( !suggestions.length ) {
                                                        return;
                                                    }
                                        
                                        
                                        Severity: Minor
                                        Found in resources/js/ext.translate.editor.helpers.js - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language