wikimedia/mediawiki-extensions-Translate

View on GitHub

Showing 994 of 1,238 total issues

Method getTranslatableLanguages has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function getTranslatableLanguages() {
        $groupConfiguration = $this->getConfiguration();
        if ( !isset( $groupConfiguration['LANGUAGES'] ) ) {
            // No LANGUAGES section in the configuration.
            return null;
Severity: Minor
Found in messagegroups/MessageGroupBase.php - About 1 hr to fix

    Function drawBackground has 37 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        drawBackground: function(pt, vm, ctx, tooltipSize) {
            ctx.fillStyle = vm.backgroundColor;
            ctx.strokeStyle = vm.borderColor;
            ctx.lineWidth = vm.borderWidth;
            var xAlign = vm.xAlign;
    Severity: Minor
    Found in resources/lib/Chart.js/Chart.js - About 1 hr to fix

      Function draw has 37 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          draw: function() {
              var ctx = this._chart.ctx;
              var vm = this._view;
              var pixelMargin = (vm.borderAlign === 'inner') ? 0.33 : 0;
              var arc = {
      Severity: Minor
      Found in resources/lib/Chart.js/Chart.js - About 1 hr to fix

        Function getBaseModel has 37 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function getBaseModel(tooltipOpts) {
            var globalDefaults = core_defaults.global;
        
            return {
                // Positioning
        Severity: Minor
        Found in resources/lib/Chart.js/Chart.js - About 1 hr to fix

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

              public function execute() {
                  $template =
                      <<<'XML'
                      <?xml version="1.0" encoding="UTF-8"?>
                      <graphml
          Severity: Minor
          Found in scripts/fallbacks-graph.php - About 1 hr to fix

            Function _drawGrid has 37 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                _drawGrid: function() {
                    var me = this;
                    var ctx = me.ctx;
                    var opts = me.options;
                    var gridLineOpts = opts.gridLines;
            Severity: Minor
            Found in resources/lib/Chart.js/Chart.js - About 1 hr to fix

              Method getNormalForm has 37 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  private function getNormalForm(): HTMLForm {
                      $fields = [];
              
                      // Allow subscribers to manipulate the list of watched pages (or use it
                      // to preload lots of details at once)
              Severity: Minor
              Found in src/PageTranslation/ManageMessageGroupSubscriptionsSpecialPage.php - About 1 hr to fix

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

                    public function execute(): void {
                        $params = $this->extractRequestParams();
                
                        $title = Title::newFromText( $params['title'] );
                        if ( !$title ) {
                Severity: Minor
                Found in src/MessageLoading/QueryMessageTranslationsActionApi.php - About 1 hr to fix

                  Method getSearchInput has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      private function getSearchInput( string $query ): string {
                          $attribs = [
                              'placeholder' => $this->msg( 'tux-sst-search-ph' )->text(),
                              'class' => 'searchinputbox mw-ui-input',
                              'dir' => $this->getLanguage()->getDir()
                  Severity: Minor
                  Found in src/TtmServer/SearchTranslationsSpecialPage.php - About 1 hr to fix

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

                        public function run(): bool {
                            $params = $this->params;
                            $isRename = $params['rename'] ?? false;
                            $isFuzzy = $params['fuzzy'] ?? false;
                            $otherLangs = $params['otherLangs'] ?? [];
                    Severity: Minor
                    Found in src/Synchronization/UpdateMessageJob.php - About 1 hr to fix

                      Method getGroupStructure has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public static function getGroupStructure(): array {
                              $groups = self::getAllGroups();
                      
                              // Determine the top level groups of the tree
                              $tree = $groups;
                      Severity: Minor
                      Found in src/MessageGroupProcessing/MessageGroups.php - About 1 hr to fix

                        Method forItemInternal has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            private static function forItemInternal(
                                array &$stats,
                                MessageGroup $group,
                                string $languageCode,
                                int $flags
                        Severity: Minor
                        Found in src/Statistics/MessageGroupStats.php - About 1 hr to fix

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

                              protected function writeReal( MessageCollection $collection ): string {
                                  // FIXME: this should be the source language
                                  $pot = $this->read( 'en' ) ?? [];
                                  $code = $collection->code;
                                  $template = $this->read( $code ) ?? [];
                          Severity: Minor
                          Found in src/FileFormatSupport/GettextFormat.php - About 1 hr to fix

                            Method listSubgroups has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                private function listSubgroups( string $groupId, array $subGroupIds ): string {
                                    $id = $this->htmlIdForGroup( $groupId, 'mw-tpa-grouplist-' );
                                    $out = Html::openElement( 'ol', [ 'id' => $id ] );
                            
                                    // Get the respective groups and sort them
                            Severity: Minor
                            Found in src/MessageGroupProcessing/AggregateGroupsSpecialPage.php - About 1 hr to fix

                              Function showTranslation has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  function showTranslation( translation ) {
                                      var $target = $( '.translations' ),
                                          translationLang = translation.title.split( '/' ).pop();
                              
                                      $target.append( $( '<div>' )
                              Severity: Minor
                              Found in resources/js/ext.translate.special.managetranslatorsandbox.js - About 1 hr to fix

                                Function toggleSubscription has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    function toggleSubscription() {
                                        var api = new mw.Api();
                                        var $button = $( this );
                                        $button.prop( 'disabled', true );
                                
                                
                                Severity: Minor
                                Found in resources/js/ext.translate.special.translate.js - About 1 hr to fix

                                  Method __construct has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      public function __construct() {
                                          parent::__construct();
                                          $this->addDescription( 'Review and move translatable bundles including their subpages' );
                                  
                                          $this->addArg(
                                  Severity: Minor
                                  Found in src/PageTranslation/MoveTranslatableBundleMaintenanceScript.php - About 1 hr to fix

                                    Method classifyPages has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        private function classifyPages( array $pages ): array {
                                            $out = [
                                                // The ideal state for pages: marked and up to date
                                                'active' => [],
                                                'proposed' => [],
                                    Severity: Minor
                                    Found in src/PageTranslation/PageTranslationSpecialPage.php - About 1 hr to fix

                                      Function _drawTitle has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          _drawTitle: function() {
                                              var me = this;
                                              var ctx = me.ctx;
                                              var options = me.options;
                                              var scaleLabel = options.scaleLabel;
                                      Severity: Minor
                                      Found in resources/lib/Chart.js/Chart.js - About 1 hr to fix

                                        Function decodeFill has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                        function decodeFill(el, index, count) {
                                            var model = el._model || {};
                                            var fill = model.fill;
                                            var target;
                                        
                                        
                                        Severity: Minor
                                        Found in resources/lib/Chart.js/Chart.js - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language