Nhogs/popoto

View on GitHub
src/graph/node/node.js

Summary

Maintainability
F
2 wks
Test Coverage
F
8%

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

import * as d3 from "d3";
import runner from "../../runner/runner";
import result from "../../result/result";
import cypherviewer from "../../cypherviewer/cypherviewer";
import graph from "../graph";
Severity: Major
Found in src/graph/node/node.js - About 3 days to fix

    Function nodeClick has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
    Open

    node.nodeClick = function (event) {
        if (!event.defaultPrevented) { // To avoid click on drag end
            var clickedNode = d3.select(this).data()[0]; // Clicked node data
            logger.debug("nodeClick (" + clickedNode.label + ")");
    
    
    Severity: Minor
    Found in src/graph/node/node.js - About 6 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 updateBackgroundElements has 145 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    node.updateBackgroundElements = function () {
        var nodeBackgroundElements = graph.svg.select("#" + node.gID).selectAll(".ppt-gnode").selectAll(".ppt-g-node-background");
    
        nodeBackgroundElements.select(".ppt-donut-labels").selectAll("*").remove();
        nodeBackgroundElements.select(".ppt-donut-segments").selectAll("*").remove();
    Severity: Major
    Found in src/graph/node/node.js - About 5 hrs to fix

      Function addRelatedValues has 73 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      node.addRelatedValues = function (n, values, isNegative) {
          var valuesToAdd = node.filterExistingValues(n, values);
      
          if (valuesToAdd.length <= 0) {
              return;
      Severity: Major
      Found in src/graph/node/node.js - About 2 hrs to fix

        Function addForegroundElements has 66 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        node.addForegroundElements = function (gNewNodeElements) {
            var foreground = gNewNodeElements
                .append("g")
                .attr("class", "ppt-g-node-foreground");
        
        
        Severity: Major
        Found in src/graph/node/node.js - About 2 hrs to fix

          Function loadRelationshipData has 56 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          node.loadRelationshipData = function (n, callback, directionAngle) {
              var schema = provider.node.getSchema(n.label);
          
              if (schema !== undefined) {
                  if (schema.hasOwnProperty("rel") && schema.rel.length > 0) {
          Severity: Major
          Found in src/graph/node/node.js - About 2 hrs to fix

            Function updateForegroundElements has 53 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            node.updateForegroundElements = function () {
            
                // Updates browse arrows status
                // TODO ZZZ extract variable?
                var gArrows = graph.svg.select("#" + node.gID).selectAll(".ppt-gnode").selectAll(".ppt-g-node-foreground")
            Severity: Major
            Found in src/graph/node/node.js - About 2 hrs to fix

              Function addExpandedValue has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
              Open

              node.addExpandedValue = function (attribute, value) {
              
                  var isAnyChangeDone = false;
              
                  // For each expanded nodes
              Severity: Minor
              Found in src/graph/node/node.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 clearSelection has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
              Open

              node.clearSelection = function (event) {
                  // Prevent default event like right click  opening menu.
                  event.preventDefault();
              
                  // Get clicked node.
              Severity: Minor
              Found in src/graph/node/node.js - About 1 hr to fix

              Cognitive Complexity

              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

              A method's cognitive complexity is based on a few simple rules:

              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
              • Code is considered more complex for each "break in the linear flow of the code"
              • Code is considered more complex when "flow breaking structures are nested"

              Further reading

              Function expandNode has 47 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              node.expandNode = function (clickedNode) {
              
                  graph.notifyListeners(graph.Events.GRAPH_NODE_VALUE_EXPAND, [clickedNode]);
              
                  // Get subset of node corresponding to the current node page and page size
              Severity: Minor
              Found in src/graph/node/node.js - About 1 hr to fix

                Function chooseNodeClick has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                node.chooseNodeClick = function (clickedNode) {
                    logger.debug("chooseNodeClick (" + clickedNode.label + ") with waiting state set to " + node.chooseWaiting);
                    if (!node.chooseWaiting && !clickedNode.immutable && !(clickedNode.count === 0)) {
                
                        // Collapse all expanded nodes first
                Severity: Minor
                Found in src/graph/node/node.js - About 1 hr to fix

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

                  node.removeExpandedValue = function (attribute, value) {
                      var isAnyChangeDone = false;
                  
                      // For each expanded nodes in reverse order as some values can be removed
                      for (var i = dataModel.nodes.length - 1; i >= 0; i--) {
                  Severity: Minor
                  Found in src/graph/node/node.js - About 1 hr to fix

                  Cognitive Complexity

                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                  A method's cognitive complexity is based on a few simple rules:

                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                  • Code is considered more complex for each "break in the linear flow of the code"
                  • Code is considered more complex when "flow breaking structures are nested"

                  Further reading

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

                  node.updateAutoLoadValues = function () {
                      var statements = [];
                  
                      var nodesToLoadData = node.getAutoLoadValueNodes();
                  
                  
                  Severity: Minor
                  Found in src/graph/node/node.js - About 1 hr to fix

                    Function updateElements has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    node.updateElements = function () {
                        var toUpdateElem = graph.svg.select("#" + node.gID).selectAll(".ppt-gnode");
                    
                        toUpdateElem.attr("id", function (d) {
                            return "popoto-gnode_" + d.id;
                    Severity: Minor
                    Found in src/graph/node/node.js - About 1 hr to fix

                      Function updateCount has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      node.updateCount = function () {
                          var statements = [];
                      
                          var countedNodes = dataModel.nodes
                              .filter(function (d) {
                      Severity: Minor
                      Found in src/graph/node/node.js - About 1 hr to fix

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

                        node.updateMiddlegroundElementsSymbol = function (gMiddlegroundSymbolNodes) {
                            gMiddlegroundSymbolNodes.append("circle").attr("r", function (n) {
                                return provider.node.getSize(n);
                            })
                                .attr("class", function (n) {
                        Severity: Minor
                        Found in src/graph/node/node.js - About 1 hr to fix

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

                          node.nodeClick = function (event) {
                              if (!event.defaultPrevented) { // To avoid click on drag end
                                  var clickedNode = d3.select(this).data()[0]; // Clicked node data
                                  logger.debug("nodeClick (" + clickedNode.label + ")");
                          
                          
                          Severity: Minor
                          Found in src/graph/node/node.js - About 1 hr to fix

                            Function collapseNode has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                            Open

                            node.collapseNode = function (clickedNode) {
                                if (clickedNode.valueExpanded) { // node is collapsed only if it has been expanded first
                                    logger.debug("collapseNode (" + clickedNode.label + ")");
                            
                                    graph.notifyListeners(graph.Events.GRAPH_NODE_VALUE_COLLAPSE, [clickedNode]);
                            Severity: Minor
                            Found in src/graph/node/node.js - About 1 hr to fix

                            Cognitive Complexity

                            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                            A method's cognitive complexity is based on a few simple rules:

                            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                            • Code is considered more complex for each "break in the linear flow of the code"
                            • Code is considered more complex when "flow breaking structures are nested"

                            Further reading

                            Function collapseNode has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            node.collapseNode = function (clickedNode) {
                                if (clickedNode.valueExpanded) { // node is collapsed only if it has been expanded first
                                    logger.debug("collapseNode (" + clickedNode.label + ")");
                            
                                    graph.notifyListeners(graph.Events.GRAPH_NODE_VALUE_COLLAPSE, [clickedNode]);
                            Severity: Minor
                            Found in src/graph/node/node.js - About 1 hr to fix

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

                              node.getValue = function (nodeId, constraintAttributeValue) {
                                  for (var i = 0; i < dataModel.nodes.length; i++) {
                                      var n = dataModel.nodes[i];
                              
                                      if (n.id === nodeId) {
                              Severity: Minor
                              Found in src/graph/node/node.js - About 1 hr to fix

                              Cognitive Complexity

                              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                              A method's cognitive complexity is based on a few simple rules:

                              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                              • Code is considered more complex for each "break in the linear flow of the code"
                              • Code is considered more complex when "flow breaking structures are nested"

                              Further reading

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

                              node.addValueForLabel = function (label, value) {
                                  var isAnyChangeDone = false;
                              
                                  // Find choose node with label
                                  for (var i = dataModel.nodes.length - 1; i >= 0; i--) {
                              Severity: Minor
                              Found in src/graph/node/node.js - About 1 hr to fix

                              Cognitive Complexity

                              Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                              A method's cognitive complexity is based on a few simple rules:

                              • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                              • Code is considered more complex for each "break in the linear flow of the code"
                              • Code is considered more complex when "flow breaking structures are nested"

                              Further reading

                              Avoid deeply nested control flow statements.
                              Open

                                                  if (!dataModel.nodes[i].hasOwnProperty("value")) {
                                                      dataModel.nodes[i].value = [];
                                                  }
                              Severity: Major
                              Found in src/graph/node/node.js - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                                    if (clickedNode.hasOwnProperty("value") && clickedNode.value.length > 0) {
                                
                                                    } else {
                                
                                                        if (clickedNode.isNegative) {
                                Severity: Major
                                Found in src/graph/node/node.js - About 45 mins to fix

                                  Avoid deeply nested control flow statements.
                                  Open

                                                      if (dataModel.links[i].source === clickedNode) {
                                                          node.removeNode(dataModel.links[i].target);
                                                      }
                                  Severity: Major
                                  Found in src/graph/node/node.js - About 45 mins to fix

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

                                    node.updateElements = function () {
                                        var toUpdateElem = graph.svg.select("#" + node.gID).selectAll(".ppt-gnode");
                                    
                                        toUpdateElem.attr("id", function (d) {
                                            return "popoto-gnode_" + d.id;
                                    Severity: Minor
                                    Found in src/graph/node/node.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 getContainingValue has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                    node.getContainingValue = function (label) {
                                        var nodesWithValue = [];
                                        var links = dataModel.links, nodes = dataModel.nodes;
                                    
                                        if (nodes.length > 0) {
                                    Severity: Minor
                                    Found in src/graph/node/node.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 addValue has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                    node.addValue = function (nodeIds, displayAttributeValue) {
                                        var isAnyChangeDone = false;
                                    
                                        // Find choose node with label
                                        for (var i = 0; i < dataModel.nodes.length; i++) {
                                    Severity: Minor
                                    Found in src/graph/node/node.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 removeEmptyBranches has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                    node.removeEmptyBranches = function (n) {
                                        var hasValues = n.hasOwnProperty("value") && n.value.length > 0;
                                    
                                        var childrenLinks = dataModel.links.filter(function (l) {
                                            return l.source === n;
                                    Severity: Minor
                                    Found in src/graph/node/node.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

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

                                    node.getTrunkNode = function (n) {
                                    
                                        for (var i = 0; i < dataModel.links.length; i++) {
                                            var l = dataModel.links[i];
                                            if (l.target === n) {
                                    Severity: Minor
                                    Found in src/graph/node/node.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

                                    TODO found
                                    Open

                                        // TODO Introduce an SVG tooltip instead?
                                    Severity: Minor
                                    Found in src/graph/node/node.js by fixme

                                    TODO found
                                    Open

                                     * TODO optimize with cached data?
                                    Severity: Minor
                                    Found in src/graph/node/node.js by fixme

                                    TODO found
                                    Open

                                     * TODO refactor node generation to allow future extensions (for example add plugin with new node types...)
                                    Severity: Minor
                                    Found in src/graph/node/node.js by fixme

                                    TODO found
                                    Open

                                        // TODO don't work on IE (nodes unstable) find another way to move node in foreground on mouse over?
                                    Severity: Minor
                                    Found in src/graph/node/node.js by fixme

                                    TODO found
                                    Open

                                        // TODO ZZZ extract variable?
                                    Severity: Minor
                                    Found in src/graph/node/node.js by fixme

                                    TODO found
                                    Open

                                        // TODO ZZZ move functions?
                                    Severity: Minor
                                    Found in src/graph/node/node.js by fixme

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

                                        var gSegment = nodeBackgroundElements.select(".ppt-donut-segments").selectAll(".ppt-segment-container")
                                            .data(function (d) {
                                                var relationships = [];
                                                if (d.hasOwnProperty("relationships")) {
                                                    relationships = d.relationships;
                                    Severity: Major
                                    Found in src/graph/node/node.js and 1 other location - About 1 day to fix
                                    src/graph/node/node.js on lines 502..521

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

                                    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 gLabel = nodeBackgroundElements.select(".ppt-donut-labels").selectAll(".ppt-segment-container")
                                            .data(function (n) {
                                                var relationships = [];
                                                if (n.hasOwnProperty("relationships")) {
                                                    relationships = n.relationships;
                                    Severity: Major
                                    Found in src/graph/node/node.js and 1 other location - About 1 day to fix
                                    src/graph/node/node.js on lines 476..495

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

                                    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

                                        gMiddlegroundSymbolNodes.append("use")
                                            .attr("class", function (n) {
                                                return provider.node.getCSSClass(n, "symbol")
                                            })
                                            .attr("width", function (d) {
                                    Severity: Major
                                    Found in src/graph/node/node.js and 1 other location - About 1 day to fix
                                    src/graph/node/node.js on lines 719..735

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

                                    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

                                        gMiddlegroundImageNodes.append("image")
                                            .attr("class", function (n) {
                                                return provider.node.getCSSClass(n, "image")
                                            })
                                            .attr("width", function (d) {
                                    Severity: Major
                                    Found in src/graph/node/node.js and 1 other location - About 1 day to fix
                                    src/graph/node/node.js on lines 752..768

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

                                    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

                                        gSegment.append("path")
                                            .attr("class", function (d) {
                                                var n = d3.select(this.parentNode.parentNode).datum();
                                                if (n.hasOwnProperty("count") && n.count === 0) {
                                                    return "ppt-segment disabled";
                                    Severity: Major
                                    Found in src/graph/node/node.js and 2 other locations - About 3 hrs to fix
                                    src/graph/node/node.js on lines 565..584
                                    src/graph/node/node.js on lines 603..636

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

                                    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

                                        gSegment.append("text")
                                            .attr("text-anchor", "middle")
                                            .attr("class", function (d) {
                                                var n = d3.select(this.parentNode.parentNode).datum();
                                                if (n.hasOwnProperty("count") && n.count === 0) {
                                    Severity: Major
                                    Found in src/graph/node/node.js and 2 other locations - About 3 hrs to fix
                                    src/graph/node/node.js on lines 603..626
                                    src/graph/node/node.js on lines 603..636

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

                                    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

                                                        nodeToQuery.data = data[i].filter(function (dataToFilter) {
                                                            var keepData = true;
                                                            if (nodeToQuery.hasOwnProperty("value") && nodeToQuery.value.length > 0) {
                                                                nodeToQuery.value.forEach(function (value) {
                                                                    if (value.attributes[constraintAttr] === dataToFilter[constraintAttr]) {
                                    Severity: Major
                                    Found in src/graph/node/node.js and 1 other location - About 3 hrs to fix
                                    src/graph/node/node.js on lines 1135..1145

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

                                    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

                                                        clickedNode.data = parsedData[0].filter(function (dataToFilter) {
                                                            var keepData = true;
                                                            if (clickedNode.hasOwnProperty("value") && clickedNode.value.length > 0) {
                                                                clickedNode.value.forEach(function (value) {
                                                                    if (value.attributes[constraintAttr] === dataToFilter[constraintAttr]) {
                                    Severity: Major
                                    Found in src/graph/node/node.js and 1 other location - About 3 hrs to fix
                                    src/graph/node/node.js on lines 199..209

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

                                    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 (clickedNode.value.length === 0) {
                                                    // Remove all related nodes
                                                    for (var i = dataModel.links.length - 1; i >= 0; i--) {
                                                        if (dataModel.links[i].source === clickedNode) {
                                                            node.removeNode(dataModel.links[i].target);
                                    Severity: Major
                                    Found in src/graph/node/node.js and 1 other location - About 3 hrs to fix
                                    src/graph/node/node.js on lines 989..998

                                    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

                                                            if (clickedNode.isNegative) {
                                                                // Remove all related nodes
                                                                for (var i = dataModel.links.length - 1; i >= 0; i--) {
                                                                    if (dataModel.links[i].source === clickedNode) {
                                                                        node.removeNode(dataModel.links[i].target);
                                    Severity: Major
                                    Found in src/graph/node/node.js and 1 other location - About 3 hrs to fix
                                    src/graph/node/node.js on lines 1873..1882

                                    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 (queryviewer.isActive) {
                                            // Hover the node in query
                                            queryviewer.queryConstraintSpanElements.filter(function (d) {
                                                return d.ref === hoveredNode;
                                            }).classed("hover", true);
                                    Severity: Major
                                    Found in src/graph/node/node.js and 1 other location - About 3 hrs to fix
                                    src/graph/node/node.js on lines 951..959

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

                                    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 (queryviewer.isActive) {
                                            // Remove hover class on node.
                                            queryviewer.queryConstraintSpanElements.filter(function (d) {
                                                return d.ref === hoveredNode;
                                            }).classed("hover", false);
                                    Severity: Major
                                    Found in src/graph/node/node.js and 1 other location - About 3 hrs to fix
                                    src/graph/node/node.js on lines 924..932

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

                                    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

                                    node.updateNodes = function () {
                                        var data = node.updateData();
                                        node.removeElements(data.exit());
                                        node.addNewElements(data.enter());
                                        node.updateElements();
                                    Severity: Major
                                    Found in src/graph/node/node.js and 1 other location - About 2 hrs to fix
                                    src/graph/link/link.js on lines 37..42

                                    Duplicated Code

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

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

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

                                    Tuning

                                    This issue has a mass of 80.

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

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

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

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

                                    Refactorings

                                    Further Reading

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

                                        for (var i = dataModel.links.length - 1; i >= 0; i--) {
                                            if (dataModel.links[i].target === n) {
                                                dataModel.links.splice(i, 1);
                                            }
                                        }
                                    Severity: Major
                                    Found in src/graph/node/node.js and 1 other location - About 2 hrs to fix
                                    src/graph/node/node.js on lines 1822..1826

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

                                    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 (var i = dataModel.links.length - 1; i >= 0; i--) {
                                                if (dataModel.links[i].target === n) {
                                                    dataModel.links.splice(i, 1);
                                                }
                                            }
                                    Severity: Major
                                    Found in src/graph/node/node.js and 1 other location - About 2 hrs to fix
                                    src/graph/node/node.js on lines 1791..1795

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

                                    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

                                        gMiddlegroundImageNodes.append("circle").attr("r", function (n) {
                                            return provider.node.getSize(n);
                                        })
                                            .attr("class", function (n) {
                                                return provider.node.getCSSClass(n, "image-background-circle")
                                    Severity: Major
                                    Found in src/graph/node/node.js and 1 other location - About 1 hr to fix
                                    src/graph/node/node.js on lines 739..744

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

                                    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

                                        gMiddlegroundSymbolNodes.append("circle").attr("r", function (n) {
                                            return provider.node.getSize(n);
                                        })
                                            .attr("class", function (n) {
                                                return provider.node.getCSSClass(n, "symbol-background-circle")
                                    Severity: Major
                                    Found in src/graph/node/node.js and 1 other location - About 1 hr to fix
                                    src/graph/node/node.js on lines 712..717

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

                                    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

                                        node.updateMiddlegroundElementsSymbol(middleG.filter(function (d) {
                                            return provider.node.getNodeDisplayType(d) === provider.node.DisplayTypes.SYMBOL;
                                        }));
                                    Severity: Major
                                    Found in src/graph/node/node.js and 3 other locations - About 1 hr to fix
                                    src/graph/node/node.js on lines 658..660
                                    src/graph/node/node.js on lines 662..664
                                    src/graph/node/node.js on lines 670..672

                                    Duplicated Code

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

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

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

                                    Tuning

                                    This issue has a mass of 56.

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

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

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

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

                                    Refactorings

                                    Further Reading

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

                                        node.updateMiddlegroundElementsText(middleG.filter(function (d) {
                                            return provider.node.getNodeDisplayType(d) === provider.node.DisplayTypes.TEXT;
                                        }));
                                    Severity: Major
                                    Found in src/graph/node/node.js and 3 other locations - About 1 hr to fix
                                    src/graph/node/node.js on lines 662..664
                                    src/graph/node/node.js on lines 666..668
                                    src/graph/node/node.js on lines 670..672

                                    Duplicated Code

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

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

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

                                    Tuning

                                    This issue has a mass of 56.

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

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

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

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

                                    Refactorings

                                    Further Reading

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

                                        node.updateMiddlegroundElementsImage(middleG.filter(function (d) {
                                            return provider.node.getNodeDisplayType(d) === provider.node.DisplayTypes.IMAGE;
                                        }));
                                    Severity: Major
                                    Found in src/graph/node/node.js and 3 other locations - About 1 hr to fix
                                    src/graph/node/node.js on lines 658..660
                                    src/graph/node/node.js on lines 666..668
                                    src/graph/node/node.js on lines 670..672

                                    Duplicated Code

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

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

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

                                    Tuning

                                    This issue has a mass of 56.

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

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

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

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

                                    Refactorings

                                    Further Reading

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

                                        node.updateMiddlegroundElementsSVG(middleG.filter(function (d) {
                                            return provider.node.getNodeDisplayType(d) === provider.node.DisplayTypes.SVG;
                                        }));
                                    Severity: Major
                                    Found in src/graph/node/node.js and 3 other locations - About 1 hr to fix
                                    src/graph/node/node.js on lines 658..660
                                    src/graph/node/node.js on lines 662..664
                                    src/graph/node/node.js on lines 666..668

                                    Duplicated Code

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

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

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

                                    Tuning

                                    This issue has a mass of 56.

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

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

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

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

                                    Refactorings

                                    Further Reading

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

                                        var data = graph.svg.select("#" + node.gID).selectAll(".ppt-gnode").data(dataModel.nodes, function (d) {
                                            return d.id;
                                        });
                                    Severity: Major
                                    Found in src/graph/node/node.js and 1 other location - About 1 hr to fix
                                    src/graph/link/link.js on lines 48..50

                                    Duplicated Code

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

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

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

                                    Tuning

                                    This issue has a mass of 55.

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

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

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

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

                                    Refactorings

                                    Further Reading

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

                                        gForegrounds.selectAll(".ppt-count-box").filter(function (d) {
                                            return d.type !== node.NodeTypes.CHOOSE;
                                        }).classed("root", true);
                                    Severity: Minor
                                    Found in src/graph/node/node.js and 1 other location - About 55 mins to fix
                                    src/graph/node/node.js on lines 852..854

                                    Duplicated Code

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

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

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

                                    Tuning

                                    This issue has a mass of 53.

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

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

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

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

                                    Refactorings

                                    Further Reading

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

                                        gForegrounds.selectAll(".ppt-count-box").filter(function (d) {
                                            return d.type === node.NodeTypes.CHOOSE;
                                        }).classed("value", true);
                                    Severity: Minor
                                    Found in src/graph/node/node.js and 1 other location - About 55 mins to fix
                                    src/graph/node/node.js on lines 848..850

                                    Duplicated Code

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

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

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

                                    Tuning

                                    This issue has a mass of 53.

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

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

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

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

                                    Refactorings

                                    Further Reading

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

                                        grArrow.append("circle")
                                            .attr("class", "ppt-rarrow")
                                            .attr("cx", "43")
                                            .attr("cy", "-23")
                                            .attr("r", "17");
                                    Severity: Minor
                                    Found in src/graph/node/node.js and 1 other location - About 45 mins to fix
                                    src/graph/node/node.js on lines 337..341

                                    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

                                        glArrow.append("circle")
                                            .attr("class", "ppt-larrow")
                                            .attr("cx", "-43")
                                            .attr("cy", "-23")
                                            .attr("r", "17");
                                    Severity: Minor
                                    Found in src/graph/node/node.js and 1 other location - About 45 mins to fix
                                    src/graph/node/node.js on lines 362..366

                                    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

                                                        if (!dataModel.nodes[i].hasOwnProperty("value")) {
                                                            dataModel.nodes[i].value = [];
                                                        }
                                    Severity: Minor
                                    Found in src/graph/node/node.js and 1 other location - About 40 mins to fix
                                    src/graph/node/node.js on lines 1256..1258

                                    Duplicated Code

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

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

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

                                    Tuning

                                    This issue has a mass of 49.

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

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

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

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

                                    Refactorings

                                    Further Reading

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

                                                if (!dataModel.nodes[i].hasOwnProperty("value")) {
                                                    dataModel.nodes[i].value = [];
                                                }
                                    Severity: Minor
                                    Found in src/graph/node/node.js and 1 other location - About 40 mins to fix
                                    src/graph/node/node.js on lines 1180..1182

                                    Duplicated Code

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

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

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

                                    Tuning

                                    This issue has a mass of 49.

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

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

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

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

                                    Refactorings

                                    Further Reading

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

                                        var gArrows = graph.svg.select("#" + node.gID).selectAll(".ppt-gnode").selectAll(".ppt-g-node-foreground")
                                            .selectAll(".ppt-node-foreground-g-arrows");
                                    Severity: Minor
                                    Found in src/graph/node/node.js and 1 other location - About 30 mins to fix
                                    src/graph/node/node.js on lines 886..886

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

                                    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

                                        graph.svg.select("#" + node.gID).selectAll(".ppt-gnode").selectAll(".ppt-g-node-foreground").selectAll(".ppt-g-node-ban")
                                    Severity: Minor
                                    Found in src/graph/node/node.js and 1 other location - About 30 mins to fix
                                    src/graph/node/node.js on lines 826..827

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

                                    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