wikimedia/mediawiki-extensions-UniversalLanguageSelector

View on GitHub

Showing 269 of 269 total issues

File ext.uls.inputsettings.js has 380 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*!
 * ULS-based ime settings panel
 *
 * Copyright (C) 2012 Alolita Sharma, Amir Aharoni, Arun Ganesh, Brandon Harris,
 * Niklas Laxström, Pau Giner, Santhosh Thottingal, Siebrand Mazeland and other
Severity: Minor
Found in resources/js/ext.uls.inputsettings.js - About 5 hrs to fix

    File jquery.uls.lcd.js has 376 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /**
     * Universal Language Selector
     * Language category display component - Used for showing the search results,
     * grouped by regions, scripts
     *
    Severity: Minor
    Found in lib/jquery.uls/src/jquery.uls.lcd.js - About 5 hrs to fix

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

      ( function ( $ ) {
          'use strict';
      
          var fonTilde = {
              id: 'fon-tilde',
      Severity: Major
      Found in lib/jquery.ime/rules/fon/fon-tilde.js and 2 other locations - About 5 hrs to fix
      lib/jquery.ime/rules/igl/igl-tilde.js on lines 1..29
      lib/jquery.ime/rules/yo/yo-tilde.js on lines 1..29

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

      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 iglTilde = {
              id: 'igl-tilde',
      Severity: Major
      Found in lib/jquery.ime/rules/igl/igl-tilde.js and 2 other locations - About 5 hrs to fix
      lib/jquery.ime/rules/fon/fon-tilde.js on lines 1..29
      lib/jquery.ime/rules/yo/yo-tilde.js on lines 1..29

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

      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 yoTilde = {
              id: 'yo-tilde',
      Severity: Major
      Found in lib/jquery.ime/rules/yo/yo-tilde.js and 2 other locations - About 5 hrs to fix
      lib/jquery.ime/rules/fon/fon-tilde.js on lines 1..29
      lib/jquery.ime/rules/igl/igl-tilde.js on lines 1..29

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

      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 am-transliteration.js has 374 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

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

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

        ( function ( $ ) {
            'use strict';
        
            var igTilde = {
                id: 'ig-tilde',
        Severity: Major
        Found in lib/jquery.ime/rules/ig/ig-tilde.js and 1 other location - About 4 hrs to fix
        lib/jquery.ime/rules/nmz/nmz-tilde.js on lines 1..29

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

        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 nmzTilde = {
                id: 'nmz-tilde',
        Severity: Major
        Found in lib/jquery.ime/rules/nmz/nmz-tilde.js and 1 other location - About 4 hrs to fix
        lib/jquery.ime/rules/ig/ig-tilde.js on lines 1..29

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

        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 tig-geezim.js has 366 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        ( function ( $ ) {
            'use strict';
        
            var tigGeezim = {
                id: 'tig-geezim',
        Severity: Minor
        Found in lib/jquery.ime/rules/tig/tig-geezim.js - About 4 hrs to fix

          File byn-geezim.js has 366 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          ( function ( $ ) {
              'use strict';
          
              var bynGeezim = {
                  id: 'byn-geezim',
          Severity: Minor
          Found in lib/jquery.ime/rules/byn/byn-geezim.js - About 4 hrs to fix

            File ti-geezim.js has 366 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            ( function ( $ ) {
                'use strict';
            
                var tiGeezim = {
                    id: 'ti-geezim',
            Severity: Minor
            Found in lib/jquery.ime/rules/ti/ti-geezim.js - About 4 hrs to fix

              Function search has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
              Open

                  public static function search( $searchKey, $typos = 0, $userLanguage = null ) {
                      $results = [];
                      $searchKey = mb_strtolower( $searchKey );
              
                      if ( mb_strlen( $searchKey ) > 100 ) {
              Severity: Minor
              Found in data/LanguageNameSearch.php - About 4 hrs to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

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

                          if ( offset.left + ( width / 2 ) > $( window ).width() / 2 ) {
                              // Midpoint of the trigger is on the right side of the viewport.
                              positionCSS = {
                                  // Right edge of the dialog aligns with the right edge of the trigger.
                                  right: $( window ).width() - ( offset.left + width ),
              Severity: Major
              Found in resources/js/ext.uls.launch.js and 1 other location - About 4 hrs to fix
              resources/js/ext.uls.interface.js on lines 449..463

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

              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 ( offset.left + ( width / 2 ) > $( window ).width() / 2 ) {
                                                  // Midpoint of the trigger is on the right side of the viewport.
                                                  positionCSS = {
                                                      // Right dialog edge aligns with right edge of the trigger.
                                                      right: $( window ).width() - ( offset.left + width ),
              Severity: Major
              Found in resources/js/ext.uls.interface.js and 1 other location - About 4 hrs to fix
              resources/js/ext.uls.launch.js on lines 86..100

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

              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 4 locations. Consider refactoring.
              Open

                  $.fn.lcd = function ( option ) {
                      return this.each( function () {
                          var $this = $( this ),
                              data = $this.data( 'lcd' ),
                              options = typeof option === 'object' && option;
              Severity: Major
              Found in lib/jquery.uls/src/jquery.uls.lcd.js and 3 other locations - About 4 hrs to fix
              lib/jquery.uls/src/jquery.uls.languagefilter.js on lines 347..361
              lib/jquery.webfonts/src/jquery.webfonts.js on lines 472..486
              resources/js/ext.uls.languagesettings.js on lines 301..315

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

              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 4 locations. Consider refactoring.
              Open

                  $.fn.languagefilter = function ( option ) {
                      return this.each( function () {
                          var $this = $( this ),
                              data = $this.data( 'languagefilter' ),
                              options = typeof option === 'object' && option;
              Severity: Major
              Found in lib/jquery.uls/src/jquery.uls.languagefilter.js and 3 other locations - About 4 hrs to fix
              lib/jquery.uls/src/jquery.uls.lcd.js on lines 571..585
              lib/jquery.webfonts/src/jquery.webfonts.js on lines 472..486
              resources/js/ext.uls.languagesettings.js on lines 301..315

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

              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 4 locations. Consider refactoring.
              Open

                  $.fn.languagesettings = function ( option ) {
                      return this.each( function () {
                          var $this = $( this ),
                              data = $this.data( 'languagesettings' ),
                              options = typeof option === 'object' && option;
              Severity: Major
              Found in resources/js/ext.uls.languagesettings.js and 3 other locations - About 4 hrs to fix
              lib/jquery.uls/src/jquery.uls.languagefilter.js on lines 347..361
              lib/jquery.uls/src/jquery.uls.lcd.js on lines 571..585
              lib/jquery.webfonts/src/jquery.webfonts.js on lines 472..486

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

              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 4 locations. Consider refactoring.
              Open

                  $.fn.webfonts = function( option ) {
                      return this.each( function() {
                          var $this = $( this ),
                              data = $this.data( 'webfonts' ),
                              options = typeof option === 'object' && option;
              Severity: Major
              Found in lib/jquery.webfonts/src/jquery.webfonts.js and 3 other locations - About 4 hrs to fix
              lib/jquery.uls/src/jquery.uls.languagefilter.js on lines 347..361
              lib/jquery.uls/src/jquery.uls.lcd.js on lines 571..585
              resources/js/ext.uls.languagesettings.js on lines 301..315

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

              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 woTilde = {
                      id: 'wo-tilde',
              Severity: Major
              Found in lib/jquery.ime/rules/wo/wo-tilde.js and 1 other location - About 4 hrs to fix
              lib/jquery.ime/rules/gaa/gaa-tilde.js on lines 1..28

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

              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 gaaTilde = {
                      id: 'gaa-tilde',
              Severity: Major
              Found in lib/jquery.ime/rules/gaa/gaa-tilde.js and 1 other location - About 4 hrs to fix
              lib/jquery.ime/rules/wo/wo-tilde.js on lines 1..28

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

              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