patternfly/angular-patternfly

View on GitHub
src/canvas-view/canvas/canvas-viewmodel.js

Summary

Maintainability
F
1 wk
Test Coverage

Function ChartViewModel has 288 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  pfCanvas.ChartViewModel = function(chartDataModel) {
    //
    // Find a specific node within the chart.
    //
    this.findNode = function(nodeID) {
Severity: Major
Found in src/canvas-view/canvas/canvas-viewmodel.js - About 1 day to fix

    File canvas-viewmodel.js has 627 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /* eslint-disable */
    //
    // Global accessor.
    //
    var pfCanvas = {};
    Severity: Major
    Found in src/canvas-view/canvas/canvas-viewmodel.js - About 1 day to fix

      Function NodeViewModel has 104 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        pfCanvas.NodeViewModel = function(nodeDataModel) {
          this.data = nodeDataModel;
      
          // set the default width value of the node
          if (!this.data.width || this.data.width < 0) {
      Severity: Major
      Found in src/canvas-view/canvas/canvas-viewmodel.js - About 4 hrs to fix

        Function ConnectionViewModel has 67 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          pfCanvas.ConnectionViewModel = function(connectionDataModel, sourceConnector, destConnector) {
            this.data = connectionDataModel;
            this.source = sourceConnector;
            this.dest = destConnector;
        
        
        Severity: Major
        Found in src/canvas-view/canvas/canvas-viewmodel.js - About 2 hrs to fix

          Function createNewConnection has 55 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              this.createNewConnection = function(startConnector, endConnector) {
                var connectionsDataModel = this.data.connections;
                if (!connectionsDataModel) {
                  connectionsDataModel = this.data.connections = [];
                }
          Severity: Major
          Found in src/canvas-view/canvas/canvas-viewmodel.js - About 2 hrs to fix

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

                this.deleteSelected = function() {
                  var newNodeViewModels = [];
                  var newNodeDataModels = [];
            
                  var deletedNodeIds = [];
            Severity: Minor
            Found in src/canvas-view/canvas/canvas-viewmodel.js - About 1 hr to fix

              Function ZoomViewModel has 35 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                pfCanvas.ZoomViewModel = function() {
                  this.max = 1; // Max zoom level
                  this.min = parseFloat(".5"); // Min zoom level
                  this.inc = parseFloat(".25"); // Zoom level increment
                  this.level = this.max; // Zoom level
              Severity: Minor
              Found in src/canvas-view/canvas/canvas-viewmodel.js - About 1 hr to fix

                Function ConnectorViewModel has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  pfCanvas.ConnectorViewModel = function(connectorDataModel, x, y, parentNode) {
                    this.data = connectorDataModel;
                
                    this._parentNode = parentNode;
                    this._x = x;
                Severity: Minor
                Found in src/canvas-view/canvas/canvas-viewmodel.js - About 1 hr to fix

                  Avoid deeply nested control flow statements.
                  Open

                                if (destConnectorViewModel) {
                                  destConnectorViewModel.setConnected(false);
                                } else {
                                  throw new Error("Failed to find dest node of deleted connection!");
                                }
                  Severity: Major
                  Found in src/canvas-view/canvas/canvas-viewmodel.js - About 45 mins to fix

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

                        this.getSelectedConnections = function() {
                          var selectedConnections = [];
                    
                          for (var i = 0; i < this.connections.length; ++i) {
                            var connection = this.connections[i];
                    Severity: Major
                    Found in src/canvas-view/canvas/canvas-viewmodel.js and 1 other location - About 3 hrs to fix
                    src/canvas-view/canvas/canvas-viewmodel.js on lines 1035..1046

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

                        this.getSelectedNodes = function() {
                          var selectedNodes = [];
                    
                          for (var i = 0; i < this.nodes.length; ++i) {
                            var node = this.nodes[i];
                    Severity: Major
                    Found in src/canvas-view/canvas/canvas-viewmodel.js and 1 other location - About 3 hrs to fix
                    src/canvas-view/canvas/canvas-viewmodel.js on lines 1065..1076

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

                      var createNodesViewModel = function(nodesDataModel) {
                        var nodesViewModel = [];
                    
                        if (nodesDataModel) {
                          for (var i = 0; i < nodesDataModel.length; ++i) {
                    Severity: Major
                    Found in src/canvas-view/canvas/canvas-viewmodel.js and 1 other location - About 2 hrs to fix
                    src/canvas-view/canvas/canvas-viewmodel.js on lines 436..446

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

                    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

                      var createNodeActionsViewModel = function(nodeActionsDataModel) {
                        var nodeActionsViewModel = [];
                    
                        if (nodeActionsDataModel) {
                          for (var i = 0; i < nodeActionsDataModel.length; ++i) {
                    Severity: Major
                    Found in src/canvas-view/canvas/canvas-viewmodel.js and 1 other location - About 2 hrs to fix
                    src/canvas-view/canvas/canvas-viewmodel.js on lines 386..396

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

                    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.middleX = function(scale) {
                          if (angular.isUndefined(scale)) {
                            scale = 0.5;
                          }
                    
                    
                    Severity: Major
                    Found in src/canvas-view/canvas/canvas-viewmodel.js and 1 other location - About 1 hr to fix
                    src/canvas-view/canvas/canvas-viewmodel.js on lines 517..523

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

                        this.middleY = function(scale) {
                          if (angular.isUndefined(scale)) {
                            scale = 0.5;
                          }
                    
                    
                    Severity: Major
                    Found in src/canvas-view/canvas/canvas-viewmodel.js and 1 other location - About 1 hr to fix
                    src/canvas-view/canvas/canvas-viewmodel.js on lines 509..515

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

                        this.in = function() {
                          if (!this.isMax()) {
                            this.level = (this.level * 10 + this.inc * 10) / 10;
                          }
                        };
                    Severity: Major
                    Found in src/canvas-view/canvas/canvas-viewmodel.js and 1 other location - About 1 hr to fix
                    src/canvas-view/canvas/canvas-viewmodel.js on lines 1148..1152

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

                    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.out = function() {
                          if (!this.isMin()) {
                            this.level = (this.level * 10 - this.inc * 10) / 10;
                          }
                        };
                    Severity: Major
                    Found in src/canvas-view/canvas/canvas-viewmodel.js and 1 other location - About 1 hr to fix
                    src/canvas-view/canvas/canvas-viewmodel.js on lines 1139..1143

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

                    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 (startConnectorIndex === -1) {
                            startConnectorIndex = startNode.inputConnectors.indexOf(startConnector);
                            startConnectorType = 'input';
                            if (startConnectorIndex === -1) {
                              throw new Error("Failed to find source connector within either inputConnectors or outputConnectors of source node.");
                    Severity: Major
                    Found in src/canvas-view/canvas/canvas-viewmodel.js and 1 other location - About 1 hr to fix
                    src/canvas-view/canvas/canvas-viewmodel.js on lines 735..741

                    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

                          if (endConnectorIndex === -1) {
                            endConnectorIndex = endNode.outputConnectors.indexOf(endConnector);
                            endConnectorType = 'output';
                            if (endConnectorIndex === -1) {
                              throw new Error("Failed to find dest connector within inputConnectors or outputConnectors of dest node.");
                    Severity: Major
                    Found in src/canvas-view/canvas/canvas-viewmodel.js and 1 other location - About 1 hr to fix
                    src/canvas-view/canvas/canvas-viewmodel.js on lines 723..729

                    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

                      pfCanvas.computeConnectionDestTangent = function(pt1, pt2) {
                        return {
                          x: pfCanvas.computeConnectionDestTangentX(pt1, pt2),
                          y: pfCanvas.computeConnectionDestTangentY(pt1, pt2)
                        };
                    Severity: Major
                    Found in src/canvas-view/canvas/canvas-viewmodel.js and 1 other location - About 1 hr to fix
                    src/canvas-view/canvas/canvas-viewmodel.js on lines 578..583

                    Duplicated Code

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

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

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

                    Tuning

                    This issue has a mass of 58.

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

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

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

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

                    Refactorings

                    Further Reading

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

                      pfCanvas.computeConnectionSourceTangent = function(pt1, pt2) {
                        return {
                          x: pfCanvas.computeConnectionSourceTangentX(pt1, pt2),
                          y: pfCanvas.computeConnectionSourceTangentY(pt1, pt2)
                        };
                    Severity: Major
                    Found in src/canvas-view/canvas/canvas-viewmodel.js and 1 other location - About 1 hr to fix
                    src/canvas-view/canvas/canvas-viewmodel.js on lines 602..607

                    Duplicated Code

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

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

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

                    Tuning

                    This issue has a mass of 58.

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

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

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

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

                    Refactorings

                    Further Reading

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

                        this.getChartWidth = function() {
                          var width = (pfCanvas.defaultWidth / this.min) * this.getLevel();
                    
                          return width;
                        };
                    Severity: Major
                    Found in src/canvas-view/canvas/canvas-viewmodel.js and 1 other location - About 1 hr to fix
                    src/canvas-view/canvas/canvas-viewmodel.js on lines 1114..1118

                    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

                        this.getChartHeight = function() {
                          var height = (pfCanvas.defaultHeight / this.min) * this.getLevel();
                    
                          return height;
                        };
                    Severity: Major
                    Found in src/canvas-view/canvas/canvas-viewmodel.js and 1 other location - About 1 hr to fix
                    src/canvas-view/canvas/canvas-viewmodel.js on lines 1123..1127

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

                        this.sourceCoordY = function() {
                          return this.source.parentNode().y() + this.source.y();
                        };
                    Severity: Major
                    Found in src/canvas-view/canvas/canvas-viewmodel.js and 3 other locations - About 50 mins to fix
                    src/canvas-view/canvas/canvas-viewmodel.js on lines 463..465
                    src/canvas-view/canvas/canvas-viewmodel.js on lines 486..488
                    src/canvas-view/canvas/canvas-viewmodel.js on lines 490..492

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

                        this.destCoordY = function() {
                          return this.dest.parentNode().y() + this.dest.y();
                        };
                    Severity: Major
                    Found in src/canvas-view/canvas/canvas-viewmodel.js and 3 other locations - About 50 mins to fix
                    src/canvas-view/canvas/canvas-viewmodel.js on lines 463..465
                    src/canvas-view/canvas/canvas-viewmodel.js on lines 467..469
                    src/canvas-view/canvas/canvas-viewmodel.js on lines 486..488

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

                        this.destCoordX = function() {
                          return this.dest.parentNode().x() + this.dest.x();
                        };
                    Severity: Major
                    Found in src/canvas-view/canvas/canvas-viewmodel.js and 3 other locations - About 50 mins to fix
                    src/canvas-view/canvas/canvas-viewmodel.js on lines 463..465
                    src/canvas-view/canvas/canvas-viewmodel.js on lines 467..469
                    src/canvas-view/canvas/canvas-viewmodel.js on lines 490..492

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

                        this.sourceCoordX = function() {
                          return this.source.parentNode().x() + this.source.x();
                        };
                    Severity: Major
                    Found in src/canvas-view/canvas/canvas-viewmodel.js and 3 other locations - About 50 mins to fix
                    src/canvas-view/canvas/canvas-viewmodel.js on lines 467..469
                    src/canvas-view/canvas/canvas-viewmodel.js on lines 486..488
                    src/canvas-view/canvas/canvas-viewmodel.js on lines 490..492

                    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

                          for (i = 0; i < connections.length; ++i) {
                            var connection = connections[i];
                            connection.deselect();
                          }
                    Severity: Minor
                    Found in src/canvas-view/canvas/canvas-viewmodel.js and 1 other location - About 35 mins to fix
                    src/canvas-view/canvas/canvas-viewmodel.js on lines 807..810

                    Duplicated Code

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

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

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

                    Tuning

                    This issue has a mass of 46.

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

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

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

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

                    Refactorings

                    Further Reading

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

                          for (i = 0; i < connections.length; ++i) {
                            var connection = connections[i];
                            connection.select();
                          }
                    Severity: Minor
                    Found in src/canvas-view/canvas/canvas-viewmodel.js and 1 other location - About 35 mins to fix
                    src/canvas-view/canvas/canvas-viewmodel.js on lines 826..829

                    Duplicated Code

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

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

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

                    Tuning

                    This issue has a mass of 46.

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

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

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

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

                    Refactorings

                    Further Reading

                    There are no issues that match your filters.

                    Category
                    Status