wikimedia/mediawiki-extensions-UniversalLanguageSelector

View on GitHub

Showing 269 of 269 total issues

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

( function ( $ ) {
    'use strict';

    var bfaTilde = {
        id: 'bfa-tilde',
Severity: Major
Found in lib/jquery.ime/rules/bfa/bfa-tilde.js and 1 other location - About 3 hrs to fix
lib/jquery.ime/rules/ak/ak-tilde.js on lines 1..23

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 102.

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

( function ( $ ) {
    'use strict';

    var akTilde = {
        id: 'ak-tilde',
Severity: Major
Found in lib/jquery.ime/rules/ak/ak-tilde.js and 1 other location - About 3 hrs to fix
lib/jquery.ime/rules/bfa/bfa-tilde.js on lines 1..23

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 102.

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

        patterns_x: [
            [ '\\!', '৴' ],
            [ '1', '\u200d' ],
            [ '\\@', '৵' ],
            [ '2', '\u200c' ],
Severity: Major
Found in lib/jquery.ime/rules/mni/mni-inscript2.js and 2 other locations - About 3 hrs to fix
lib/jquery.ime/rules/as/as-inscript2.js on lines 99..124
lib/jquery.ime/rules/ml/ml-inscript2.js on lines 103..128

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 102.

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

Function getTextRangeBoundaryPosition has 83 lines of code (exceeds 25 allowed). Consider refactoring.
Open

            var getTextRangeBoundaryPosition = function(textRange, wholeRangeContainerElement, isStart, isCollapsed, startInfo) {
                var workingRange = textRange.duplicate();
                workingRange.collapse(isStart);
                var containerElement = workingRange.parentElement();

Severity: Major
Found in lib/rangy/rangy-core.js - About 3 hrs to fix

    File vai-transliteration.js has 298 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    ( function ( $ ) {
        'use strict';
    
        var vaiTransliteration = {
            id: 'vai-transliteration',
    Severity: Minor
    Found in lib/jquery.ime/rules/vai/vai-transliteration.js - About 3 hrs to fix

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

              patterns_x: [
                  [ '1', '\u200d' ],
                  [ '2', '\u200c' ],
                  [ '4', '₹' ],
                  [ '\\+', 'ॠ' ],
      Severity: Major
      Found in lib/jquery.ime/rules/hi/hi-inscript2.js and 1 other location - About 3 hrs to fix
      lib/jquery.ime/rules/te/te-inscript2.js on lines 98..122

      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 98.

      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

              patterns_x: [
                  [ '\\!', '౹' ],
                  [ '\\@', '౼' ],
                  [ '\\#', '౺' ],
                  [ '\\$', '౽' ],
      Severity: Major
      Found in lib/jquery.ime/rules/te/te-inscript2.js and 1 other location - About 3 hrs to fix
      lib/jquery.ime/rules/hi/hi-inscript2.js on lines 99..123

      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 98.

      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

      ( function ( $ ) {
          'use strict';
      
          var kiTilde = {
              id: 'ki-tilde',
      Severity: Major
      Found in lib/jquery.ime/rules/ki/ki-tilde.js and 2 other locations - About 3 hrs to fix
      lib/jquery.ime/rules/ish/ish-tilde.js on lines 1..22
      lib/jquery.ime/rules/nia/nia-tilde.js on lines 1..22

      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 97.

      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

      ( function ( $ ) {
          'use strict';
      
          var niaTilde = {
              id: 'nia-tilde',
      Severity: Major
      Found in lib/jquery.ime/rules/nia/nia-tilde.js and 2 other locations - About 3 hrs to fix
      lib/jquery.ime/rules/ish/ish-tilde.js on lines 1..22
      lib/jquery.ime/rules/ki/ki-tilde.js on lines 1..22

      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 97.

      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

      ( function ( $ ) {
          'use strict';
      
          var ishTilde = {
              id: 'ish-tilde',
      Severity: Major
      Found in lib/jquery.ime/rules/ish/ish-tilde.js and 2 other locations - About 3 hrs to fix
      lib/jquery.ime/rules/ki/ki-tilde.js on lines 1..22
      lib/jquery.ime/rules/nia/nia-tilde.js on lines 1..22

      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 97.

      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

      Function prepareLanguages has 75 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              prepareLanguages: function () {
                  var $loginCta,
                      displaySettings = this,
                      SUGGESTED_LANGUAGES_NUMBER = 3,
                      anonsAllowed = mw.config.get( 'wgULSAnonCanChangeLanguage' ),
      Severity: Major
      Found in resources/js/ext.uls.displaysettings.js - About 3 hrs to fix

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

        ( function ( $ ) {
            'use strict';
        
            var nyTilde = {
                id: 'ny-tilde',
        Severity: Major
        Found in lib/jquery.ime/rules/ny/ny-tilde.js and 1 other location - About 3 hrs to fix
        lib/jquery.ime/rules/tum/tum-tilde.js on lines 1..21

        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 95.

        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

        ( function ( $ ) {
            'use strict';
        
            var tumTilde = {
                id: 'tum-tilde',
        Severity: Major
        Found in lib/jquery.ime/rules/tum/tum-tilde.js and 1 other location - About 3 hrs to fix
        lib/jquery.ime/rules/ny/ny-tilde.js on lines 1..21

        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 95.

        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

        File jquery.webfonts.js has 291 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /**
         * jQuery Webfonts.
         *
         * Copyright (C) 2012 Santhosh Thottingal
         *
        Severity: Minor
        Found in lib/jquery.webfonts/src/jquery.webfonts.js - About 3 hrs to fix

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

              public function execute() {
                  global $wgExtraLanguageNames;
          
                  // Avoid local configuration leaking to this script
                  if ( $wgExtraLanguageNames !== [] ) {
          Severity: Major
          Found in data/LanguageNameIndexer.php - About 2 hrs to fix

            Function initPersonalEntryPoint has 69 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function initPersonalEntryPoint() {
                    var $trigger = $( '.uls-trigger' );
                    var clickHandler;
            
                    if ( !userCanChangeLanguage() ) {
            Severity: Major
            Found in resources/js/ext.uls.interface.js - About 2 hrs to fix

              Function showUndoTooltip has 68 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function showUndoTooltip( previousLang, previousAutonym ) {
                      var trigger, popup, popupPosition,
                          configPosition = mw.config.get( 'wgULSPosition' ),
                          triggerSelector = ( configPosition === 'interlanguage' ) ?
                              '.uls-settings-trigger, .mw-interlanguage-selector' :
              Severity: Major
              Found in resources/js/ext.uls.interface.js - About 2 hrs to fix

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

                ( function ( $ ) {
                    'use strict';
                
                    var lgTilde = {
                        id: 'lg-tilde',
                Severity: Major
                Found in lib/jquery.ime/rules/lg/lg-tilde.js and 1 other location - About 2 hrs to fix
                lib/jquery.ime/rules/su/su-keyboard.js on lines 1..20

                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 89.

                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

                ( function ( $ ) {
                    'use strict';
                
                    var suKeyboard = {
                        id: 'su-keyboard',
                Severity: Major
                Found in lib/jquery.ime/rules/su/su-keyboard.js and 1 other location - About 2 hrs to fix
                lib/jquery.ime/rules/lg/lg-tilde.js on lines 1..20

                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 89.

                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

                Function listen has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        listen: function () {
                            var imeselector = this;
                
                            imeselector.$imeSetting.on( 'click.ime', function ( e ) {
                                var $t = $( e.target );
                Severity: Major
                Found in lib/jquery.ime/jquery.ime.js - About 2 hrs to fix
                  Severity
                  Category
                  Status
                  Source
                  Language