CartoDB/cartodb20

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

Summary

Maintainability
F
5 days
Test Coverage

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

cdb.admin.overlays.Code = cdb.core.View.extend({

  className: "code overlay",

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

    Code has 28 functions (exceeds 20 allowed). Consider refactoring.
    Open

    cdb.admin.overlays.Code = cdb.core.View.extend({
    
      className: "code overlay",
    
      template_name: 'table/views/overlays/code',
    Severity: Minor
    Found in lib/assets/javascripts/cartodb/table/overlays/code.js - About 3 hrs to fix

      Function _addDropdown has 58 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        _addDropdown: function() {
      
          var device            = this.model.get("device");
          var horizontal_offset = 26;
          var vertical_offset   = 24;
      Severity: Major
      Found in lib/assets/javascripts/cartodb/table/overlays/code.js - About 2 hrs to fix

        Function _onMouseUp has 37 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          _onMouseUp: function(e) {
        
            // Prevents entering in the edit mode when clicking the edit button
            if (!$(e.target).parents(".overlay_text").length && !$(e.target).hasClass("overlay_text")) {
              return;
        Severity: Minor
        Found in lib/assets/javascripts/cartodb/table/overlays/code.js - About 1 hr to fix

          Consider simplifying this complex logical expression.
          Open

              if (oldX === x && y === oldY || x == 0 && landscapeDirection == "right" && y === oldY || y == 0 && portraitDirection == "bottom" && oldX === x) {
          
                this.dropdown.hide();
                this.editModel.set("mode", "editable");
          
          
          Severity: Critical
          Found in lib/assets/javascripts/cartodb/table/overlays/code.js - About 1 hr to fix

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

              _place: function() {
            
                var landscapeDirection = this.model.get("extra").landscapeDirection;
                var portraitDirection  = this.model.get("extra").portraitDirection;
            
            
            Severity: Minor
            Found in lib/assets/javascripts/cartodb/table/overlays/code.js - About 1 hr to fix

              Function _onMouseUp has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

                _onMouseUp: function(e) {
              
                  // Prevents entering in the edit mode when clicking the edit button
                  if (!$(e.target).parents(".overlay_text").length && !$(e.target).hasClass("overlay_text")) {
                    return;
              Severity: Minor
              Found in lib/assets/javascripts/cartodb/table/overlays/code.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 _onKeyUp has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                _onKeyUp: function(e) {
              
                  var self = this;
              
                  var temp      = "";
              Severity: Minor
              Found in lib/assets/javascripts/cartodb/table/overlays/code.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

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

                  if (portraitDirection == 'bottom') {
              
                    this.$el.offset({
                      top: this.model.get("y")
                    });
              Severity: Major
              Found in lib/assets/javascripts/cartodb/table/overlays/code.js and 1 other location - About 4 hrs to fix
              lib/assets/javascripts/cartodb/table/overlays/code.js on lines 556..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 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

                  if (landscapeDirection == 'right') {
              
                    this.$el.offset({
                      left: this.model.get("x")
                    });
              Severity: Major
              Found in lib/assets/javascripts/cartodb/table/overlays/code.js and 1 other location - About 4 hrs to fix
              lib/assets/javascripts/cartodb/table/overlays/code.js on lines 539..554

              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

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

              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

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

                  var rgbaCol = 'rgba(' + parseInt(boxColor.slice(-6,-4),16)
                  + ',' + parseInt(boxColor.slice(-4,-2),16)
                  + ',' + parseInt(boxColor.slice(-2),16)
                  +', ' + boxOpacity + ' )';
              Severity: Major
              Found in lib/assets/javascripts/cartodb/table/overlays/code.js and 2 other locations - About 2 hrs to fix
              lib/assets/javascripts/cartodb/table/overlays/image.js on lines 157..160
              lib/assets/javascripts/cartodb/table/overlays/text.js on lines 334..337

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

              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/code.js and 2 other locations - About 2 hrs to fix
              lib/assets/javascripts/cartodb/table/overlays/annotation.js on lines 384..391
              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/code.js and 2 other locations - About 2 hrs to fix
              lib/assets/javascripts/cartodb/table/overlays/annotation.js on lines 176..187
              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

                    if (!this.$el.hasClass("hover") && this.$text.text()) {
                      this.savingTimeout = setTimeout(function() {
              
                        self._disableEditingMode();
              
              
              Severity: Major
              Found in lib/assets/javascripts/cartodb/table/overlays/code.js and 1 other location - About 1 hr to fix
              lib/assets/javascripts/cartodb/table/overlays/image.js on lines 107..114

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

                _onMouseEnter: function() {
              
                  this.$el.addClass("hover");
                  if (this.editModel.get("mode") == "editable") {
                    if (this.timeout) clearTimeout(this.timeout);
              Severity: Major
              Found in lib/assets/javascripts/cartodb/table/overlays/code.js and 2 other locations - About 1 hr to fix
              lib/assets/javascripts/cartodb/table/overlays/annotation.js on lines 245..253
              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

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

                _onChangeDisplay: function() {
              
                  var display = this.model.get("display");
              
                  if (display) {
              Severity: Major
              Found in lib/assets/javascripts/cartodb/table/overlays/code.js and 3 other locations - About 1 hr to fix
              lib/assets/javascripts/cartodb/table/overlays/header.js on lines 103..113
              lib/assets/javascripts/cartodb/table/overlays/logo.js on lines 58..68
              lib/assets/javascripts/cartodb/table/overlays/text.js on lines 292..302

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

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

                _onChangeMode: function() {
              
                  var mode = this.editModel.get("mode");
              
                  if (mode == "editable") {
              Severity: Major
              Found in lib/assets/javascripts/cartodb/table/overlays/code.js and 6 other locations - About 1 hr to fix
              lib/assets/javascripts/builder/components/modals/add-layer/content/imports/import-bigquery/import-bigquery-form-view.js on lines 91..98
              lib/assets/javascripts/builder/components/modals/add-layer/content/imports/import-database/import-database-connect-form-view.js on lines 62..69
              lib/assets/javascripts/builder/components/modals/add-layer/content/imports/import-selected-dataset-view.js on lines 159..166
              lib/assets/javascripts/builder/components/modals/add-layer/content/imports/import-service/import-service-list-view.js on lines 66..73
              lib/assets/javascripts/cartodb/common/dialogs/create/listing/imports/import_selected_dataset_view.js on lines 159..166
              lib/assets/javascripts/cartodb/common/dialogs/create/listing/imports/service_import/service_list_view.js on lines 72..79

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

              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 (cdb.Utils.stripHTML(value) == "") {
              
                    this.keyUpTimeout = setTimeout(function() {
              
                      self.model.set({ text: "" }, { silent: true });
              Severity: Major
              Found in lib/assets/javascripts/cartodb/table/overlays/code.js and 1 other location - About 1 hr to fix
              lib/assets/javascripts/cartodb/table/overlays/image.js on lines 91..116

              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

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

                  if (oldX === x && y === oldY || x == 0 && landscapeDirection == "right" && y === oldY || y == 0 && portraitDirection == "bottom" && oldX === x) {
              
                    this.dropdown.hide();
                    this.editModel.set("mode", "editable");
              
              
              Severity: Major
              Found in lib/assets/javascripts/cartodb/table/overlays/code.js and 1 other location - About 1 hr to fix
              lib/assets/javascripts/cartodb/table/overlays/text.js on lines 182..193

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

              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

                events: {
              
                  "mouseup":           "_onMouseUp",
                  "mousedown":         "_onMouseDown",
              
              
              Severity: Major
              Found in lib/assets/javascripts/cartodb/table/overlays/code.js and 1 other location - About 1 hr to fix
              lib/assets/javascripts/cartodb/common/dialogs/create/listing/navigation_view.js on lines 15..26

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

              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 (bottomSticked) { // we sticked the overlay to the bottom of the screen
              
                    y = 0;
              
                    this.$el.css({ bottom: 0, top: "auto" });
              Severity: Minor
              Found in lib/assets/javascripts/cartodb/table/overlays/code.js and 1 other location - About 55 mins to fix
              lib/assets/javascripts/cartodb/table/overlays/code.js on lines 199..207

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

              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 (rightSticked) { // we sticked the overlay to the right side
              
                    x = 0;
              
                    this.$el.css({ right: 0, left: "auto" });
              Severity: Minor
              Found in lib/assets/javascripts/cartodb/table/overlays/code.js and 1 other location - About 55 mins to fix
              lib/assets/javascripts/cartodb/table/overlays/code.js on lines 189..197

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

              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