Nhogs/popoto

View on GitHub

Showing 113 of 303 total issues

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

graph.loadSchemaNode = function (nodeSchema, parentNode, index, parentLinkTotalCount, parentRel, isReverse) {
Severity: Minor
Found in src/graph/graph.js - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                                for (var pid = 0; pid < targetNode.value.length; pid++) {
                                    parameters[paramName + "_" + pid] = targetNode.value[pid].attributes[constraintAttr];
                                }
    Severity: Major
    Found in src/query/query.js - About 45 mins to fix

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

      graph.loadSchemaRelation = function (relationSchema, parentNode, linkIndex, parentLinkTotalCount) {
          var targetNodeSchema = relationSchema.target;
          var target = graph.loadSchemaNode(targetNodeSchema, parentNode, linkIndex, parentLinkTotalCount, relationSchema.label, (relationSchema.hasOwnProperty("isReverse") && relationSchema.isReverse === true));
      
          var newLink = {
      Severity: Minor
      Found in src/graph/graph.js - About 45 mins to fix

      Cognitive Complexity

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

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

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

      Further reading

      Avoid deeply nested control flow statements.
      Open

                          if (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 generateQueryElements has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        query.generateQueryElements = function (rootNode, selectedNode, links, isConstraintNeeded, useCustomConstraints) {
        Severity: Minor
        Found in src/query/query.js - About 35 mins to fix

          Function addSchemaNode has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          graph.addSchemaNode = function (nodeSchema, parentNode, index, parentLinkTotalCount, parentRel) {
          Severity: Minor
          Found in src/graph/graph.js - About 35 mins to fix

            Function addRelationshipData has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            graph.addRelationshipData = function (n, l, callback, values, isNegative) {
            Severity: Minor
            Found in src/graph/graph.js - About 35 mins to fix

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

                  "getTextValue": function (link) {
                      if (link.type === graph.link.LinkTypes.VALUE) {
                          // Links between node and list of values.
              
                          if (provider.node.isTextDisplayed(link.target)) {
              Severity: Minor
              Found in src/provider/provider.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 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 computeParentAngle has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

              graph.computeParentAngle = function (n) {
                  var angleRadian = 0;
                  var r = 100;
                  if (n.parent) {
                      var xp = n.parent.x;
              Severity: Minor
              Found in src/graph/graph.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 generateQueryElements has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

              query.generateQueryElements = function (rootNode, selectedNode, links, isConstraintNeeded, useCustomConstraints) {
                  var matchElements = [];
                  var whereElements = [];
                  var relationElements = [];
                  var returnElements = [];
              Severity: Minor
              Found in src/query/query.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 render has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

              toolbar.render = function (container) {
                  var toolbar = container
                      .append("div")
                      .attr("class", "ppt-toolbar");
              
              
              Severity: Minor
              Found in src/toolbar/toolbar.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 generateTaxonomiesData has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

              taxonomy.generateTaxonomiesData = function () {
                  var id = 0;
                  var data = [];
                  // Retrieve root providers (searchable and without parent)
                  for (var label in provider.node.Provider) {
              Severity: Minor
              Found in src/taxonomy/taxonomy.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 getCSSClass has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                      "getCSSClass": function (node, element) {
                          var labelAsCSSName = node.label.replace(/[^0-9a-z\-_]/gi, '');
              
                          var cssClass = "ppt-node__" + element;
              
              
              Severity: Minor
              Found in src/provider/provider.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 getCSSClass has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                  "getCSSClass": function (link, element) {
                      var cssClass = "ppt-link__" + element;
              
                      if (link.type === graph.link.LinkTypes.VALUE) {
                          cssClass = cssClass + "--value";
              Severity: Minor
              Found in src/provider/provider.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

              Avoid too many return statements within this function.
              Open

                                  return "ppt-span";
              Severity: Major
              Found in src/queryviewer/queryviewer.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                                    return "ppt-span-value";
                Severity: Major
                Found in src/queryviewer/queryviewer.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                                      return "ppt-span";
                  Severity: Major
                  Found in src/queryviewer/queryviewer.js - About 30 mins to fix
                    Severity
                    Category
                    Status
                    Source
                    Language