bronycub/sugarcub

View on GitHub

Showing 3,238 of 3,238 total issues

Function relativeTimeMr has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function relativeTimeMr(number, withoutSuffix, string, isFuture)
{
    var output = '';
    if (withoutSuffix) {
        switch (string) {
Severity: Minor
Found in core/static/vendor/moment/min/moment-with-locales.js - About 1 hr to fix

    Function relativeTimeMr has 32 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function relativeTimeMr(number, withoutSuffix, string, isFuture)
    {
        var output = '';
        if (withoutSuffix) {
            switch (string) {
    Severity: Minor
    Found in core/static/vendor/moment/min/locales.js - About 1 hr to fix

      Function translate$2 has 32 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function translate$2(number, withoutSuffix, key, isFuture) {
          var result = '';
          switch (key) {
              case 's':
                  return isFuture ? 'muutaman sekunnin' : 'muutama sekunti';
      Severity: Minor
      Found in core/static/vendor/moment/min/locales.js - About 1 hr to fix

        Function _adjustPan has 32 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            _adjustPan: function () {
                if (!this.options.autoPan) { return; }
        
                var map = this._map,
                    containerHeight = this._container.offsetHeight,
        Severity: Minor
        Found in core/static/vendor/leaflet/dist/leaflet-src.js - About 1 hr to fix

          Function push has 32 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              push: function(result, actual, expected, message) {
                  if (!config.current) {
                      throw new Error("assertion outside test context, was " + sourceFromStacktrace());
                  }
                  var details = {
          Severity: Minor
          Found in core/static/vendor/bootstrap-datepicker/tests/assets/qunit.js - About 1 hr to fix

            Function typeOf has 32 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                        typeOf: function( obj ) {
                            var type;
                            if ( obj === null ) {
                                type = "null";
                            } else if ( typeof obj === "undefined" ) {
            Severity: Minor
            Found in core/static/vendor/jquery-expander/test/qunit/qunit.1.19.0.js - About 1 hr to fix

              Function data has 32 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                data: function( key, value ) {
                  var i, name, data,
                    elem = this[0],
                    attrs = elem && elem.attributes;
              
              
              Severity: Minor
              Found in core/static/vendor/jquery-expander/test/jquery.1.11.3.js - About 1 hr to fix

                Function fixCloneNodeIssues has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function fixCloneNodeIssues( src, dest ) {
                  var nodeName, e, data;
                
                  // We do not need to do anything for non-Elements
                  if ( dest.nodeType !== 1 ) {
                Severity: Minor
                Found in core/static/vendor/jquery-expander/test/jquery.1.11.3.js - About 1 hr to fix

                  Function addClass has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    addClass: function( value ) {
                      var classes, elem, cur, clazz, j, finalValue,
                        i = 0,
                        len = this.length,
                        proceed = typeof value === "string" && value;
                  Severity: Minor
                  Found in core/static/vendor/jquery-expander/test/jquery.1.11.3.js - About 1 hr to fix

                    Function load has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    jQuery.fn.load = function( url, params, callback ) {
                      if ( typeof url !== "string" && _load ) {
                        return _load.apply( this, arguments );
                      }
                    
                    
                    Severity: Minor
                    Found in core/static/vendor/jquery-expander/test/jquery.1.11.3.js - About 1 hr to fix

                      Function removeClass has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        removeClass: function( value ) {
                          var classes, elem, cur, clazz, j, finalValue,
                            i = 0,
                            len = this.length,
                            proceed = arguments.length === 0 || typeof value === "string" && value;
                      Severity: Minor
                      Found in core/static/vendor/jquery-expander/test/jquery.1.11.3.js - About 1 hr to fix

                        Function monthsShortRegex has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                        Open

                        export function monthsShortRegex (isStrict) {
                            if (this._monthsParseExact) {
                                if (!hasOwnProp(this, '_monthsRegex')) {
                                    computeMonthsParse.call(this);
                                }
                        Severity: Minor
                        Found in core/static/vendor/moment/src/lib/units/month.js - About 1 hr 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

                        Function monthsRegex has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                        Open

                        export function monthsRegex (isStrict) {
                            if (this._monthsParseExact) {
                                if (!hasOwnProp(this, '_monthsRegex')) {
                                    computeMonthsParse.call(this);
                                }
                        Severity: Minor
                        Found in core/static/vendor/moment/src/lib/units/month.js - About 1 hr 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

                        Function translate has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                        Open

                        function translate(number, withoutSuffix, key, isFuture) {
                            var result = number + ' ';
                            if (number === 1) {
                                return result + translateSingular(number, withoutSuffix, key[0], isFuture);
                            } else if (withoutSuffix) {
                        Severity: Minor
                        Found in core/static/vendor/moment/src/locale/lt.js - About 1 hr 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

                        Function prepareConfig has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                        Open

                        export function prepareConfig (config) {
                            var input = config._i,
                                format = config._f;
                        
                            config._locale = config._locale || getLocale(config._l);
                        Severity: Minor
                        Found in core/static/vendor/moment/src/lib/create/from-anything.js - About 1 hr 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

                        Function weekdaysShortRegex has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                        Open

                        export function weekdaysShortRegex (isStrict) {
                            if (this._weekdaysParseExact) {
                                if (!hasOwnProp(this, '_weekdaysRegex')) {
                                    computeWeekdaysParse.call(this);
                                }
                        Severity: Minor
                        Found in core/static/vendor/moment/src/lib/units/day-of-week.js - About 1 hr 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

                        Function weekdaysMinRegex has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                        Open

                        export function weekdaysMinRegex (isStrict) {
                            if (this._weekdaysParseExact) {
                                if (!hasOwnProp(this, '_weekdaysRegex')) {
                                    computeWeekdaysParse.call(this);
                                }
                        Severity: Minor
                        Found in core/static/vendor/moment/src/lib/units/day-of-week.js - About 1 hr 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

                        Function isValid has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                        Open

                        export function isValid(m) {
                            if (m._isValid == null) {
                                var flags = getParsingFlags(m);
                                var parsedParts = some.call(flags.parsedDateParts, function (i) {
                                    return i != null;
                        Severity: Minor
                        Found in core/static/vendor/moment/src/lib/create/valid.js - About 1 hr 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

                        Identical blocks of code found in 4 locations. Consider refactoring.
                        Open

                        function processPastTime(string) {
                            var number = string.substr(0, string.indexOf(' '));
                            if (eifelerRegelAppliesToNumber(number)) {
                                return 'viru ' + string;
                            }
                        Severity: Major
                        Found in core/static/vendor/moment/min/locales.js and 3 other locations - About 1 hr to fix
                        core/static/vendor/moment/locale/lb.js on lines 31..37
                        core/static/vendor/moment/min/moment-with-locales.js on lines 8740..8746
                        core/static/vendor/moment/src/locale/lb.js on lines 25..31

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

                        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

                        Identical blocks of code found in 4 locations. Consider refactoring.
                        Open

                        function processPastTime(string) {
                            var number = string.substr(0, string.indexOf(' '));
                            if (eifelerRegelAppliesToNumber(number)) {
                                return 'viru ' + string;
                            }
                        Severity: Major
                        Found in core/static/vendor/moment/locale/lb.js and 3 other locations - About 1 hr to fix
                        core/static/vendor/moment/min/locales.js on lines 4454..4460
                        core/static/vendor/moment/min/moment-with-locales.js on lines 8740..8746
                        core/static/vendor/moment/src/locale/lb.js on lines 25..31

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

                        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