wikimedia/mediawiki-extensions-Translate

View on GitHub

Showing 1,238 of 1,238 total issues

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

                          Similar blocks of code found in 2 locations. Consider refactoring.
                          Open

                              private function doHeader( MessageCollection $collection ): string {
                                  if ( isset( $this->extra['header'] ) ) {
                                      $output = $this->extra['header'];
                                  } else {
                                      global $wgSitename;
                          Severity: Major
                          Found in src/FileFormatSupport/JavaFormat.php and 1 other location - About 1 hr to fix
                          src/FileFormatSupport/AppleFormat.php on lines 165..179

                          Duplicated Code

                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                          Tuning

                          This issue has a mass of 110.

                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                          Refactorings

                          Further Reading

                          Similar blocks of code found in 2 locations. Consider refactoring.
                          Open

                              private function doHeader( MessageCollection $collection ): string {
                                  if ( isset( $this->extra['header'] ) ) {
                                      $output = $this->extra['header'];
                                  } else {
                                      global $wgSitename;
                          Severity: Major
                          Found in src/FileFormatSupport/AppleFormat.php and 1 other location - About 1 hr to fix
                          src/FileFormatSupport/JavaFormat.php on lines 200..214

                          Duplicated Code

                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                          Tuning

                          This issue has a mass of 110.

                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                          Refactorings

                          Further Reading

                          Similar blocks of code found in 3 locations. Consider refactoring.
                          Open

                          convert.apple.rgb = function (apple) {
                              return [(apple[0] / 65535) * 255, (apple[1] / 65535) * 255, (apple[2] / 65535) * 255];
                          };
                          Severity: Major
                          Found in resources/lib/Chart.js/Chart.js and 2 other locations - About 1 hr to fix
                          resources/lib/Chart.js/Chart.js on lines 1007..1009
                          resources/lib/Chart.js/Chart.js on lines 1011..1013

                          Duplicated Code

                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                          Tuning

                          This issue has a mass of 64.

                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                          Refactorings

                          Further Reading

                          Similar blocks of code found in 2 locations. Consider refactoring.
                          Open

                                      if (me.isHorizontal()) {
                                          x1 = alignPixel(chart, me.left, firstLineWidth) - firstLineWidth / 2;
                                          x2 = alignPixel(chart, me.right, lastLineWidth) + lastLineWidth / 2;
                                          y1 = y2 = borderValue;
                                      } else {
                          Severity: Major
                          Found in resources/lib/Chart.js/Chart.js and 1 other location - About 1 hr to fix
                          resources/lib/Chart.js/Chart.js on lines 12357..12361

                          Duplicated Code

                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                          Tuning

                          This issue has a mass of 64.

                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                          Refactorings

                          Further Reading

                          Similar blocks of code found in 3 locations. Consider refactoring.
                          Open

                          convert.rgb.apple = function (rgb) {
                              return [(rgb[0] / 255) * 65535, (rgb[1] / 255) * 65535, (rgb[2] / 255) * 65535];
                          };
                          Severity: Major
                          Found in resources/lib/Chart.js/Chart.js and 2 other locations - About 1 hr to fix
                          resources/lib/Chart.js/Chart.js on lines 1003..1005
                          resources/lib/Chart.js/Chart.js on lines 1011..1013

                          Duplicated Code

                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                          Tuning

                          This issue has a mass of 64.

                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                          Refactorings

                          Further Reading

                          Similar blocks of code found in 3 locations. Consider refactoring.
                          Open

                          convert.gray.rgb = function (args) {
                              return [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255];
                          };
                          Severity: Major
                          Found in resources/lib/Chart.js/Chart.js and 2 other locations - About 1 hr to fix
                          resources/lib/Chart.js/Chart.js on lines 1003..1005
                          resources/lib/Chart.js/Chart.js on lines 1007..1009

                          Duplicated Code

                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                          Tuning

                          This issue has a mass of 64.

                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                          Refactorings

                          Further Reading

                          Similar blocks of code found in 2 locations. Consider refactoring.
                          Open

                                      next: {
                                          x: current.x + fb * (next.x - previous.x),
                                          y: current.y + fb * (next.y - previous.y)
                                      }
                          Severity: Major
                          Found in resources/lib/Chart.js/Chart.js and 1 other location - About 1 hr to fix
                          resources/lib/Chart.js/Chart.js on lines 10473..10476

                          Duplicated Code

                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                          Tuning

                          This issue has a mass of 64.

                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                          Refactorings

                          Further Reading

                          Similar blocks of code found in 2 locations. Consider refactoring.
                          Open

                                      previous: {
                                          x: current.x - fa * (next.x - previous.x),
                                          y: current.y - fa * (next.y - previous.y)
                                      },
                          Severity: Major
                          Found in resources/lib/Chart.js/Chart.js and 1 other location - About 1 hr to fix
                          resources/lib/Chart.js/Chart.js on lines 10477..10480

                          Duplicated Code

                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                          Tuning

                          This issue has a mass of 64.

                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                          Refactorings

                          Further Reading

                          Severity
                          Category
                          Status
                          Source
                          Language