lib/sparql/ConceptUtils.js
Function createAttrQuery
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
Open
createAttrQuery: function(attrQuery, attrVar, isLeftJoin, filterConcept, limit, offset, forceSubQuery) {
var attrConcept = new Concept(new ElementSubQuery(attrQuery), attrVar);
var renamedFilterConcept = ConceptUtils.createRenamedConcept(attrConcept, filterConcept);
- 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
File ConceptUtils.js
has 294 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
var Node = require('../rdf/node/Node');
var NodeFactory = require('../rdf/NodeFactory');
var Triple = require('../rdf/Triple');
var HashMap = require('../util/collection/HashMap');
Function createAttrQuery
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
createAttrQuery: function(attrQuery, attrVar, isLeftJoin, filterConcept, limit, offset, forceSubQuery) {
var attrConcept = new Concept(new ElementSubQuery(attrQuery), attrVar);
var renamedFilterConcept = ConceptUtils.createRenamedConcept(attrConcept, filterConcept);
Function createCombinedConcept
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
Open
createCombinedConcept: function(attrConcept, filterConcept, renameVars, attrsOptional, filterAsSubquery) {
// TODO Is it ok to rename vars here? // TODO The variables of baseConcept and tmpConcept must match!!!
// Right now we just assume that.
var attrVar = attrConcept.getVar();
var filterVar = filterConcept.getVar();
- 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 createCombinedConcept
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
createCombinedConcept: function(attrConcept, filterConcept, renameVars, attrsOptional, filterAsSubquery) {
// TODO Is it ok to rename vars here? // TODO The variables of baseConcept and tmpConcept must match!!!
// Right now we just assume that.
var attrVar = attrConcept.getVar();
var filterVar = filterConcept.getVar();
Function createAttrQuery
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
createAttrQuery: function(attrQuery, attrVar, isLeftJoin, filterConcept, limit, offset, forceSubQuery) {
Function createCombinedConcept
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
createCombinedConcept: function(attrConcept, filterConcept, renameVars, attrsOptional, filterAsSubquery) {