GeoKnow/Jassa-Core

View on GitHub
lib/sparql/ConceptUtils.js

Summary

Maintainability
D
1 day
Test Coverage

Function createAttrQuery has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
Open

    createAttrQuery: function(attrQuery, attrVar, isLeftJoin, filterConcept, limit, offset, forceSubQuery) {

        var attrConcept = new Concept(new ElementSubQuery(attrQuery), attrVar);

        var renamedFilterConcept = ConceptUtils.createRenamedConcept(attrConcept, filterConcept);
Severity: Minor
Found in lib/sparql/ConceptUtils.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

File ConceptUtils.js has 294 lines of code (exceeds 250 allowed). Consider refactoring.
Open

var Node = require('../rdf/node/Node');
var NodeFactory = require('../rdf/NodeFactory');
var Triple = require('../rdf/Triple');

var HashMap = require('../util/collection/HashMap');
Severity: Minor
Found in lib/sparql/ConceptUtils.js - About 3 hrs to fix

    Function createAttrQuery has 75 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        createAttrQuery: function(attrQuery, attrVar, isLeftJoin, filterConcept, limit, offset, forceSubQuery) {
    
            var attrConcept = new Concept(new ElementSubQuery(attrQuery), attrVar);
    
            var renamedFilterConcept = ConceptUtils.createRenamedConcept(attrConcept, filterConcept);
    Severity: Major
    Found in lib/sparql/ConceptUtils.js - About 3 hrs to fix

      Function createCombinedConcept has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      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();
      Severity: Minor
      Found in lib/sparql/ConceptUtils.js - About 1 hr 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 createCombinedConcept has 39 lines of code (exceeds 25 allowed). Consider refactoring.
      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();
      Severity: Minor
      Found in lib/sparql/ConceptUtils.js - About 1 hr to fix

        Function createAttrQuery has 7 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            createAttrQuery: function(attrQuery, attrVar, isLeftJoin, filterConcept, limit, offset, forceSubQuery) {
        Severity: Major
        Found in lib/sparql/ConceptUtils.js - About 50 mins to fix

          Function createCombinedConcept has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              createCombinedConcept: function(attrConcept, filterConcept, renameVars, attrsOptional, filterAsSubquery) {
          Severity: Minor
          Found in lib/sparql/ConceptUtils.js - About 35 mins to fix

            There are no issues that match your filters.

            Category
            Status