Showing 113 of 303 total issues
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) {
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 + ")");
Function getRelevantLinks
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
query.getRelevantLinks = function (rootNode, targetNode, initialLinks) {
var links = initialLinks.slice();
var finalLinks = [];
// Filter all links to keep only those containing a value or being the selected node.
Function render
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
fitTextRenderer.render = function (nodeSelection) {
var backgroundRectSelection = nodeSelection
.append("rect")
.attr("fill", function (node) {
Function addTaxonomyChildren
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
taxonomy.addTaxonomyChildren = function (selection) {
selection.each(function (d) {
var li = d3.select(this);
var children = d.children;
Function loadSchema
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
graph.loadSchema = function (graphToLoad) {
if (dataModel.nodes.length > 0) {
logger.warn("graph.loadSchema is called but the graph is not empty.");
}
- 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 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]);
- 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 start
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function start(startParam) {
logger.info("Popoto " + version + " start on " + startParam);
graph.mainLabel = startParam;
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]);
Function getTextValue
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
"getTextValue": function (node, maxLength) {
var text = "";
var displayAttr = provider.node.getDisplayAttribute(node.label);
if (node.type === graph.node.NodeTypes.VALUE) {
if (displayAttr === query.NEO4J_INTERNAL_ID) {
Function generateNodeCountQuery
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
query.generateNodeCountQuery = function (countedNode) {
var negativeElements = query.generateNegativeQueryElements();
var queryElements = query.generateQueryElements(dataModel.getRootNode(), countedNode, query.getRelevantLinks(dataModel.getRootNode(), countedNode, dataModel.links), true, true);
var queryMatchElements = queryElements.matchElements,
queryWhereElements = queryElements.whereElements.concat(negativeElements.whereElements),
Function getSemanticValue
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
"getSemanticValue": function (node) {
var text = "";
var displayAttr = provider.node.getDisplayAttribute(node.label);
if (node.type === graph.node.NodeTypes.VALUE) {
if (displayAttr === query.NEO4J_INTERNAL_ID) {
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--) {
- 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 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) {
- 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 checkHtmlComponents
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function checkHtmlComponents() {
var graphHTMLContainer = d3.select("#" + graph.containerId);
var taxonomyHTMLContainer = d3.select("#" + taxonomy.containerId);
var queryHTMLContainer = d3.select("#" + queryviewer.containerId);
var cypherHTMLContainer = d3.select("#" + cypherviewer.containerId);
- 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 generateNodeRelationQuery
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
query.generateNodeRelationQuery = function (targetNode) {
var linksToRoot = query.getLinksToRoot(targetNode, dataModel.links);
var queryElements = query.generateQueryElements(dataModel.getRootNode(), targetNode, linksToRoot, false, false);
Avoid deeply nested control flow statements. Open
if (clickedNode.hasOwnProperty("value") && clickedNode.value.length > 0) {
} else {
if (clickedNode.isNegative) {
Avoid deeply nested control flow statements. Open
if (nProvider.hasOwnProperty("children")) {
if (nProvider["children"].indexOf(label) > -1) {
logger.debug("No provider is defined for label (" + label + "), parent (" + p + ") will be used");
// A provider containing the required label in its children definition has been found it will be cloned.
Avoid deeply nested control flow statements. Open
if (!dataModel.nodes[i].hasOwnProperty("value")) {
dataModel.nodes[i].value = [];
}
Function getLinksToRoot
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
query.getLinksToRoot = function (node, links) {
var pathLinks = [];
var targetNode = node;
while (targetNode !== dataModel.getRootNode()) {
- 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"