CartoDB/cartodb20

View on GitHub
lib/assets/javascripts/cartodb/old_common/forms/widgets.js

Summary

Maintainability
F
2 wks
Test Coverage

File widgets.js has 733 lines of code (exceeds 250 allowed). Consider refactoring.
Open


/**
 *  Color form view
 *
 *  - It is used in 'Marker fill', 'Polygon fill',...
Severity: Major
Found in lib/assets/javascripts/cartodb/old_common/forms/widgets.js - About 1 day to fix

    Function render has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

      render: function() {
    
        var self = this;
    
        // Options
    Severity: Minor
    Found in lib/assets/javascripts/cartodb/old_common/forms/widgets.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 _createPicker has 30 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      _createPicker: function() {
    
        var tick, vertical_position, horizontal_position;
    
        if (this.options.extra) {
    Severity: Minor
    Found in lib/assets/javascripts/cartodb/old_common/forms/widgets.js - About 1 hr to fix

      Function _checkInputUp has 30 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        _checkInputUp: function(ev) {
          this.value? null : this.value = this.model.get(this.property);
          var number = $(ev.target).val();
      
          if (ev.keyCode == 40) {
      Severity: Minor
      Found in lib/assets/javascripts/cartodb/old_common/forms/widgets.js - About 1 hr to fix

        Function render has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          render: function() {
        
            var self = this;
        
            // Options
        Severity: Minor
        Found in lib/assets/javascripts/cartodb/old_common/forms/widgets.js - About 1 hr to fix

          Function _checkInputUp has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

            _checkInputUp: function(ev) {
              this.value? null : this.value = this.model.get(this.property);
              var number = $(ev.target).val();
          
              if (ev.keyCode == 40) {
          Severity: Minor
          Found in lib/assets/javascripts/cartodb/old_common/forms/widgets.js - About 55 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

          Function switchProperty has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
          Open

            switchProperty: function() {
              if(this.model.get('polygon-pattern-file')) {
                if(!this.originalProperty) {
                  this.originalProperty = this.property;
                  this.property = 'polygon-pattern-opacity';
          Severity: Minor
          Found in lib/assets/javascripts/cartodb/old_common/forms/widgets.js - About 55 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

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

            _saveValue: function(ev, close) {
              var a = {};
              var val = this.$el.find("input.value").val()
              var baseNumber = (this.options.min < 0 && this.options.max > 0)?
                0:
          Severity: Minor
          Found in lib/assets/javascripts/cartodb/old_common/forms/widgets.js - 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

          Function _createPicker has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

            _createPicker: function() {
          
              var tick, vertical_position, horizontal_position;
          
              if (this.options.extra) {
          Severity: Minor
          Found in lib/assets/javascripts/cartodb/old_common/forms/widgets.js - About 35 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

          Function _checkInputUp has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

            _checkInputUp: function(ev) {
              this.value? null : this.value = this.model.get(this.property);
              var number = $(ev.target).val();
          
              // If it is an ENTER -> saves!
          Severity: Minor
          Found in lib/assets/javascripts/cartodb/old_common/forms/widgets.js - About 35 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

          Function render has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

            render: function(prop) {
              var value = this.options.initValue || this.model.get(this.property);
          
              if (prop && _.isNumber(prop)) {
                value = prop;
          Severity: Minor
          Found in lib/assets/javascripts/cartodb/old_common/forms/widgets.js - About 25 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

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

            initialize: function() {
              _.bindAll(this, '_fireChange', '_checkNumber');
              this.property = this.options.property;
              this.model.bind('change', this.render, this);
          
          
          Severity: Major
          Found in lib/assets/javascripts/cartodb/old_common/forms/widgets.js and 1 other location - About 1 day to fix
          lib/assets/javascripts/cartodb/old_common/forms/widgets.js on lines 477..502

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

          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

            initialize: function() {
              _.bindAll(this, '_fireChange', '_checkNumber');
              this.property = this.options.property;
              this.model.bind('change', this.render, this);
          
          
          Severity: Major
          Found in lib/assets/javascripts/cartodb/old_common/forms/widgets.js and 1 other location - About 1 day to fix
          lib/assets/javascripts/cartodb/old_common/forms/widgets.js on lines 220..245

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

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

            _checkInputUp: function(ev) {
              this.value? null : this.value = this.model.get(this.property);
              var number = $(ev.target).val();
          
              // If it is an ENTER -> saves!
          Severity: Major
          Found in lib/assets/javascripts/cartodb/old_common/forms/widgets.js and 1 other location - About 1 day to fix
          lib/assets/javascripts/cartodb/common/forms/spinner.js on lines 121..142

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

          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

            render: function(prop) {
              var value = this.options.initValue || this.model.get(this.property);
          
              if (prop && _.isNumber(prop)) {
                value = prop;
          Severity: Major
          Found in lib/assets/javascripts/cartodb/old_common/forms/widgets.js and 1 other location - About 1 day to fix
          lib/assets/javascripts/cartodb/common/forms/spinner.js on lines 54..72

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

          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

            _saveValue: function(ev) {
              var a = {};
              var val = this.$el.find("input.value").val()
              var baseNumber = (this.options.min < 0 && this.options.max > 0)?
                0:
          Severity: Major
          Found in lib/assets/javascripts/cartodb/old_common/forms/widgets.js and 1 other location - About 7 hrs to fix
          lib/assets/javascripts/cartodb/common/forms/spinner.js on lines 156..171

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

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

            inc: function(c) {
              var a = {};
              var v = a[this.property] = this.model.get(this.property) + c;
              v = a[this.property] = Math.min(this.options.max, v.toFixed? v.toFixed(1): 1*v);
              a[this.property] = Math.max(this.options.min, v);
          Severity: Major
          Found in lib/assets/javascripts/cartodb/old_common/forms/widgets.js and 1 other location - About 7 hrs to fix
          lib/assets/javascripts/cartodb/common/forms/spinner.js on lines 83..91

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

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

            _initSlider: function() {
              var self = this;
          
              this.spinner_slider = new cdb.admin.SpinnerSlider({
                target: this.$el,
          Severity: Major
          Found in lib/assets/javascripts/cartodb/old_common/forms/widgets.js and 1 other location - About 6 hrs to fix
          lib/assets/javascripts/cartodb/old_common/forms/widgets.js on lines 555..571

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

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

            _initSlider: function() {
              var self = this;
          
              this.spinner_slider = new cdb.admin.SpinnerSlider({
                target: this.$el,
          Severity: Major
          Found in lib/assets/javascripts/cartodb/old_common/forms/widgets.js and 1 other location - About 6 hrs to fix
          lib/assets/javascripts/cartodb/old_common/forms/widgets.js on lines 302..318

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

          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

            _checkValueChange: function(ev) {
              var number = $(ev.target).val();
              number = (number == '' || number == '-')? 0 : 1*number
              if (!this._checkNumber(number)) {
                this.$el.find("input.value").val(this.value);
          Severity: Major
          Found in lib/assets/javascripts/cartodb/old_common/forms/widgets.js and 1 other location - About 5 hrs to fix
          lib/assets/javascripts/cartodb/common/forms/spinner.js on lines 144..154

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

          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

          cdb.forms.Opacity = cdb.forms.Spinner.extend({
            initialize: function() {
              _.defaults(this.options, {
                max: 1, min: 0, inc: 0.1
              });
          Severity: Major
          Found in lib/assets/javascripts/cartodb/old_common/forms/widgets.js and 1 other location - About 4 hrs to fix
          lib/assets/javascripts/cartodb/old_common/forms/widgets.js on lines 674..684

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

          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

          cdb.forms.SimpleOpacity = cdb.forms.SimpleNumber.extend({
            initialize: function() {
              _.defaults(this.options, {
                max: 1, min: 0, inc: 0.1
              });
          Severity: Major
          Found in lib/assets/javascripts/cartodb/old_common/forms/widgets.js and 1 other location - About 4 hrs to fix
          lib/assets/javascripts/cartodb/old_common/forms/widgets.js on lines 662..672

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

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

            _checkInputPress: function(ev) {
              var newChar = String.fromCharCode(ev.charCode);
          
              if(newChar == '-' || newChar == '.' || 1*newChar !== NaN) {
                return true;
          Severity: Major
          Found in lib/assets/javascripts/cartodb/old_common/forms/widgets.js and 2 other locations - About 2 hrs to fix
          lib/assets/javascripts/cartodb/common/forms/spinner.js on lines 109..119
          lib/assets/javascripts/cartodb/old_common/forms/widgets.js on lines 577..587

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

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

            _checkInputPress: function(ev) {
              var newChar = String.fromCharCode(ev.charCode);
          
              if(newChar == '-' || newChar == '.' || 1*newChar !== NaN) {
                return true;
          Severity: Major
          Found in lib/assets/javascripts/cartodb/old_common/forms/widgets.js and 2 other locations - About 2 hrs to fix
          lib/assets/javascripts/cartodb/common/forms/spinner.js on lines 109..119
          lib/assets/javascripts/cartodb/old_common/forms/widgets.js on lines 324..334

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

          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

            _destroyPicker: function() {
              if (this.color_picker) {
                this._unbindColorPicker();
                this.removeView(this.color_picker);
                this.color_picker.hide();
          Severity: Major
          Found in lib/assets/javascripts/cartodb/old_common/forms/widgets.js and 2 other locations - About 1 hr to fix
          lib/assets/javascripts/cartodb/table/basemap/basemap_dropdown/color_basemap.js on lines 75..82
          lib/assets/javascripts/cartodb/table/menu_modules/codemirror_color_picker.js on lines 111..118

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

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

              var method = this.model && this.model.get("method") && this.model.get("method").replace(/ /g,"_").toLowerCase();
          Severity: Major
          Found in lib/assets/javascripts/cartodb/old_common/forms/widgets.js and 1 other location - About 1 hr to fix
          lib/assets/javascripts/cartodb/old_common/forms/text_custom_combo.js on lines 30..30

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

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

              this._setValue(this.model && this.model.get(this.options.property) || this.options.property);
          Severity: Major
          Found in lib/assets/javascripts/cartodb/old_common/forms/widgets.js and 1 other location - About 1 hr to fix
          lib/assets/javascripts/cartodb/old_common/forms/text_custom_combo.js on lines 43..43

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

          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

            _bindColorPicker: function() {
              cdb.god.bind("closeDialogs",        this._destroyPicker, this);
              cdb.god.bind("closeDialogs:color",  this._destroyPicker, this);
            },
          Severity: Minor
          Found in lib/assets/javascripts/cartodb/old_common/forms/widgets.js and 1 other location - About 50 mins to fix
          lib/assets/javascripts/cartodb/old_common/forms/widgets.js on lines 108..111

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

          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

            _unbindColorPicker: function() {
              cdb.god.unbind("closeDialogs",        this._destroyPicker, this);
              cdb.god.unbind("closeDialogs:color",  this._destroyPicker, this);
            },
          Severity: Minor
          Found in lib/assets/javascripts/cartodb/old_common/forms/widgets.js and 1 other location - About 50 mins to fix
          lib/assets/javascripts/cartodb/old_common/forms/widgets.js on lines 103..106

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

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

            _minus: function(e) {
              e && e.preventDefault();
              this.inc(-this.options.inc);
              return false;
            },
          Severity: Minor
          Found in lib/assets/javascripts/cartodb/old_common/forms/widgets.js and 1 other location - About 40 mins to fix
          lib/assets/javascripts/cartodb/common/forms/spinner.js on lines 99..103

          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

              this.$select.attr({
                style: (this.options.width ? "width:" + this.options.width  : '')
              });
          Severity: Minor
          Found in lib/assets/javascripts/cartodb/old_common/forms/widgets.js and 1 other location - About 40 mins to fix
          lib/assets/javascripts/cartodb/old_common/forms/text_custom_combo.js on lines 33..35

          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

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

            _plus: function(e) {
              e && e.preventDefault();
              this.inc(this.options.inc);
              return false;
            },
          Severity: Minor
          Found in lib/assets/javascripts/cartodb/old_common/forms/widgets.js and 1 other location - About 35 mins to fix
          lib/assets/javascripts/cartodb/common/forms/spinner.js on lines 93..97

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

          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

          There are no issues that match your filters.

          Category
          Status