Nhogs/popoto

View on GitHub

Showing 113 of 303 total issues

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

    File graph.js has 734 lines of code (exceeds 250 allowed). Consider refactoring.
    Confirmed

    import * as d3 from "d3";
    import dataModel from "../datamodel/dataModel";
    import logger from "../logger/logger";
    import provider from "../provider/provider";
    import result from "../result/result";
    Severity: Major
    Found in src/graph/graph.js - About 1 day to fix

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

      import * as d3 from "d3";
      import logger from "../logger/logger";
      import query from "../query/query";
      import graph from "../graph/graph";
      
      
      Severity: Major
      Found in src/provider/provider.js - About 1 day to fix

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

        import provider from "../provider/provider";
        import dataModel from "../datamodel/dataModel";
        
        var query = {};
        
        
        Severity: Minor
        Found in src/query/query.js - About 7 hrs to fix

          Function getProvider has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring.
          Open

          provider.node.getProvider = function (label) {
              if (label === undefined) {
                  logger.error("Node label is undefined, no label provider can be found.");
              } else {
                  if (provider.node.Provider.hasOwnProperty(label)) {
          Severity: Minor
          Found in src/provider/provider.js - About 7 hrs to fix

          Cognitive Complexity

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

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

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

          Further reading

          Function 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 updateQuery has 157 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          cypherviewer.updateQuery = function () {
          
              // Remove all query span elements
              cypherviewer.querySpanElements = cypherviewer.querySpanElements.data([]);
          
          
          Severity: Major
          Found in src/cypherviewer/cypherviewer.js - About 6 hrs to fix

            Function generateData has 155 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            cypherviewer.generateData = function (links) {
                var elmts = [], id = 0;
                var rootNode = dataModel.getRootNode();
                var relevantLinks = query.getRelevantLinks(rootNode, rootNode, links);
                var negativeLinks = relevantLinks.filter(function (rl) {
            Severity: Major
            Found in src/cypherviewer/cypherviewer.js - About 6 hrs to fix

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

              import * as d3 from "d3";
              import dataModel from "../datamodel/dataModel";
              import queryviewer from "../queryviewer/queryviewer";
              import provider from "../provider/provider";
              import query from "../query/query";
              Severity: Minor
              Found in src/cypherviewer/cypherviewer.js - About 5 hrs to fix

                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 generateData has a Cognitive Complexity of 35 (exceeds 5 allowed). Consider refactoring.
                  Open

                  cypherviewer.generateData = function (links) {
                      var elmts = [], id = 0;
                      var rootNode = dataModel.getRootNode();
                      var relevantLinks = query.getRelevantLinks(rootNode, rootNode, links);
                      var negativeLinks = relevantLinks.filter(function (rl) {
                  Severity: Minor
                  Found in src/cypherviewer/cypherviewer.js - About 5 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 getReturnAttributes has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
                  Open

                  provider.node.getReturnAttributes = function (label) {
                      var nProvider = provider.node.getProvider(label);
                      var attributes = {}; // Object is used as a Set to merge possible duplicate in parents
                  
                      if (nProvider.hasOwnProperty("returnAttributes")) {
                  Severity: Minor
                  Found in src/provider/provider.js - About 5 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 generateNodeValueConstraints has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
                  Open

                  query.generateNodeValueConstraints = function (node, useCustomConstraints) {
                      if (useCustomConstraints && provider.node.getGenerateNodeValueConstraints(node) !== undefined) {
                          return provider.node.getGenerateNodeValueConstraints(node)(node);
                      } else {
                          var parameters = {}, whereElements = [];
                  Severity: Minor
                  Found in src/query/query.js - About 4 hrs to fix

                  Cognitive Complexity

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

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

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

                  Further reading

                  Function updateResults has 87 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  result.updateResults = function () {
                      if (result.hasChanged) {
                          var resultsIndex = {};
                          var index = 0;
                  
                  
                  Severity: Major
                  Found in src/result/result.js - About 3 hrs to fix

                    Function tick has 82 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    graph.tick = function () {
                        var paths = graph.svg.selectAll("#" + graph.link.gID + " > g");
                    
                        // Update link paths
                        paths.selectAll(".ppt-link")
                    Severity: Major
                    Found in src/graph/graph.js - About 3 hrs to fix

                      Function generateResultQuery has 76 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      query.generateResultQuery = function (isGraph) {
                          var rootNode = dataModel.getRootNode();
                          var negativeElements = query.generateNegativeQueryElements();
                          var queryElements = query.generateQueryElements(rootNode, rootNode, query.getRelevantLinks(rootNode, rootNode, dataModel.links), true, true);
                          var queryMatchElements = queryElements.matchElements,
                      Severity: Major
                      Found in src/query/query.js - About 3 hrs to fix

                        Function updateQuery has 74 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        queryviewer.updateQuery = function () {
                        
                            // Remove all query span elements
                            queryviewer.queryConstraintSpanElements = queryviewer.queryConstraintSpanElements.data([]);
                            queryviewer.querySpanElements = queryviewer.querySpanElements.data([]);
                        Severity: Major
                        Found in src/queryviewer/queryviewer.js - About 2 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 generateResultQuery has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                            Open

                            query.generateResultQuery = function (isGraph) {
                                var rootNode = dataModel.getRootNode();
                                var negativeElements = query.generateNegativeQueryElements();
                                var queryElements = query.generateQueryElements(rootNode, rootNode, query.getRelevantLinks(rootNode, rootNode, dataModel.links), true, true);
                                var queryMatchElements = queryElements.matchElements,
                            Severity: Minor
                            Found in src/query/query.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 generateQueryElements has 72 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            query.generateQueryElements = function (rootNode, selectedNode, links, isConstraintNeeded, useCustomConstraints) {
                                var matchElements = [];
                                var whereElements = [];
                                var relationElements = [];
                                var returnElements = [];
                            Severity: Major
                            Found in src/query/query.js - About 2 hrs to fix
                              Severity
                              Category
                              Status
                              Source
                              Language