GeoKnow/Jassa-Core

View on GitHub

Showing 161 of 406 total issues

Function compile has 62 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        compile: function(elem, attrs) {

            if(!this.instanceId) {
                this.instanceId = 0;
            }
Severity: Major
Found in demo/facet-typeahead-odple/facet-typeahead.js - About 2 hrs to fix

    Function peg$buildException has 61 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function peg$buildException(message, expected, pos) {
          function cleanupExpected(expected) {
            var i = 1;
    
            expected.sort(function(a, b) {
    Severity: Major
    Found in staging/sparql-parser.js - About 2 hrs to fix

      Function cacheExecution has 60 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          cacheExecution: function(keyToState, key, promiseSupplier) {
      
              var state = keyToState[key];
      
              if (state == null) {
      Severity: Major
      Found in lib/util/CacheUtils.js - About 2 hrs to fix

        HashMap has 22 functions (exceeds 20 allowed). Consider refactoring.
        Open

        var HashMap = Class.create({
        
            initialize: function(fnEquals, fnHash) {
        
                this.fnEquals = fnEquals ? fnEquals : ObjectUtils.isEqual;
        Severity: Minor
        Found in lib/util/collection/HashMap.js - About 2 hrs to fix

          Function createQueryCount has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
          Open

              createQueryCount: function(elements, limit, variable, outputVar, groupVars, useDistinct, options) {
                  var element = elements.length === 1 ? elements[0] : new ElementGroup(elements);
          
                  var exprVar = variable ? new ExprVar(variable) : null;
          
          
          Severity: Minor
          Found in lib/sparql/QueryUtils.js - About 2 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

          Function fetchFacetTreePathRec has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
          Open

              fetchFacetTreePathRec: function(facetService, facetTreeState, startPath) {
                  // startPath must not be undefined, but may be null to indicate the root facet
                  startPath = startPath || null;
          
                  var pathExpansions = facetTreeState.getPathExpansions();
          Severity: Minor
          Found in lib/facete/FacetTreeServiceHelpers.js - About 2 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 TemplateParser.js has 253 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          var uniq = require('lodash.uniq');
          
          var Class = require('../ext/Class');
          
          var ObjectUtils = require('../util/ObjectUtils');
          Severity: Minor
          Found in lib/sponate/TemplateParser.js - About 2 hrs to fix

            Function lookup has 51 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                lookup: function(ids) {
                    var self = this;
            
                    // console.log('cache status [BEFORE] ' + JSON.stringify(self.requestCache));
            
            
            Severity: Major
            Found in lib/service/lookup_service/LookupServiceCache.js - About 2 hrs to fix

              Function createQueryCount has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
              Open

                      createQueryCount: function(elements, limit, variable, outputVar, groupVars, useDistinct, options) {
              
                          var exprVar = variable ? new sparql.ExprVar(variable) : null;
              
                          
              Severity: Minor
              Found in trash/to-port/facete/QueryUtils.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 parseRdfTerm has 46 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  parseRdfTerm: function(str) { // , prefixes) {
                      if (!str) {
                          throw new Error('[ERROR] Null Pointer Exception');
                      }
              
              
              Severity: Minor
              Found in lib/rdf/NodeFactory.js - About 1 hr to fix

                Function postProcess has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    postProcess : function(state, sourceName, rootIds) {
                
                        // Retain all references
                        var accRefs = [];
                        forEach(state, function(srcMap) {
                Severity: Minor
                Found in lib/sponate/Engine.js - About 1 hr to fix

                  Function runAction has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  var runAction = function(action) {
                    var bBox = boundingBox(action.lat, action.lon, action.radius);
                  
                    var bounds = new geo.Bounds(bBox.latMin, bBox.lonMin, bBox.latMax, bBox.lonMax);
                  
                  
                  Severity: Minor
                  Found in benchmark/benchmark.js - About 1 hr to fix

                    Function createStepRelationsProperties has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        createStepRelationsProperties: function(facetConfig, pathHead, properties, isNegated) {
                            var result = [];
                    
                            var path = pathHead.getPath();
                            var isInverse = pathHead.isInverse();
                    Severity: Minor
                    Found in lib/facete/FacetUtils.js - About 1 hr to fix

                      Function execSelect has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                      Open

                          execSelect: function() {
                              //var self = this;
                      
                              var cacheKey = this.cacheKey;
                      
                      
                      Severity: Minor
                      Found in lib/service/query_execution/QueryExecutionCacheOld.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 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 createElementsAndExprs has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          createElementsAndExprs: function(facetNode, excludePath) {
                                  // var triples = [];
                              var elements = [];
                              var resultExprs = [];
                      
                      
                      Severity: Minor
                      Found in lib/facete/ConstraintManager.js - About 1 hr to fix

                        Consider simplifying this complex logical expression.
                        Open

                                } else if (ObjectUtils.isObject(obj)) {
                        
                                    // Try to figure out the class of the object
                                    // var objClassLabel = obj.classLabel;
                        
                        
                        Severity: Critical
                        Found in lib/util/Serializer.js - About 1 hr to fix

                          Function createRelationFacets has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              createRelationFacets: function(facetConfig, pathHead, singleProperty) {
                          
                                  var path = pathHead.getPath();
                                  var isInverse = pathHead.isInverse();
                          
                          
                          Severity: Minor
                          Found in lib/facete/FacetUtils.js - About 1 hr to fix

                            Function parseSpecCore has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                parseSpecCore: function(spec, prefixMapping, templateParser) {
                            
                                    templateParser = templateParser || new TemplateParser();
                            
                                    var template = spec.template;
                            Severity: Minor
                            Found in lib/sponate/SponateUtils.js - About 1 hr to fix

                              Function lastRequest has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  lastRequest: function(promiseSupplierFn, abortFn, deferredFactoryFn) {
                                      abortFn = abortFn || PromiseUtils.defaultAbortFn;
                                      deferredFactoryFn = deferredFactoryFn || PromiseUtils.defaultDeferredFn;
                              
                                      var deferred = null;
                              Severity: Minor
                              Found in lib/util/PromiseUtils.js - About 1 hr to fix
                                Severity
                                Category
                                Status
                                Source
                                Language