CartoDB/cartodb20

View on GitHub
lib/assets/javascripts/cartodb/table/overlays/annotation.js

Summary

Maintainability
F
1 wk
Test Coverage

File annotation.js has 429 lines of code (exceeds 250 allowed). Consider refactoring.
Open

cdb.admin.overlays.Annotation = cdb.geo.ui.Annotation.extend({

  className: "annotation overlay",

  template_name: 'table/views/overlays/annotation',
Severity: Minor
Found in lib/assets/javascripts/cartodb/table/overlays/annotation.js - About 6 hrs to fix

    Annotation has 35 functions (exceeds 20 allowed). Consider refactoring.
    Open

    cdb.admin.overlays.Annotation = cdb.geo.ui.Annotation.extend({
    
      className: "annotation overlay",
    
      template_name: 'table/views/overlays/annotation',
    Severity: Minor
    Found in lib/assets/javascripts/cartodb/table/overlays/annotation.js - About 4 hrs to fix

      Function _onKeyDown has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
      Open

        _onKeyDown: function(e) {
      
          var selected = this.model.get("selected");
      
          if (selected) {
      Severity: Minor
      Found in lib/assets/javascripts/cartodb/table/overlays/annotation.js - About 2 hrs 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 _applyStyle has 50 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        _applyStyle: function() {
      
          var style      = this.model.get("style");
      
          var textAlign  = style["text-align"];
      Severity: Minor
      Found in lib/assets/javascripts/cartodb/table/overlays/annotation.js - About 2 hrs to fix

        Function _applyStyle has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

          _applyStyle: function() {
        
            var style      = this.model.get("style");
        
            var textAlign  = style["text-align"];
        Severity: Minor
        Found in lib/assets/javascripts/cartodb/table/overlays/annotation.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 initialize has 41 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          initialize: function() {
        
            _.bindAll(this, "_close", "_onChangeMode", "_onKeyDown");
        
            this.vis    = this.options.vis;
        Severity: Minor
        Found in lib/assets/javascripts/cartodb/table/overlays/annotation.js - About 1 hr to fix

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

            _onChangeSelected: function() {
          
              var selected = this.model.get("selected");
          
              if (selected) {
          Severity: Minor
          Found in lib/assets/javascripts/cartodb/table/overlays/annotation.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

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

            _enableEditingMode: function() {
          
              this.$el
              .addClass("editable")
              .addClass("disabled");
          Severity: Major
          Found in lib/assets/javascripts/cartodb/table/overlays/annotation.js and 1 other location - About 6 hrs to fix
          lib/assets/javascripts/cartodb/table/overlays/text.js on lines 401..419

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

          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

              if      (fontFamily  == "Droid Sans")       fontFamilyClass = "droid";
              else if (fontFamily  == "Vollkorn")         fontFamilyClass = "vollkorn";
              else if (fontFamily  == "Open Sans")        fontFamilyClass = "open_sans";
              else if (fontFamily  == "Roboto")           fontFamilyClass = "roboto";
              else if (fontFamily  == "Lato")             fontFamilyClass = "lato";
          Severity: Major
          Found in lib/assets/javascripts/cartodb/table/overlays/annotation.js and 1 other location - About 4 hrs to fix
          lib/assets/javascripts/cartodb/table/overlays/text.js on lines 344..351

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

          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

                }, {
                  name: 'Box',
                  form: {
                    'box-color':  { type: 'color', value: '#000', extra: { tick: "left", picker_horizontal_position: "left", picker_vertical_position: "down" }},
                    'box-opacity':  { type: 'simple_opacity', value: .7, min:0, max:1, inc: .1, disable_triggering: true },
          Severity: Major
          Found in lib/assets/javascripts/cartodb/table/overlays/annotation.js and 1 other location - About 4 hrs to fix
          lib/assets/javascripts/cartodb/table/overlays/text.js on lines 35..42

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

          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

            _transformToMarkdown: function(text) {
          
              text = markdown.toHTML(text)
          
              text = text.replace(/&lt;/g, "<");
          Severity: Major
          Found in lib/assets/javascripts/cartodb/table/overlays/annotation.js and 1 other location - About 3 hrs to fix
          lib/assets/javascripts/cartodb/table/overlays/text.js on lines 501..513

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

          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

            _bindMap: function() {
          
              this.mapView.map.bind('change',      this._place, this);
              this.mapView.map.bind('change:zoom', this._applyZoomLevelStyle, this);
              this.mapView.bind('zoomstart', this._hideOverlay, this);
          Severity: Major
          Found in lib/assets/javascripts/cartodb/table/overlays/annotation.js and 1 other location - About 3 hrs to fix
          lib/assets/javascripts/cartodb/table/overlays/annotation.js on lines 85..92

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

          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

            _unbindMap: function() {
          
              this.mapView.map.unbind('change',      this._place, this);
              this.mapView.map.unbind('change:zoom', this._applyZoomLevelStyle, this);
              this.mapView.unbind('zoomstart', this._hideOverlay, this);
          Severity: Major
          Found in lib/assets/javascripts/cartodb/table/overlays/annotation.js and 1 other location - About 3 hrs to fix
          lib/assets/javascripts/cartodb/table/overlays/annotation.js on lines 76..83

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

          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

            _onMouseLeave: function() {
              this.$el.removeClass("hover");
          
              var self = this;
          
          
          Severity: Major
          Found in lib/assets/javascripts/cartodb/table/overlays/annotation.js and 1 other location - About 2 hrs to fix
          lib/assets/javascripts/cartodb/table/overlays/code.js on lines 227..241

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

          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

            _onChangeMode: function() {
          
              var mode = this.editModel.get("mode");
          
              this.trigger('editing', mode === 'editable', this);
          Severity: Major
          Found in lib/assets/javascripts/cartodb/table/overlays/annotation.js and 2 other locations - About 2 hrs to fix
          lib/assets/javascripts/cartodb/table/overlays/image.js on lines 322..334
          lib/assets/javascripts/cartodb/table/overlays/text.js on lines 387..399

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

          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

            _onChangeExtra: function() {
          
              var extra  = this.model.get("extra");
              extra.text = this.model.get("text");
          
          
          Severity: Major
          Found in lib/assets/javascripts/cartodb/table/overlays/annotation.js and 2 other locations - About 2 hrs to fix
          lib/assets/javascripts/cartodb/table/overlays/code.js on lines 295..302
          lib/assets/javascripts/cartodb/table/overlays/text.js on lines 304..311

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

          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

            _onPaste: function(e) {
          
              var self = this;
          
              setTimeout(function() {
          Severity: Major
          Found in lib/assets/javascripts/cartodb/table/overlays/annotation.js and 2 other locations - About 2 hrs to fix
          lib/assets/javascripts/cartodb/table/overlays/code.js on lines 132..143
          lib/assets/javascripts/cartodb/table/overlays/text.js on lines 144..155

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

          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

            _onKeyUp: function(e) {
          
              if (this.timeout) {
                clearTimeout(this.timeout);
              }
          Severity: Major
          Found in lib/assets/javascripts/cartodb/table/overlays/annotation.js and 1 other location - About 1 hr to fix
          lib/assets/javascripts/cartodb/table/overlays/text.js on lines 89..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 74.

          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.$el
              .removeClass("droid")
              .removeClass("vollkorn")
              .removeClass("roboto")
              .removeClass("open_sans")
          Severity: Major
          Found in lib/assets/javascripts/cartodb/table/overlays/annotation.js and 1 other location - About 1 hr to fix
          lib/assets/javascripts/cartodb/table/overlays/text.js on lines 354..362

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

          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

            _onMouseEnter: function() {
          
              this.$el.addClass("hover");
          
              if (this.editModel.get("mode") === "editable") {
          lib/assets/javascripts/cartodb/table/overlays/code.js on lines 218..225
          lib/assets/javascripts/cartodb/table/overlays/text.js on lines 240..248

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

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

            _close: function(e) {
          
              this.killEvent(e);
          
              var self = this;
          lib/assets/javascripts/cartodb/table/overlays/fullscreen.js on lines 92..102
          lib/assets/javascripts/cartodb/table/overlays/layer_selector.js on lines 140..150
          lib/assets/javascripts/cartodb/table/overlays/loader.js on lines 103..113
          lib/assets/javascripts/cartodb/table/overlays/search.js on lines 114..124
          lib/assets/javascripts/cartodb/table/overlays/share.js on lines 109..121
          lib/assets/javascripts/cartodb/table/overlays/text.js on lines 280..290
          lib/assets/javascripts/cartodb/table/overlays/zoom.js on lines 131..141

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

          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

                if (editable && !focus) {
                  if (e.which == 67 && (e.ctrlKey || e.metaKey)) {
                    this.trigger('duplicate', this.model, this);
                  }
                }
          Severity: Minor
          Found in lib/assets/javascripts/cartodb/table/overlays/annotation.js and 1 other location - About 50 mins to fix
          lib/assets/javascripts/cartodb/table/overlays/text.js on lines 131..135

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

            events: {
          
              "mouseenter .text":   "_onMouseEnter",
              "mouseup":            "_onMouseUp",
          
          
          Severity: Major
          Found in lib/assets/javascripts/cartodb/table/overlays/annotation.js and 2 other locations - About 50 mins to fix
          lib/assets/javascripts/cartodb/table/header_dropdown.js on lines 10..20
          lib/assets/javascripts/cartodb/table/overlays/mobile.js on lines 415..425

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

          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

            _onCloseDialogs: function() {
              if (this.model.get("selected") !== undefined) this.model.set("selected", false);
            },
          Severity: Minor
          Found in lib/assets/javascripts/cartodb/table/overlays/annotation.js and 1 other location - About 35 mins to fix
          lib/assets/javascripts/cartodb/table/overlays/text.js on lines 569..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 46.

          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

          Refactorings

          Further Reading

          There are no issues that match your filters.

          Category
          Status