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) {
Avoid deeply nested control flow statements. Open
for (var pid = 0; pid < targetNode.value.length; pid++) {
parameters[paramName + "_" + pid] = targetNode.value[pid].attributes[constraintAttr];
}
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 = {
- 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
Avoid deeply nested control flow statements. Open
if (dataModel.links[i].source === clickedNode) {
node.removeNode(dataModel.links[i].target);
}
Function generateQueryElements
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
query.generateQueryElements = function (rootNode, selectedNode, links, isConstraintNeeded, useCustomConstraints) {
Function addSchemaNode
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
graph.addSchemaNode = function (nodeSchema, parentNode, index, parentLinkTotalCount, parentRel) {
Function addRelationshipData
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
graph.addRelationshipData = function (n, l, callback, values, isNegative) {
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)) {
- 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 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;
- 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 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;
- 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 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++) {
- 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 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 = [];
- 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 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");
- 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 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) {
- 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 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) {
- 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 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;
- 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 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";
- 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
Avoid too many return
statements within this function. Open
return "ppt-span";
Avoid too many return
statements within this function. Open
return "ppt-span-value";
Avoid too many return
statements within this function. Open
return "ppt-span";