wikimedia/mediawiki-extensions-UniversalLanguageSelector

View on GitHub

Showing 269 of 269 total issues

Avoid deeply nested control flow statements.
Open

                            if (selectionSupportsMultipleRanges) {
                                previousRangeCount = this.rangeCount;
                            } else {
                                this.removeAllRanges();
                                previousRangeCount = 0;
Severity: Major
Found in lib/rangy/rangy-core.js - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                                        if (ec == sibling) {
                                            ec = sc;
                                            eo += sc.length;
                                        }
    Severity: Major
    Found in lib/rangy/rangy-core.js - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                                  if (addRangeBackwardToNative) {
                                      addRangeBackwardToNative(sel, originalSelectionRanges[i]);
                                  } else {
                                      api.warn("Rangy initialization: original selection was backwards but selection has been restored forwards because the browser does not support Selection.extend");
                                      sel.addRange(originalSelectionRanges[i]);
      Severity: Major
      Found in lib/rangy/rangy-core.js - About 45 mins to fix

        Avoid deeply nested control flow statements.
        Open

                                    if (controlRange.length) {
                                        doc = getDocument( controlRange.item(0) );
                                    }
        Severity: Major
        Found in lib/rangy/rangy-core.js - About 45 mins to fix

          Function onSkinAfterPortlet has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

              public function onSkinAfterPortlet( $skin, $name, &$content ) {
                  if ( $name !== 'lang' ) {
                      return;
                  }
          
          
          Severity: Minor
          Found in includes/Hooks.php - About 45 mins 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

          Avoid deeply nested control flow statements.
          Open

                                      if (this.rangeCount == previousRangeCount + 1) {
                                          // The range was added successfully
          
                                          // Check whether the range that we added to the selection is reflected in the last range extracted from
                                          // the selection
          Severity: Major
          Found in lib/rangy/rangy-core.js - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                        if ( previousInputMethods[ 0 ] ) {
                                            this.selectIM( previousInputMethods[ 0 ] );
                                        } else {
                                            // Provide the default input method in this case.
                                            firstInputmethod =
            Severity: Major
            Found in lib/jquery.ime/jquery.ime.js - About 45 mins to fix

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

                  $.uls.data.getLanguagesInScript = function ( script ) {
                      return $.uls.data.getLanguagesInScripts( [ script ] );
                  };
              Severity: Minor
              Found in lib/jquery.uls/src/jquery.uls.data.utils.js and 1 other location - About 45 mins to fix
              lib/jquery.uls/src/jquery.uls.data.utils.js on lines 151..153

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

              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

                  $.uls.data.getLanguagesByScriptGroupInRegion = function ( region ) {
                      return $.uls.data.getLanguagesByScriptGroupInRegions( [ region ] );
                  };
              Severity: Minor
              Found in lib/jquery.uls/src/jquery.uls.data.utils.js and 1 other location - About 45 mins to fix
              lib/jquery.uls/src/jquery.uls.data.utils.js on lines 114..116

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

              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: [
                          [ 'F', '\u0A8C' ],
                          [ '\\>', '\u0ABD' ],
                          [ '\\=', '\u0AC4' ],
                          [ 'X', '\u0AD0' ],
              Severity: Minor
              Found in lib/jquery.ime/rules/gu/gu-inscript.js and 1 other location - About 45 mins to fix
              lib/jquery.ime/rules/ks/ks-inscript.js on lines 113..125

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

              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: [
                          [ '4', '₹' ],
                          [ 'Q', 'ॵ' ],
                          [ 'q', 'ॏ' ],
                          [ 'T', 'ॷ' ],
              Severity: Minor
              Found in lib/jquery.ime/rules/ks/ks-inscript.js and 1 other location - About 45 mins to fix
              lib/jquery.ime/rules/gu/gu-inscript.js on lines 97..108

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

              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

                          $moreLanguagesButton.on( 'click', function () {
                              displaySettings.$parent.hide();
                              mw.hook( 'mw.uls.interface.morelanguages' ).fire();
                          } );
              Severity: Minor
              Found in resources/js/ext.uls.displaysettings.js and 1 other location - About 40 mins to fix
              resources/js/ext.uls.inputsettings.js on lines 400..403

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

              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

                          $moreLanguagesButton.on( 'click', function () {
                              inputSettings.$parent.hide();
                              mw.hook( 'mw.uls.ime.morelanguages' ).fire();
                          } );
              Severity: Minor
              Found in resources/js/ext.uls.inputsettings.js and 1 other location - About 40 mins to fix
              resources/js/ext.uls.displaysettings.js on lines 366..369

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

              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

                  $.fn.languagesettings.modules = $.extend( $.fn.languagesettings.modules, {
                      display: DisplaySettings
                  } );
              Severity: Minor
              Found in resources/js/ext.uls.displaysettings.js and 1 other location - About 40 mins to fix
              resources/js/ext.uls.inputsettings.js on lines 593..595

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

              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

                  $.fn.languagesettings.modules = $.extend( $.fn.languagesettings.modules, {
                      input: InputSettings
                  } );
              Severity: Minor
              Found in resources/js/ext.uls.inputsettings.js and 1 other location - About 40 mins to fix
              resources/js/ext.uls.displaysettings.js on lines 727..729

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

              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 updateNativeRange has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                              function updateNativeRange(range, startContainer, startOffset, endContainer, endOffset) {
              Severity: Minor
              Found in lib/rangy/rangy-core.js - About 35 mins to fix

                Function getTextRangeBoundaryPosition has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                            var getTextRangeBoundaryPosition = function(textRange, wholeRangeContainerElement, isStart, isCollapsed, startInfo) {
                Severity: Minor
                Found in lib/rangy/rangy-core.js - About 35 mins to fix

                  Function updateBoundaries has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                          function updateBoundaries(range, startContainer, startOffset, endContainer, endOffset) {
                  Severity: Minor
                  Found in lib/rangy/rangy-core.js - About 35 mins to fix

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

                            visible: function () {
                                if ( this.options.onVisible ) {
                                    this.options.onVisible.call( this );
                                }
                            },
                    Severity: Minor
                    Found in resources/js/ext.uls.languagesettings.js and 2 other locations - About 35 mins to fix
                    lib/jquery.uls/src/jquery.uls.core.js on lines 92..96
                    lib/jquery.uls/src/jquery.uls.core.js on lines 105..109

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

                    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

                            visible: function () {
                                if ( this.options.onVisible ) {
                                    this.options.onVisible.call( this );
                                }
                            },
                    Severity: Minor
                    Found in lib/jquery.uls/src/jquery.uls.core.js and 2 other locations - About 35 mins to fix
                    lib/jquery.uls/src/jquery.uls.core.js on lines 92..96
                    resources/js/ext.uls.languagesettings.js on lines 226..230

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

                    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