bronycub/sugarcub

View on GitHub

Showing 3,238 of 3,238 total issues

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

function parseIso (inp, sign) {
    // We'd normally use ~~inp for this, but unfortunately it also
    // converts floats to ints.
    // inp may be undefined, so careful calling replace on it.
    var res = inp && parseFloat(inp.replace(',', '.'));
Severity: Major
Found in core/static/vendor/moment/src/lib/duration/create.js and 2 other locations - About 1 hr to fix
core/static/vendor/moment/min/moment-with-locales.js on lines 2883..2890
core/static/vendor/moment/moment.js on lines 2889..2896

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

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 parseIso (inp, sign) {
    // We'd normally use ~~inp for this, but unfortunately it also
    // converts floats to ints.
    // inp may be undefined, so careful calling replace on it.
    var res = inp && parseFloat(inp.replace(',', '.'));
Severity: Major
Found in core/static/vendor/moment/moment.js and 2 other locations - About 1 hr to fix
core/static/vendor/moment/min/moment-with-locales.js on lines 2883..2890
core/static/vendor/moment/src/lib/duration/create.js on lines 81..88

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

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

            rights = selection.map(function(){
                return $(this).offset().left + $(this).outerWidth();
            }).toArray();
core/static/vendor/bootstrap-datepicker/docs/_screenshots/script/screenshot.js on lines 42..44

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

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

    _floor: function () {
        this.x = Math.floor(this.x);
        this.y = Math.floor(this.y);
        return this;
    },
Severity: Major
Found in core/static/vendor/leaflet/dist/leaflet-src.js and 1 other location - About 1 hr to fix
core/static/vendor/leaflet/dist/leaflet-src.js on lines 632..636

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

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 parseIso (inp, sign) {
    // We'd normally use ~~inp for this, but unfortunately it also
    // converts floats to ints.
    // inp may be undefined, so careful calling replace on it.
    var res = inp && parseFloat(inp.replace(',', '.'));
Severity: Major
Found in core/static/vendor/moment/min/moment-with-locales.js and 2 other locations - About 1 hr to fix
core/static/vendor/moment/moment.js on lines 2889..2896
core/static/vendor/moment/src/lib/duration/create.js on lines 81..88

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

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 startOf has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function startOf (units) {
    units = normalizeUnits(units);
    // the following switch intentionally omits break keywords
    // to utilize falling through the cases.
    switch (units) {
Severity: Minor
Found in core/static/vendor/moment/src/lib/moment/start-end-of.js - About 1 hr to fix

    Function diff has 29 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export function diff (input, units, asFloat) {
        var that,
            zoneDelta,
            delta, output;
    
    
    Severity: Minor
    Found in core/static/vendor/moment/src/lib/moment/diff.js - About 1 hr to fix

      Function toISOString has 29 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export function toISOString() {
          // for ISO strings we do not use the normal bubbling rules:
          //  * milliseconds bubble up until they become hours
          //  * days do not bubble at all
          //  * months bubble up until they become years
      Severity: Minor
      Found in core/static/vendor/moment/src/lib/duration/iso-string.js - About 1 hr to fix

        Function diff has 29 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function diff (input, units, asFloat) {
            var that,
                zoneDelta,
                delta, output;
        
        
        Severity: Minor
        Found in core/static/vendor/moment/moment.js - About 1 hr to fix

          Function startOf has 29 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function startOf (units) {
              units = normalizeUnits(units);
              // the following switch intentionally omits break keywords
              // to utilize falling through the cases.
              switch (units) {
          Severity: Minor
          Found in core/static/vendor/moment/min/moment-with-locales.js - About 1 hr to fix

            Function toISOString$1 has 29 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function toISOString$1() {
                // for ISO strings we do not use the normal bubbling rules:
                //  * milliseconds bubble up until they become hours
                //  * days do not bubble at all
                //  * months bubble up until they become years
            Severity: Minor
            Found in core/static/vendor/moment/moment.js - About 1 hr to fix

              Function toISOString$1 has 29 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function toISOString$1() {
                  // for ISO strings we do not use the normal bubbling rules:
                  //  * milliseconds bubble up until they become hours
                  //  * days do not bubble at all
                  //  * months bubble up until they become years
              Severity: Minor
              Found in core/static/vendor/moment/min/moment-with-locales.js - About 1 hr to fix

                Function diff has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function diff (input, units, asFloat) {
                    var that,
                        zoneDelta,
                        delta, output;
                
                
                Severity: Minor
                Found in core/static/vendor/moment/min/moment-with-locales.js - About 1 hr to fix

                  Function startOf has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function startOf (units) {
                      units = normalizeUnits(units);
                      // the following switch intentionally omits break keywords
                      // to utilize falling through the cases.
                      switch (units) {
                  Severity: Minor
                  Found in core/static/vendor/moment/moment.js - About 1 hr to fix

                    Function attr has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        attr: function( elem, name, value ) {
                            var ret, hooks,
                                nType = elem.nodeType;
                    
                            // Don't get/set attributes on text, comment and attribute nodes
                    Severity: Minor
                    Found in core/static/vendor/jquery/dist/jquery.js - About 1 hr to fix

                      Function attr has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          attr: function( elem, name, value ) {
                              var ret, hooks,
                                  nType = elem.nodeType;
                      
                              // Don't get/set attributes on text, comment and attribute nodes
                      Severity: Minor
                      Found in core/static/vendor/jquery/dist/jquery.slim.js - About 1 hr to fix

                        Function attr has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            attr: function( elem, name, value ) {
                                var ret, hooks,
                                    nType = elem.nodeType;
                        
                                // Don't get/set attributes on text, comment and attribute nodes
                        Severity: Minor
                        Found in core/static/vendor/jquery/src/attributes/attr.js - About 1 hr to fix

                          Function createMulti has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              function createMulti(Klass) {
                          
                                  return L.FeatureGroup.extend({
                          
                                      initialize: function (latlngs, options) {
                          Severity: Minor
                          Found in core/static/vendor/leaflet/dist/leaflet-src.js - About 1 hr to fix

                            Function maxDate has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                    picker.maxDate = function (maxDate) {
                                        if (arguments.length === 0) {
                                            return options.maxDate ? options.maxDate.clone() : options.maxDate;
                                        }
                            
                            

                              Function minDate has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                      picker.minDate = function (minDate) {
                                          if (arguments.length === 0) {
                                              return options.minDate ? options.minDate.clone() : options.minDate;
                                          }
                              
                              
                                Severity
                                Category
                                Status
                                Source
                                Language