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";
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";
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";
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 = {};
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)) {
- Read upRead up
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 + ")");
- Read upRead up
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([]);
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) {
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";
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();
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) {
- Read upRead up
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")) {
- Read upRead up
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 = [];
- Read upRead up
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;
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")
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,
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([]);
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;
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,
- Read upRead up
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 = [];