bronycub/sugarcub

View on GitHub

Showing 3,238 of 3,238 total issues

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

var PointToGeoJSON = {
    toGeoJSON: function () {
        return L.GeoJSON.getFeature(this, {
            type: 'Point',
            coordinates: L.GeoJSON.latLngToCoords(this.getLatLng())
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 6275..6282

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

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

L.Polyline.include({
    toGeoJSON: function () {
        return L.GeoJSON.getFeature(this, {
            type: 'LineString',
            coordinates: L.GeoJSON.latLngsToCoords(this.getLatLngs())
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 6262..6269

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

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 isValid has 28 lines of code (exceeds 25 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

    Function bubble has 28 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export function bubble () {
        var milliseconds = this._milliseconds;
        var days         = this._days;
        var months       = this._months;
        var data         = this._data;
    Severity: Minor
    Found in core/static/vendor/moment/src/lib/duration/bubble.js - About 1 hr to fix

      Function isValid has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function isValid(m) {
          if (m._isValid == null) {
              var flags = getParsingFlags(m);
              var parsedParts = some$1.call(flags.parsedDateParts, function (i) {
                  return i != null;
      Severity: Minor
      Found in core/static/vendor/moment/min/moment-with-locales.js - About 1 hr to fix

        Function isValid has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function isValid(m) {
            if (m._isValid == null) {
                var flags = getParsingFlags(m);
                var parsedParts = some$1.call(flags.parsedDateParts, function (i) {
                    return i != null;
        Severity: Minor
        Found in core/static/vendor/moment/moment.js - About 1 hr to fix

          Function bubble has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function bubble () {
              var milliseconds = this._milliseconds;
              var days         = this._days;
              var months       = this._months;
              var data         = this._data;
          Severity: Minor
          Found in core/static/vendor/moment/moment.js - About 1 hr to fix

            Function bubble has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function bubble () {
                var milliseconds = this._milliseconds;
                var days         = this._days;
                var months       = this._months;
                var data         = this._data;
            Severity: Minor
            Found in core/static/vendor/moment/min/moment-with-locales.js - About 1 hr to fix

              Function finish has 28 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  finish: function( type ) {
                      if ( type !== false ) {
                          type = type || "fx";
                      }
                      return this.each( function() {
              Severity: Minor
              Found in core/static/vendor/jquery/dist/jquery.js - About 1 hr to fix

                Function formatDate has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        formatDate: function (vDate, vFormat) {
                            var self = this, i, n, len, str, vChar, vDateStr = '', BACKSLASH = '\\';
                            if (typeof vDate === 'string') {
                                vDate = self.parseDate(vDate, vFormat);
                                if (!vDate) {
                Severity: Minor
                Found in core/static/vendor/php-date-formatter/js/php-date-formatter.js - About 1 hr to fix

                  Function off has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      off: function( types, selector, fn ) {
                          var handleObj, type;
                          if ( types && types.preventDefault && types.handleObj ) {
                  
                              // ( event )  dispatched jQuery.Event
                  Severity: Minor
                  Found in core/static/vendor/jquery/dist/jquery.js - About 1 hr to fix

                    Function getWidthOrHeight has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function getWidthOrHeight( elem, name, extra ) {
                    
                        // Start with offset property, which is equivalent to the border-box value
                        var val,
                            valueIsBorderBox = true,
                    Severity: Minor
                    Found in core/static/vendor/jquery/dist/jquery.js - About 1 hr to fix

                      Function off has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          off: function( types, selector, fn ) {
                              var handleObj, type;
                              if ( types && types.preventDefault && types.handleObj ) {
                      
                                  // ( event )  dispatched jQuery.Event
                      Severity: Minor
                      Found in core/static/vendor/jquery/dist/jquery.slim.js - About 1 hr to fix

                        Function parseHTML has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        jQuery.parseHTML = function( data, context, keepScripts ) {
                            if ( typeof data !== "string" ) {
                                return [];
                            }
                            if ( typeof context === "boolean" ) {
                        Severity: Minor
                        Found in core/static/vendor/jquery/dist/jquery.js - About 1 hr to fix

                          Function getWidthOrHeight has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          function getWidthOrHeight( elem, name, extra ) {
                          
                              // Start with offset property, which is equivalent to the border-box value
                              var val,
                                  valueIsBorderBox = true,
                          Severity: Minor
                          Found in core/static/vendor/jquery/dist/jquery.slim.js - About 1 hr to fix

                            Function parseHTML has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            jQuery.parseHTML = function( data, context, keepScripts ) {
                                if ( typeof data !== "string" ) {
                                    return [];
                                }
                                if ( typeof context === "boolean" ) {
                            Severity: Minor
                            Found in core/static/vendor/jquery/dist/jquery.slim.js - About 1 hr to fix

                              Function finish has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  finish: function( type ) {
                                      if ( type !== false ) {
                                          type = type || "fx";
                                      }
                                      return this.each( function() {
                              Severity: Minor
                              Found in core/static/vendor/jquery/src/effects.js - About 1 hr to fix

                                Function off has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    off: function( types, selector, fn ) {
                                        var handleObj, type;
                                        if ( types && types.preventDefault && types.handleObj ) {
                                
                                            // ( event )  dispatched jQuery.Event
                                Severity: Minor
                                Found in core/static/vendor/jquery/src/event.js - About 1 hr to fix

                                  Function getWidthOrHeight has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  function getWidthOrHeight( elem, name, extra ) {
                                  
                                      // Start with offset property, which is equivalent to the border-box value
                                      var val,
                                          valueIsBorderBox = true,
                                  Severity: Minor
                                  Found in core/static/vendor/jquery/src/css.js - About 1 hr to fix

                                    Function parseHTML has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    jQuery.parseHTML = function( data, context, keepScripts ) {
                                        if ( typeof data !== "string" ) {
                                            return [];
                                        }
                                        if ( typeof context === "boolean" ) {
                                    Severity: Minor
                                    Found in core/static/vendor/jquery/src/core/parseHTML.js - About 1 hr to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language