juanmard/icestudio

View on GitHub
graphics/joint.shapes.js

Summary

Maintainability
F
2 mos
Test Coverage

File joint.shapes.js has 2554 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/* eslint-disable new-cap */

var os = require('os');
var sha1 = require('sha1');
var marked = require('marked');
Severity: Major
Found in graphics/joint.shapes.js - About 1 wk to fix

    Function updateBifurcations has a Cognitive Complexity of 67 (exceeds 5 allowed). Consider refactoring.
    Open

      updateBifurcations: function () {
        'use strict';
    
        if (this._V.markerBifurcations) {
          var self = this;
    Severity: Minor
    Found in graphics/joint.shapes.js - About 1 day 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 updateBox has 202 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      updateBox: function () {
        'use strict';
    
        var pendingTasks = [];
        var i, j, port, portDefault, tokId, paths, rects, dome, anotations;
    Severity: Major
    Found in graphics/joint.shapes.js - About 1 day to fix

      Function updateBox has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring.
      Open

        updateBox: function () {
          'use strict';
      
          var pendingTasks = [];
          var i, j, port, portDefault, tokId, paths, rects, dome, anotations;
      Severity: Minor
      Found in graphics/joint.shapes.js - About 7 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 updateBox has 182 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        updateBox: function () {
          'use strict';
      
          var pendingTasks = [];
          var i, j, port;
      Severity: Major
      Found in graphics/joint.shapes.js - About 7 hrs to fix

        Function updateBox has 141 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          updateBox: function () {
            'use strict';
        
            var pendingTasks = [];
            var i, port;
        Severity: Major
        Found in graphics/joint.shapes.js - About 5 hrs to fix

          Function updateBox has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
          Open

            updateBox: function () {
              'use strict';
          
              var pendingTasks = [];
              var i, j, port;
          Severity: Minor
          Found in graphics/joint.shapes.js - About 4 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 updateBifurcations has 100 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            updateBifurcations: function () {
              'use strict';
          
              if (this._V.markerBifurcations) {
                var self = this;
          Severity: Major
          Found in graphics/joint.shapes.js - About 4 hrs to fix

            Function initialize has 97 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              initialize: function () {
                'use strict';
            
                _.bindAll(this, 'updateBox');
                joint.dia.ElementView.prototype.initialize.apply(this, arguments);
            Severity: Major
            Found in graphics/joint.shapes.js - About 3 hrs to fix

              Function initialize has 94 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                initialize: function () {
                  'use strict';
              
                  _.bindAll(this, 'updateBox');
                  joint.dia.ElementView.prototype.initialize.apply(this, arguments);
              Severity: Major
              Found in graphics/joint.shapes.js - About 3 hrs to fix

                Function updateBox has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
                Open

                  updateBox: function () {
                    'use strict';
                
                    var pendingTasks = [];
                    var i, port;
                Severity: Minor
                Found in graphics/joint.shapes.js - About 3 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 initialize has 92 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  initialize: function () {
                    'use strict';
                
                    _.bindAll(this, 'updateBox');
                    joint.dia.ElementView.prototype.initialize.apply(this, arguments);
                Severity: Major
                Found in graphics/joint.shapes.js - About 3 hrs to fix

                  Function initialize has 83 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    initialize: function () {
                      'use strict';
                  
                      _.bindAll(this, 'updateBox');
                      joint.dia.ElementView.prototype.initialize.apply(this, arguments);
                  Severity: Major
                  Found in graphics/joint.shapes.js - About 3 hrs to fix

                    Function updateBox has 79 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      updateBox: function () {
                        'use strict';
                    
                        var bbox = this.model.getBBox();
                        var data = this.model.get('data');
                    Severity: Major
                    Found in graphics/joint.shapes.js - About 3 hrs to fix

                      Function getPortAttrs has 77 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        getPortAttrs: function (port, index, total, selector, type, length) {
                          'use strict';
                      
                          var attrs = {};
                          var gridsize = 8;
                      Severity: Major
                      Found in graphics/joint.shapes.js - About 3 hrs to fix

                        Function getCSSRule has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                        Open

                        function getCSSRule(ruleName) {
                          'use strict';
                        
                          if (document.styleSheets) {
                            for (var i = 0; i < document.styleSheets.length; i++) {
                        Severity: Minor
                        Found in graphics/joint.shapes.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 updatePortsAttrs has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          updatePortsAttrs: function (/*eventName*/) {
                            'use strict';
                        
                            if (this._portSelectors) {
                              var newAttrs = _.omit(this.get('attrs'), this._portSelectors);
                        Severity: Major
                        Found in graphics/joint.shapes.js - About 2 hrs to fix

                          Function updateBox has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            updateBox: function () {
                              'use strict';
                          
                              var bbox = this.model.getBBox();
                              var data = this.model.get('data');
                          Severity: Minor
                          Found in graphics/joint.shapes.js - About 1 hr to fix

                            Function renderPorts has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              renderPorts: function () {
                                'use strict';
                            
                                var $leftPorts = this.$('.leftPorts').empty();
                                var $rightPorts = this.$('.rightPorts').empty();
                            Severity: Minor
                            Found in graphics/joint.shapes.js - About 1 hr to fix

                              Function applyText has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                applyText: function () {
                                  'use strict';
                              
                                  const data = this.model.get('data');
                              
                              
                              Severity: Minor
                              Found in graphics/joint.shapes.js - About 1 hr to fix

                                Function initialize has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  initialize: function () {
                                    'use strict';
                                
                                    _.bindAll(this, 'updateBox');
                                    joint.dia.ElementView.prototype.initialize.apply(this, arguments);
                                Severity: Minor
                                Found in graphics/joint.shapes.js - About 1 hr to fix

                                  Function updateBox has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    updateBox: function () {
                                      'use strict';
                                  
                                      var bbox = this.model.getBBox();
                                      var state = this.model.get('state');
                                  Severity: Minor
                                  Found in graphics/joint.shapes.js - About 1 hr to fix

                                    Function renderLabels has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                      renderLabels: function () {
                                        'use strict';
                                    
                                        if (!this._V.labels) {
                                          return this;
                                    Severity: Minor
                                    Found in graphics/joint.shapes.js - About 1 hr to fix

                                      Function performResizing has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                        performResizing: function (event) {
                                          'use strict';
                                      
                                          var self = event.data.self;
                                      
                                      
                                      Severity: Minor
                                      Found in graphics/joint.shapes.js - About 1 hr to fix

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

                                          applyShape: function () {
                                            'use strict';
                                        
                                            var data = this.model.get('data');
                                            var name = data.name + (data.range || '');
                                        Severity: Minor
                                        Found in graphics/joint.shapes.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 updateBox has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                                        Open

                                          updateBox: function () {
                                            'use strict';
                                        
                                            var bbox = this.model.getBBox();
                                            var data = this.model.get('data');
                                        Severity: Minor
                                        Found in graphics/joint.shapes.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

                                        Avoid deeply nested control flow statements.
                                        Open

                                                      for (var j = 0; j < vB.length - 1; j++) {
                                                        // Eval if intersects any segment of wire vB
                                                        if (evalIntersection(vA[i], [vB[j], vB[j + 1]])) {
                                                          // Bifurcation found!
                                                          var point = vA[i];
                                        Severity: Major
                                        Found in graphics/joint.shapes.js - About 45 mins to fix

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

                                            getPortAttrs: function (port, index, total, selector, type, length) {
                                              'use strict';
                                          
                                              var attrs = {};
                                              var gridsize = 8;
                                          Severity: Minor
                                          Found in graphics/joint.shapes.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 updateBox has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                          Open

                                            updateBox: function () {
                                              'use strict';
                                          
                                              var bbox = this.model.getBBox();
                                              var data = this.model.get('data');
                                          Severity: Minor
                                          Found in graphics/joint.shapes.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

                                          Avoid deeply nested control flow statements.
                                          Open

                                                    if (cssRule.selectorText === ruleName) {
                                                      return cssRule;
                                                    }
                                          Severity: Major
                                          Found in graphics/joint.shapes.js - About 45 mins to fix

                                            Function getPortAttrs has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                            Open

                                              getPortAttrs: function (port, index, total, selector, type, length) {
                                            Severity: Minor
                                            Found in graphics/joint.shapes.js - About 45 mins to fix

                                              Avoid deeply nested control flow statements.
                                              Open

                                                          if (portWires[A].id !== portWires[B].id) {
                                                            // Not the same wire
                                                            findBifurcations(
                                                              portWires[A].view,
                                                              portWires[B].view,
                                              Severity: Major
                                              Found in graphics/joint.shapes.js - About 45 mins to fix

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

                                                  initialize: function () {
                                                    'use strict';
                                                
                                                    _.bindAll(this, 'updateBox');
                                                    joint.dia.ElementView.prototype.initialize.apply(this, arguments);
                                                Severity: Minor
                                                Found in graphics/joint.shapes.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 applyText has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                                Open

                                                  applyText: function () {
                                                    'use strict';
                                                
                                                    const data = this.model.get('data');
                                                
                                                
                                                Severity: Minor
                                                Found in graphics/joint.shapes.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 3 locations. Consider refactoring.
                                                Open

                                                    if (data && data.ports && data.ports.in) {
                                                      tokId = 'port-default-' + modelId + '-';
                                                      for (i = 0; i < data.ports.in.length; i++) {
                                                        port = data.ports.in[i];
                                                        portDefault = document.getElementById(tokId + port.name);
                                                Severity: Major
                                                Found in graphics/joint.shapes.js and 2 other locations - About 1 day to fix
                                                graphics/joint.shapes.js on lines 711..753
                                                graphics/joint.shapes.js on lines 2199..2240

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

                                                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

                                                    if (data && data.ports && data.ports.in) {
                                                      tokId = 'port-default-' + modelId + '-';
                                                      for (i = 0; i < data.ports.in.length; i++) {
                                                        port = data.ports.in[i];
                                                        portDefault = document.getElementById(tokId + port.name);
                                                Severity: Major
                                                Found in graphics/joint.shapes.js and 2 other locations - About 1 day to fix
                                                graphics/joint.shapes.js on lines 711..753
                                                graphics/joint.shapes.js on lines 1188..1230

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

                                                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

                                                    if (data && data.ports && data.ports.in) {
                                                      tokId = 'port-default-' + modelId + '-';
                                                      for (i = 0; i < data.ports.in.length; i++) {
                                                        port = data.ports.in[i];
                                                        portDefault = document.getElementById(tokId + port.name);
                                                Severity: Major
                                                Found in graphics/joint.shapes.js and 2 other locations - About 1 day to fix
                                                graphics/joint.shapes.js on lines 1188..1230
                                                graphics/joint.shapes.js on lines 2199..2240

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

                                                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

                                                    for (i = 0; i < this.nativeDom.virtualContentSelector.length; i++) {
                                                      pendingTasks.push({
                                                        e: this.nativeDom.virtualContentSelector[i],
                                                        property: 'left',
                                                        value: Math.round((bbox.width / 2.0) * (state.zoom - 1)) + 'px',
                                                Severity: Major
                                                Found in graphics/joint.shapes.js and 1 other location - About 1 day to fix
                                                graphics/joint.shapes.js on lines 1267..1297

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

                                                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

                                                    for (i = 0; i < this.nativeDom.fpgaContentSelector.length; i++) {
                                                      pendingTasks.push({
                                                        e: this.nativeDom.fpgaContentSelector[i],
                                                        property: 'left',
                                                        value: Math.round((bbox.width / 2.0) * (state.zoom - 1)) + 'px',
                                                Severity: Major
                                                Found in graphics/joint.shapes.js and 1 other location - About 1 day to fix
                                                graphics/joint.shapes.js on lines 1233..1263

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

                                                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

                                                    this.editor.session.on('change', function (delta) {
                                                      if (!self.updating) {
                                                        // Check consecutive-change interval
                                                        if (Date.now() - self.counter < undoGroupingInterval) {
                                                          clearTimeout(self.timer);
                                                Severity: Major
                                                Found in graphics/joint.shapes.js and 2 other locations - About 1 day to fix
                                                graphics/joint.shapes.js on lines 1646..1667
                                                graphics/joint.shapes.js on lines 2387..2408

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

                                                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

                                                    this.editor.session.on('change', function (delta) {
                                                      if (!self.updating) {
                                                        // Check consecutive-change interval
                                                        if (Date.now() - self.counter < undoGroupingInterval) {
                                                          clearTimeout(self.timer);
                                                Severity: Major
                                                Found in graphics/joint.shapes.js and 2 other locations - About 1 day to fix
                                                graphics/joint.shapes.js on lines 1940..1961
                                                graphics/joint.shapes.js on lines 2387..2408

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

                                                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

                                                    this.editor.session.on('change', function (delta) {
                                                      if (!self.updating) {
                                                        // Check consecutive-change interval
                                                        if (Date.now() - self.counter < undoGroupingInterval) {
                                                          clearTimeout(self.timer);
                                                Severity: Major
                                                Found in graphics/joint.shapes.js and 2 other locations - About 1 day to fix
                                                graphics/joint.shapes.js on lines 1646..1667
                                                graphics/joint.shapes.js on lines 1940..1961

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

                                                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

                                                  applyValue: function (opt) {
                                                    'use strict';
                                                    this.updating = true;
                                                    var data = this.model.get('data');
                                                    opt = opt || {};
                                                Severity: Major
                                                Found in graphics/joint.shapes.js and 2 other locations - About 6 hrs to fix
                                                graphics/joint.shapes.js on lines 1740..1758
                                                graphics/joint.shapes.js on lines 2005..2023

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

                                                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

                                                  applyValue: function (opt) {
                                                    'use strict';
                                                    this.updating = true;
                                                    var data = this.model.get('data');
                                                    opt = opt || {};
                                                Severity: Major
                                                Found in graphics/joint.shapes.js and 2 other locations - About 6 hrs to fix
                                                graphics/joint.shapes.js on lines 1740..1758
                                                graphics/joint.shapes.js on lines 2450..2468

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

                                                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

                                                  applyValue: function (opt) {
                                                    'use strict';
                                                    this.updating = true;
                                                    var data = this.model.get('data');
                                                    opt = opt || {};
                                                Severity: Major
                                                Found in graphics/joint.shapes.js and 2 other locations - About 6 hrs to fix
                                                graphics/joint.shapes.js on lines 2005..2023
                                                graphics/joint.shapes.js on lines 2450..2468

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

                                                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

                                                    _.each(
                                                      ['top', 'bottom'],
                                                      function (type) {
                                                        var port = type + 'Ports';
                                                        _.each(
                                                Severity: Major
                                                Found in graphics/joint.shapes.js and 1 other location - About 5 hrs to fix
                                                graphics/joint.shapes.js on lines 142..166

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

                                                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

                                                    _.each(
                                                      ['left', 'right'],
                                                      function (type) {
                                                        var port = type + 'Ports';
                                                        _.each(
                                                Severity: Major
                                                Found in graphics/joint.shapes.js and 1 other location - About 5 hrs to fix
                                                graphics/joint.shapes.js on lines 168..192

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

                                                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.editor.on('blur', function () {
                                                      self.updateScrollStatus(false);
                                                      var selection = self.editor.session.selection;
                                                      if (selection) {
                                                        selection.clearSelection();
                                                Severity: Major
                                                Found in graphics/joint.shapes.js and 1 other location - About 4 hrs to fix
                                                graphics/joint.shapes.js on lines 1675..1685

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

                                                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.editor.on('blur', function () {
                                                      self.updateScrollStatus(false);
                                                      var selection = self.editor.session.selection;
                                                      if (selection) {
                                                        selection.clearSelection();
                                                Severity: Major
                                                Found in graphics/joint.shapes.js and 1 other location - About 4 hrs to fix
                                                graphics/joint.shapes.js on lines 1969..1979

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

                                                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

                                                joint.shapes.ice.InputLabel = joint.shapes.ice.Model.extend({
                                                  markup: `<g class="rotatable">
                                                             <g class="scalable">
                                                               <rect class="body" />
                                                             </g>
                                                Severity: Major
                                                Found in graphics/joint.shapes.js and 1 other location - About 4 hrs to fix
                                                graphics/joint.shapes.js on lines 877..907

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

                                                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

                                                joint.shapes.ice.OutputLabel = joint.shapes.ice.Model.extend({
                                                  markup: `<g class="rotatable">
                                                             <g class="scalable">
                                                               <rect class="body"/>
                                                             </g>
                                                Severity: Major
                                                Found in graphics/joint.shapes.js and 1 other location - About 4 hrs to fix
                                                graphics/joint.shapes.js on lines 845..875

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

                                                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.$box.css({
                                                      left: bbox.x * state.zoom + state.pan.x,
                                                      top: bbox.y * state.zoom + state.pan.y,
                                                      width: bbox.width * state.zoom,
                                                      height: bbox.height * state.zoom,
                                                Severity: Major
                                                Found in graphics/joint.shapes.js and 1 other location - About 3 hrs to fix
                                                graphics/joint.shapes.js on lines 2623..2628

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

                                                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.$box.css({
                                                      left: bbox.x * state.zoom + state.pan.x,
                                                      top: bbox.y * state.zoom + state.pan.y,
                                                      width: bbox.width * state.zoom,
                                                      height: bbox.height * state.zoom,
                                                Severity: Major
                                                Found in graphics/joint.shapes.js and 1 other location - About 3 hrs to fix
                                                graphics/joint.shapes.js on lines 1855..1860

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

                                                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

                                                    for (i = 0; i < rightPorts.length; i++) {
                                                      port = rightPorts[i];
                                                      if (port.size > 1) {
                                                        dome = document.getElementById(tokId + port.id);
                                                
                                                
                                                Severity: Major
                                                Found in graphics/joint.shapes.js and 2 other locations - About 3 hrs to fix
                                                graphics/joint.shapes.js on lines 1175..1186
                                                graphics/joint.shapes.js on lines 2185..2196

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

                                                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

                                                    for (i = 0; i < rightPorts.length; i++) {
                                                      port = rightPorts[i];
                                                      if (port.size > 1) {
                                                        dome = document.getElementById(tokId + port.id);
                                                
                                                
                                                Severity: Major
                                                Found in graphics/joint.shapes.js and 2 other locations - About 3 hrs to fix
                                                graphics/joint.shapes.js on lines 695..706
                                                graphics/joint.shapes.js on lines 2185..2196

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

                                                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

                                                    for (i = 0; i < rightPorts.length; i++) {
                                                      port = rightPorts[i];
                                                      if (port.size > 1) {
                                                        dome = document.getElementById(tokId + port.id);
                                                
                                                
                                                Severity: Major
                                                Found in graphics/joint.shapes.js and 2 other locations - About 3 hrs to fix
                                                graphics/joint.shapes.js on lines 695..706
                                                graphics/joint.shapes.js on lines 1175..1186

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

                                                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

                                                    for (i = 0; i < leftPorts.length; i++) {
                                                      port = leftPorts[i];
                                                      if (port.size > 1) {
                                                        dome = document.getElementById(tokId + port.id);
                                                
                                                
                                                Severity: Major
                                                Found in graphics/joint.shapes.js and 2 other locations - About 3 hrs to fix
                                                graphics/joint.shapes.js on lines 1162..1173
                                                graphics/joint.shapes.js on lines 2172..2183

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

                                                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

                                                    for (i = 0; i < leftPorts.length; i++) {
                                                      port = leftPorts[i];
                                                      if (port.size > 1) {
                                                        dome = document.getElementById(tokId + port.id);
                                                
                                                
                                                Severity: Major
                                                Found in graphics/joint.shapes.js and 2 other locations - About 3 hrs to fix
                                                graphics/joint.shapes.js on lines 682..693
                                                graphics/joint.shapes.js on lines 1162..1173

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

                                                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

                                                    for (i = 0; i < leftPorts.length; i++) {
                                                      port = leftPorts[i];
                                                      if (port.size > 1) {
                                                        dome = document.getElementById(tokId + port.id);
                                                
                                                
                                                Severity: Major
                                                Found in graphics/joint.shapes.js and 2 other locations - About 3 hrs to fix
                                                graphics/joint.shapes.js on lines 682..693
                                                graphics/joint.shapes.js on lines 2172..2183

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

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

                                                joint.shapes.ice.Input = joint.shapes.ice.Model.extend({
                                                  defaults: joint.util.deepSupplement(
                                                    {
                                                      type: 'ice.Input',
                                                      size: {
                                                Severity: Major
                                                Found in graphics/joint.shapes.js and 4 other locations - About 3 hrs to fix
                                                graphics/joint.shapes.js on lines 1361..1372
                                                graphics/joint.shapes.js on lines 1570..1581
                                                graphics/joint.shapes.js on lines 1866..1877
                                                graphics/joint.shapes.js on lines 2315..2326

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

                                                joint.shapes.ice.Info = joint.shapes.ice.Model.extend({
                                                  defaults: joint.util.deepSupplement(
                                                    {
                                                      type: 'ice.Info',
                                                      size: {
                                                Severity: Major
                                                Found in graphics/joint.shapes.js and 4 other locations - About 3 hrs to fix
                                                graphics/joint.shapes.js on lines 819..830
                                                graphics/joint.shapes.js on lines 1361..1372
                                                graphics/joint.shapes.js on lines 1570..1581
                                                graphics/joint.shapes.js on lines 1866..1877

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

                                                joint.shapes.ice.Code = joint.shapes.ice.Model.extend({
                                                  defaults: joint.util.deepSupplement(
                                                    {
                                                      type: 'ice.Code',
                                                      size: {
                                                Severity: Major
                                                Found in graphics/joint.shapes.js and 4 other locations - About 3 hrs to fix
                                                graphics/joint.shapes.js on lines 819..830
                                                graphics/joint.shapes.js on lines 1361..1372
                                                graphics/joint.shapes.js on lines 1570..1581
                                                graphics/joint.shapes.js on lines 2315..2326

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

                                                joint.shapes.ice.Memory = joint.shapes.ice.Model.extend({
                                                  defaults: joint.util.deepSupplement(
                                                    {
                                                      type: 'ice.Memory',
                                                      size: {
                                                Severity: Major
                                                Found in graphics/joint.shapes.js and 4 other locations - About 3 hrs to fix
                                                graphics/joint.shapes.js on lines 819..830
                                                graphics/joint.shapes.js on lines 1361..1372
                                                graphics/joint.shapes.js on lines 1866..1877
                                                graphics/joint.shapes.js on lines 2315..2326

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

                                                joint.shapes.ice.Constant = joint.shapes.ice.Model.extend({
                                                  defaults: joint.util.deepSupplement(
                                                    {
                                                      type: 'ice.Constant',
                                                      size: {
                                                Severity: Major
                                                Found in graphics/joint.shapes.js and 4 other locations - About 3 hrs to fix
                                                graphics/joint.shapes.js on lines 819..830
                                                graphics/joint.shapes.js on lines 1570..1581
                                                graphics/joint.shapes.js on lines 1866..1877
                                                graphics/joint.shapes.js on lines 2315..2326

                                                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

                                                        } else {
                                                          // Horizontal
                                                          return (
                                                            point.y === segment[0].y &&
                                                            point.x > Math.min(segment[0].x, segment[1].x) &&
                                                Severity: Major
                                                Found in graphics/joint.shapes.js and 1 other location - About 3 hrs to fix
                                                graphics/joint.shapes.js on lines 3034..3041

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

                                                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 (segment[0].x === segment[1].x) {
                                                          // Vertical
                                                          return (
                                                            point.x === segment[0].x &&
                                                            point.y > Math.min(segment[0].y, segment[1].y) &&
                                                Severity: Major
                                                Found in graphics/joint.shapes.js and 1 other location - About 3 hrs to fix
                                                graphics/joint.shapes.js on lines 3041..3048

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

                                                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.editor.on('focus', function () {
                                                      self.updateScrollStatus(true);
                                                      self.editor.setHighlightActiveLine(true);
                                                      self.editor.setHighlightGutterLine(true);
                                                      // Show cursor
                                                Severity: Major
                                                Found in graphics/joint.shapes.js and 1 other location - About 3 hrs to fix
                                                graphics/joint.shapes.js on lines 1962..1968

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

                                                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.editor.on('focus', function () {
                                                      self.updateScrollStatus(true);
                                                      self.editor.setHighlightActiveLine(true);
                                                      self.editor.setHighlightGutterLine(true);
                                                      // Show cursor
                                                Severity: Major
                                                Found in graphics/joint.shapes.js and 1 other location - About 3 hrs to fix
                                                graphics/joint.shapes.js on lines 1668..1674

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

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

                                                    _.each(
                                                      _.filter(this.model.ports, function (p) {
                                                        return p.type === 'top';
                                                      }),
                                                      function (port, index) {
                                                Severity: Major
                                                Found in graphics/joint.shapes.js and 3 other locations - About 2 hrs to fix
                                                graphics/joint.shapes.js on lines 439..448
                                                graphics/joint.shapes.js on lines 449..458
                                                graphics/joint.shapes.js on lines 469..478

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

                                                    _.each(
                                                      _.filter(this.model.ports, function (p) {
                                                        return p.type === 'right';
                                                      }),
                                                      function (port, index) {
                                                Severity: Major
                                                Found in graphics/joint.shapes.js and 3 other locations - About 2 hrs to fix
                                                graphics/joint.shapes.js on lines 439..448
                                                graphics/joint.shapes.js on lines 459..468
                                                graphics/joint.shapes.js on lines 469..478

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

                                                    _.each(
                                                      _.filter(this.model.ports, function (p) {
                                                        return p.type === 'left';
                                                      }),
                                                      function (port, index) {
                                                Severity: Major
                                                Found in graphics/joint.shapes.js and 3 other locations - About 2 hrs to fix
                                                graphics/joint.shapes.js on lines 449..458
                                                graphics/joint.shapes.js on lines 459..468
                                                graphics/joint.shapes.js on lines 469..478

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

                                                    _.each(
                                                      _.filter(this.model.ports, function (p) {
                                                        return p.type === 'bottom';
                                                      }),
                                                      function (port, index) {
                                                Severity: Major
                                                Found in graphics/joint.shapes.js and 3 other locations - About 2 hrs to fix
                                                graphics/joint.shapes.js on lines 439..448
                                                graphics/joint.shapes.js on lines 449..458
                                                graphics/joint.shapes.js on lines 459..468

                                                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

                                                    this.editor.on('mousewheel', function (event) {
                                                      // Stop mousewheel event propagation when target is active
                                                      if (
                                                        document.activeElement.parentNode.id === self.editorSelector.attr('id')
                                                      ) {
                                                Severity: Major
                                                Found in graphics/joint.shapes.js and 2 other locations - About 2 hrs to fix
                                                graphics/joint.shapes.js on lines 1986..1997
                                                graphics/joint.shapes.js on lines 2431..2442

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

                                                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

                                                    this.editor.on('mousewheel', function (event) {
                                                      // Stop mousewheel event propagation when target is active
                                                      if (
                                                        document.activeElement.parentNode.id === self.editorSelector.attr('id')
                                                      ) {
                                                Severity: Major
                                                Found in graphics/joint.shapes.js and 2 other locations - About 2 hrs to fix
                                                graphics/joint.shapes.js on lines 1692..1703
                                                graphics/joint.shapes.js on lines 2431..2442

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

                                                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

                                                    this.editor.on('mousewheel', function (event) {
                                                      // Stop mousewheel event propagation when target is active
                                                      if (
                                                        document.activeElement.parentNode.id === self.editorSelector.attr('id')
                                                      ) {
                                                Severity: Major
                                                Found in graphics/joint.shapes.js and 2 other locations - About 2 hrs to fix
                                                graphics/joint.shapes.js on lines 1692..1703
                                                graphics/joint.shapes.js on lines 1986..1997

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

                                                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

                                                    for (i = 0; i < pendingTasks.length; i++) {
                                                      if (pendingTasks[i].e !== null) {
                                                        pendingTasks[i].e.style[pendingTasks[i].property] =
                                                          pendingTasks[i].value;
                                                      }
                                                Severity: Major
                                                Found in graphics/joint.shapes.js and 3 other locations - About 2 hrs to fix
                                                graphics/joint.selection.js on lines 454..459
                                                graphics/joint.shapes.js on lines 807..812
                                                graphics/joint.shapes.js on lines 1327..1332

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

                                                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

                                                    for (i = 0; i < pendingTasks.length; i++) {
                                                      if (pendingTasks[i].e !== null) {
                                                        pendingTasks[i].e.style[pendingTasks[i].property] =
                                                          pendingTasks[i].value;
                                                      }
                                                Severity: Major
                                                Found in graphics/joint.shapes.js and 3 other locations - About 2 hrs to fix
                                                graphics/joint.selection.js on lines 454..459
                                                graphics/joint.shapes.js on lines 807..812
                                                graphics/joint.shapes.js on lines 2294..2299

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

                                                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

                                                    for (i = 0; i < pendingTasks.length; i++) {
                                                      if (pendingTasks[i].e !== null) {
                                                        pendingTasks[i].e.style[pendingTasks[i].property] =
                                                          pendingTasks[i].value;
                                                      }
                                                Severity: Major
                                                Found in graphics/joint.shapes.js and 3 other locations - About 2 hrs to fix
                                                graphics/joint.selection.js on lines 454..459
                                                graphics/joint.shapes.js on lines 1327..1332
                                                graphics/joint.shapes.js on lines 2294..2299

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

                                                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

                                                  applyLocal: function () {
                                                    'use strict';
                                                
                                                    if (this.model.get('data').local) {
                                                      this.$box.find('svg').removeClass('hidden');
                                                Severity: Major
                                                Found in graphics/joint.shapes.js and 2 other locations - About 2 hrs to fix
                                                graphics/joint.shapes.js on lines 1089..1097
                                                graphics/joint.shapes.js on lines 1730..1738

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

                                                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

                                                  applyClock: function () {
                                                    'use strict';
                                                
                                                    if (this.model.get('data').clock) {
                                                      this.$box.find('svg').removeClass('hidden');
                                                Severity: Major
                                                Found in graphics/joint.shapes.js and 2 other locations - About 2 hrs to fix
                                                graphics/joint.shapes.js on lines 1448..1456
                                                graphics/joint.shapes.js on lines 1730..1738

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

                                                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

                                                  applyLocal: function () {
                                                    'use strict';
                                                
                                                    if (this.model.get('data').local) {
                                                      this.$box.find('svg').removeClass('hidden');
                                                Severity: Major
                                                Found in graphics/joint.shapes.js and 2 other locations - About 2 hrs to fix
                                                graphics/joint.shapes.js on lines 1089..1097
                                                graphics/joint.shapes.js on lines 1448..1456

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

                                                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

                                                  update: function () {
                                                    'use strict';
                                                
                                                    this.renderPorts();
                                                    this.editor.setReadOnly(this.model.get('disabled'));
                                                Severity: Major
                                                Found in graphics/joint.shapes.js and 1 other location - About 1 hr to fix
                                                graphics/joint.shapes.js on lines 2069..2075

                                                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

                                                  update: function () {
                                                    'use strict';
                                                
                                                    this.renderPorts();
                                                    this.editor.setReadOnly(this.model.get('disabled'));
                                                Severity: Major
                                                Found in graphics/joint.shapes.js and 1 other location - About 1 hr to fix
                                                graphics/joint.shapes.js on lines 1788..1794

                                                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

                                                  render: function () {
                                                    'use strict';
                                                
                                                    joint.dia.ElementView.prototype.render.apply(this, arguments);
                                                    this.paper.$el.append(this.$box);
                                                Severity: Major
                                                Found in graphics/joint.shapes.js and 1 other location - About 1 hr to fix
                                                graphics/joint.shapes.js on lines 420..427

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

                                                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

                                                    pendingTasks.push({
                                                      e: this.nativeDom.box,
                                                      property: 'left',
                                                      value: Math.round(bbox.x * state.zoom + state.pan.x) + 'px',
                                                    });
                                                Severity: Major
                                                Found in graphics/joint.shapes.js and 1 other location - About 1 hr to fix
                                                graphics/joint.shapes.js on lines 2272..2276

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

                                                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

                                                  render: function () {
                                                    'use strict';
                                                
                                                    joint.dia.ElementView.prototype.render.apply(this, arguments);
                                                    this.paper.$el.append(this.$box);
                                                Severity: Major
                                                Found in graphics/joint.shapes.js and 1 other location - About 1 hr to fix
                                                graphics/joint.shapes.js on lines 2562..2569

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

                                                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

                                                    pendingTasks.push({
                                                      e: this.nativeDom.box,
                                                      property: 'left',
                                                      value: Math.round(bbox.x * state.zoom + state.pan.x) + 'px',
                                                    });
                                                Severity: Major
                                                Found in graphics/joint.shapes.js and 1 other location - About 1 hr to fix
                                                graphics/joint.shapes.js on lines 1305..1309

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

                                                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

                                                    pendingTasks.push({
                                                      e: this.nativeDom.box,
                                                      property: 'top',
                                                      value: Math.round(bbox.y * state.zoom + state.pan.y) + 'px',
                                                    });
                                                Severity: Major
                                                Found in graphics/joint.shapes.js and 1 other location - About 1 hr to fix
                                                graphics/joint.shapes.js on lines 2277..2281

                                                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

                                                    pendingTasks.push({
                                                      e: this.$box[0],
                                                      property: 'left',
                                                      value: Math.round(bbox.x * state.zoom + state.pan.x) + 'px',
                                                    });
                                                Severity: Major
                                                Found in graphics/joint.shapes.js and 2 other locations - About 1 hr to fix
                                                graphics/joint.shapes.js on lines 790..794
                                                graphics/joint.shapes.js on lines 1540..1544

                                                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

                                                    pendingTasks.push({
                                                      e: this.$box[0],
                                                      property: 'top',
                                                      value: Math.round(bbox.y * state.zoom + state.pan.y) + 'px',
                                                    });
                                                Severity: Major
                                                Found in graphics/joint.shapes.js and 2 other locations - About 1 hr to fix
                                                graphics/joint.shapes.js on lines 785..789
                                                graphics/joint.shapes.js on lines 790..794

                                                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

                                                    pendingTasks.push({
                                                      e: this.$box[0],
                                                      property: 'top',
                                                      value: Math.round(bbox.y * state.zoom + state.pan.y) + 'px',
                                                    });
                                                Severity: Major
                                                Found in graphics/joint.shapes.js and 2 other locations - About 1 hr to fix
                                                graphics/joint.shapes.js on lines 785..789
                                                graphics/joint.shapes.js on lines 1540..1544

                                                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

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

                                                    pendingTasks.push({
                                                      e: this.nativeDom.box,
                                                      property: 'top',
                                                      value: Math.round(bbox.y * state.zoom + state.pan.y) + 'px',
                                                    });
                                                Severity: Major
                                                Found in graphics/joint.shapes.js and 1 other location - About 1 hr to fix
                                                graphics/joint.shapes.js on lines 1310..1314

                                                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

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

                                                        for (i = 0; i < anotations.length; i++) {
                                                          pendingTasks.push({
                                                            e: anotations[i],
                                                            property: 'background-size',
                                                            value: annotationSize + ' ' + annotationSize,
                                                Severity: Major
                                                Found in graphics/joint.shapes.js and 1 other location - About 1 hr to fix
                                                graphics/joint.shapes.js on lines 2126..2132

                                                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

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

                                                        for (i = 0; i < anotations.length; i++) {
                                                          pendingTasks.push({
                                                            e: anotations[i],
                                                            property: 'background-size',
                                                            value: annotationSize + ' ' + annotationSize,
                                                Severity: Major
                                                Found in graphics/joint.shapes.js and 1 other location - About 1 hr to fix
                                                graphics/joint.shapes.js on lines 2118..2124

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

                                                      pendingTasks.push({
                                                        e: gcontent[i],
                                                        property: 'top',
                                                        value: Math.round((bbox.height / 2.0) * (state.zoom - 1)) + 'px',
                                                      });
                                                Severity: Major
                                                Found in graphics/joint.shapes.js and 2 other locations - About 1 hr to fix
                                                graphics/joint.shapes.js on lines 758..762
                                                graphics/joint.shapes.js on lines 1499..1503

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

                                                      pendingTasks.push({
                                                        e: contentSel[i],
                                                        property: 'left',
                                                        value: Math.round((bbox.width / 2.0) * (state.zoom - 1)) + 'px',
                                                      });
                                                Severity: Major
                                                Found in graphics/joint.shapes.js and 2 other locations - About 1 hr to fix
                                                graphics/joint.shapes.js on lines 758..762
                                                graphics/joint.shapes.js on lines 763..767

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

                                                      pendingTasks.push({
                                                        e: gcontent[i],
                                                        property: 'left',
                                                        value: Math.round((bbox.width / 2.0) * (state.zoom - 1)) + 'px',
                                                      });
                                                Severity: Major
                                                Found in graphics/joint.shapes.js and 2 other locations - About 1 hr to fix
                                                graphics/joint.shapes.js on lines 763..767
                                                graphics/joint.shapes.js on lines 1499..1503

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

                                                    for (i = 0; i < pwires.length; i++) {
                                                      pendingTasks.push({
                                                        e: pwires[i],
                                                        property: 'stroke-width',
                                                        value: width + 'px',
                                                Severity: Major
                                                Found in graphics/joint.shapes.js and 2 other locations - About 1 hr to fix
                                                graphics/joint.shapes.js on lines 1152..1158
                                                graphics/joint.shapes.js on lines 2162..2168

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

                                                    for (i = 0; i < pwires.length; i++) {
                                                      pendingTasks.push({
                                                        e: pwires[i],
                                                        property: 'stroke-width',
                                                        value: width + 'px',
                                                Severity: Major
                                                Found in graphics/joint.shapes.js and 2 other locations - About 1 hr to fix
                                                graphics/joint.shapes.js on lines 1488..1494
                                                graphics/joint.shapes.js on lines 2162..2168

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

                                                    for (i = 0; i < pwires.length; i++) {
                                                      pendingTasks.push({
                                                        e: pwires[i],
                                                        property: 'stroke-width',
                                                        value: width + 'px',
                                                Severity: Major
                                                Found in graphics/joint.shapes.js and 2 other locations - About 1 hr to fix
                                                graphics/joint.shapes.js on lines 1152..1158
                                                graphics/joint.shapes.js on lines 1488..1494

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

                                                    pendingTasks.push({
                                                      e: this.nativeDom.box,
                                                      property: 'width',
                                                      value: Math.round(bbox.width * state.zoom) + 'px',
                                                    });
                                                Severity: Major
                                                Found in graphics/joint.shapes.js and 3 other locations - About 1 hr to fix
                                                graphics/joint.shapes.js on lines 1320..1324
                                                graphics/joint.shapes.js on lines 2282..2286
                                                graphics/joint.shapes.js on lines 2287..2291

                                                Duplicated Code

                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                Tuning

                                                This issue has a mass of 59.

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

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

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

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

                                                Refactorings

                                                Further Reading

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

                                                    pendingTasks.push({
                                                      e: this.$box[0],
                                                      property: 'width',
                                                      value: Math.round(bbox.width * state.zoom) + 'px',
                                                    });
                                                Severity: Major
                                                Found in graphics/joint.shapes.js and 3 other locations - About 1 hr to fix
                                                graphics/joint.shapes.js on lines 795..799
                                                graphics/joint.shapes.js on lines 800..804
                                                graphics/joint.shapes.js on lines 1550..1554

                                                Duplicated Code

                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                Tuning

                                                This issue has a mass of 59.

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

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

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

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

                                                Refactorings

                                                Further Reading

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

                                                    pendingTasks.push({
                                                      e: this.nativeDom.box,
                                                      property: 'height',
                                                      value: Math.round(bbox.height * state.zoom) + 'px',
                                                    });
                                                Severity: Major
                                                Found in graphics/joint.shapes.js and 3 other locations - About 1 hr to fix
                                                graphics/joint.shapes.js on lines 1315..1319
                                                graphics/joint.shapes.js on lines 2282..2286
                                                graphics/joint.shapes.js on lines 2287..2291

                                                Duplicated Code

                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                Tuning

                                                This issue has a mass of 59.

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

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

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

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

                                                Refactorings

                                                Further Reading

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

                                                    pendingTasks.push({
                                                      e: this.$box[0],
                                                      property: 'height',
                                                      value: Math.round(bbox.height * state.zoom) + 'px',
                                                    });
                                                Severity: Major
                                                Found in graphics/joint.shapes.js and 3 other locations - About 1 hr to fix
                                                graphics/joint.shapes.js on lines 795..799
                                                graphics/joint.shapes.js on lines 800..804
                                                graphics/joint.shapes.js on lines 1545..1549

                                                Duplicated Code

                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                Tuning

                                                This issue has a mass of 59.

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

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

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

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

                                                Refactorings

                                                Further Reading

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

                                                    pendingTasks.push({
                                                      e: this.nativeDom.box,
                                                      property: 'height',
                                                      value: Math.round(bbox.height * state.zoom) + 'px',
                                                    });
                                                Severity: Major
                                                Found in graphics/joint.shapes.js and 3 other locations - About 1 hr to fix
                                                graphics/joint.shapes.js on lines 1315..1319
                                                graphics/joint.shapes.js on lines 1320..1324
                                                graphics/joint.shapes.js on lines 2282..2286

                                                Duplicated Code

                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                Tuning

                                                This issue has a mass of 59.

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

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

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

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

                                                Refactorings

                                                Further Reading

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

                                                    pendingTasks.push({
                                                      e: this.$box[0],
                                                      property: 'height',
                                                      value: Math.round(bbox.height * state.zoom) + 'px',
                                                    });
                                                Severity: Major
                                                Found in graphics/joint.shapes.js and 3 other locations - About 1 hr to fix
                                                graphics/joint.shapes.js on lines 795..799
                                                graphics/joint.shapes.js on lines 1545..1549
                                                graphics/joint.shapes.js on lines 1550..1554

                                                Duplicated Code

                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                Tuning

                                                This issue has a mass of 59.

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

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

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

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

                                                Refactorings

                                                Further Reading

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

                                                    pendingTasks.push({
                                                      e: this.$box[0],
                                                      property: 'width',
                                                      value: Math.round(bbox.width * state.zoom) + 'px',
                                                    });
                                                Severity: Major
                                                Found in graphics/joint.shapes.js and 3 other locations - About 1 hr to fix
                                                graphics/joint.shapes.js on lines 800..804
                                                graphics/joint.shapes.js on lines 1545..1549
                                                graphics/joint.shapes.js on lines 1550..1554

                                                Duplicated Code

                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                Tuning

                                                This issue has a mass of 59.

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

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

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

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

                                                Refactorings

                                                Further Reading

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

                                                    pendingTasks.push({
                                                      e: this.nativeDom.box,
                                                      property: 'width',
                                                      value: Math.round(bbox.width * state.zoom) + 'px',
                                                    });
                                                Severity: Major
                                                Found in graphics/joint.shapes.js and 3 other locations - About 1 hr to fix
                                                graphics/joint.shapes.js on lines 1315..1319
                                                graphics/joint.shapes.js on lines 1320..1324
                                                graphics/joint.shapes.js on lines 2287..2291

                                                Duplicated Code

                                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                                Tuning

                                                This issue has a mass of 59.

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

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

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

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

                                                Refactorings

                                                Further Reading

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

                                                  enableResizer: function () {
                                                    'use strict';
                                                
                                                    if (!this.model.get('disabled')) {
                                                      this.resizerDisabled = false;
                                                Severity: Major
                                                Found in graphics/joint.shapes.js and 1 other location - About 1 hr to fix
                                                graphics/joint.shapes.js on lines 333..340

                                                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

                                                  disableResizer: function () {
                                                    'use strict';
                                                
                                                    if (!this.model.get('disabled')) {
                                                      this.resizerDisabled = true;
                                                Severity: Major
                                                Found in graphics/joint.shapes.js and 1 other location - About 1 hr to fix
                                                graphics/joint.shapes.js on lines 324..331

                                                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

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

                                                    if (data.name || data.local) {
                                                      this.headerSelector.removeClass('hidden');
                                                    } else {
                                                      this.headerSelector.addClass('hidden');
                                                    }
                                                Severity: Major
                                                Found in graphics/joint.shapes.js and 1 other location - About 1 hr to fix
                                                graphics/joint.shapes.js on lines 1848..1852

                                                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

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

                                                    if (data.name || data.local) {
                                                      this.headerSelector.removeClass('hidden');
                                                    } else {
                                                      this.headerSelector.addClass('hidden');
                                                    }
                                                Severity: Major
                                                Found in graphics/joint.shapes.js and 1 other location - About 1 hr to fix
                                                graphics/joint.shapes.js on lines 1528..1532

                                                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

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

                                                  applyName: function () {
                                                    'use strict';
                                                
                                                    var name = this.model.get('data').name;
                                                    this.$box.find('label').text(name);
                                                Severity: Major
                                                Found in graphics/joint.shapes.js and 1 other location - About 1 hr to fix
                                                graphics/joint.shapes.js on lines 1441..1446

                                                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

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

                                                  applyName: function () {
                                                    'use strict';
                                                
                                                    var name = this.model.get('data').name;
                                                    this.$box.find('label').text(name);
                                                Severity: Major
                                                Found in graphics/joint.shapes.js and 1 other location - About 1 hr to fix
                                                graphics/joint.shapes.js on lines 1723..1728

                                                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

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

                                                    this.editor.on('paste', function (e) {
                                                      if (e.text.startsWith('{"icestudio":')) {
                                                        // Prevent paste blocks
                                                        e.text = '';
                                                      }
                                                Severity: Major
                                                Found in graphics/joint.shapes.js and 2 other locations - About 55 mins to fix
                                                graphics/joint.shapes.js on lines 1686..1691
                                                graphics/joint.shapes.js on lines 2425..2430

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

                                                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

                                                    this.editor.on('paste', function (e) {
                                                      if (e.text.startsWith('{"icestudio":')) {
                                                        // Prevent paste blocks
                                                        e.text = '';
                                                      }
                                                Severity: Major
                                                Found in graphics/joint.shapes.js and 2 other locations - About 55 mins to fix
                                                graphics/joint.shapes.js on lines 1686..1691
                                                graphics/joint.shapes.js on lines 1980..1985

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

                                                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

                                                    this.editor.on('paste', function (e) {
                                                      if (e.text.startsWith('{"icestudio":')) {
                                                        // Prevent paste blocks
                                                        e.text = '';
                                                      }
                                                Severity: Major
                                                Found in graphics/joint.shapes.js and 2 other locations - About 55 mins to fix
                                                graphics/joint.shapes.js on lines 1980..1985
                                                graphics/joint.shapes.js on lines 2425..2430

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

                                                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.$box
                                                        .find('.ace_text-layer')
                                                        .css('padding', '0px ' + Math.round(4 * state.zoom) + 'px');
                                                Severity: Minor
                                                Found in graphics/joint.shapes.js and 1 other location - About 50 mins to fix
                                                graphics/joint.shapes.js on lines 1815..1817

                                                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

                                                        this.$box
                                                          .find('.ace_text-layer')
                                                          .css('padding', '0px ' + Math.round(4 * state.zoom) + 'px');
                                                Severity: Minor
                                                Found in graphics/joint.shapes.js and 1 other location - About 50 mins to fix
                                                graphics/joint.shapes.js on lines 2603..2605

                                                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

                                                          pendingTasks.push({
                                                            e: this.nativeDom.editorSelector[i],
                                                            property: 'border-radius',
                                                            value: 5 * state.zoom + 'px',
                                                          });
                                                Severity: Minor
                                                Found in graphics/joint.shapes.js and 1 other location - About 50 mins to fix
                                                graphics/joint.shapes.js on lines 2097..2101

                                                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

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

                                                          pendingTasks.push({
                                                            e: this.nativeDom.editorSelector[i],
                                                            property: 'margin',
                                                            value: 7 * state.zoom + 'px',
                                                          });
                                                Severity: Minor
                                                Found in graphics/joint.shapes.js and 1 other location - About 50 mins to fix
                                                graphics/joint.shapes.js on lines 2102..2106

                                                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

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

                                                  remove: function () {
                                                    'use strict';
                                                
                                                    joint.dia.LinkView.prototype.remove.apply(this, arguments);
                                                    this.updateBifurcations();
                                                Severity: Minor
                                                Found in graphics/joint.shapes.js and 1 other location - About 45 mins to fix
                                                graphics/joint.shapes.js on lines 2787..2793

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

                                                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

                                                  update: function () {
                                                    'use strict';
                                                
                                                    joint.dia.LinkView.prototype.update.apply(this, arguments);
                                                    this.updateBifurcations();
                                                Severity: Minor
                                                Found in graphics/joint.shapes.js and 1 other location - About 45 mins to fix
                                                graphics/joint.shapes.js on lines 2779..2785

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

                                                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

                                                  update: function () {
                                                    'use strict';
                                                
                                                    this.renderPorts();
                                                    joint.dia.ElementView.prototype.update.apply(this, arguments);
                                                Severity: Minor
                                                Found in graphics/joint.shapes.js and 2 other locations - About 35 mins to fix
                                                graphics/joint.shapes.js on lines 1128..1133
                                                graphics/joint.shapes.js on lines 1470..1475

                                                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

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

                                                  update: function () {
                                                    'use strict';
                                                
                                                    this.renderPorts();
                                                    joint.dia.ElementView.prototype.update.apply(this, arguments);
                                                Severity: Minor
                                                Found in graphics/joint.shapes.js and 2 other locations - About 35 mins to fix
                                                graphics/joint.shapes.js on lines 481..486
                                                graphics/joint.shapes.js on lines 1128..1133

                                                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

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

                                                  update: function () {
                                                    'use strict';
                                                
                                                    this.renderPorts();
                                                    joint.dia.ElementView.prototype.update.apply(this, arguments);
                                                Severity: Minor
                                                Found in graphics/joint.shapes.js and 2 other locations - About 35 mins to fix
                                                graphics/joint.shapes.js on lines 481..486
                                                graphics/joint.shapes.js on lines 1470..1475

                                                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

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

                                                      pendingTasks.push({
                                                        e: contentSel[i],
                                                        property: 'width',
                                                        value: Math.round(bbox.width) + 'px',
                                                      });
                                                Severity: Major
                                                Found in graphics/joint.shapes.js and 4 other locations - About 35 mins to fix
                                                graphics/joint.selection.js on lines 437..441
                                                graphics/joint.selection.js on lines 442..446
                                                graphics/joint.shapes.js on lines 768..772
                                                graphics/joint.shapes.js on lines 773..777

                                                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

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

                                                      pendingTasks.push({
                                                        e: gcontent[i],
                                                        property: 'width',
                                                        value: Math.round(bbox.width) + 'px',
                                                      });
                                                Severity: Major
                                                Found in graphics/joint.shapes.js and 4 other locations - About 35 mins to fix
                                                graphics/joint.selection.js on lines 437..441
                                                graphics/joint.selection.js on lines 442..446
                                                graphics/joint.shapes.js on lines 773..777
                                                graphics/joint.shapes.js on lines 1512..1516

                                                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

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

                                                      pendingTasks.push({
                                                        e: gcontent[i],
                                                        property: 'height',
                                                        value: Math.round(bbox.height) + 'px',
                                                      });
                                                Severity: Major
                                                Found in graphics/joint.shapes.js and 4 other locations - About 35 mins to fix
                                                graphics/joint.selection.js on lines 437..441
                                                graphics/joint.selection.js on lines 442..446
                                                graphics/joint.shapes.js on lines 768..772
                                                graphics/joint.shapes.js on lines 1512..1516

                                                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