GeoKnow/Jassa-Core

View on GitHub

Showing 161 of 406 total issues

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

    Function createQueryCountDoesNotWorkWithVirtuoso has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
    Open

            createQueryCountDoesNotWorkWithVirtuoso: 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 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 processRefs has 39 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          processRefs: function(baseName, source) {
              var mappedConcept = source.getMappedConcept();
              var sparqlService = source.getSparqlService();
              var agg = mappedConcept.getAgg();
      
      
      Severity: Minor
      Found in lib/sponate/Context.js - About 1 hr to fix

        Function fetchResultSet has 37 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            fetchResultSet: function(nodes) {
                var self = this;
                var nodeToBindings = this.nodeToBindings;
        
                var stats = this.analyze(nodes);
        Severity: Minor
        Found in lib/service/query_cache/QueryCacheBindingHashSingle.js - About 1 hr to fix

          Function fetchFacetTreePathHeadRec has 37 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              fetchFacetTreePathHeadRec: function(facetService, facetTreeState, pathHead) {
          
                  var pathHeadToFilter = facetTreeState.getPathHeadToFilter();
                  var listFilter = pathHeadToFilter.get(pathHead) || new ListFilter(null, 10);
          
          
          Severity: Minor
          Found in lib/facete/FacetTreeServiceHelpers.js - About 1 hr to fix

            Function indexPredicates has 36 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                indexPredicates: function(predicate, keyToGroup, predicateToGroupKey, source) {
                    predicateToGroupKey = predicateToGroupKey || {};
            
                    var p = predicate.id.toString(); //;getUri();
            
            
            Severity: Minor
            Found in lib/util/ClusterUtils.js - About 1 hr to fix

              Function flatten has 36 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  flatten: function() {
              
                      // Recursively call flatten the children
                      var els = this.elements.map(function(element) {
                          var r = element.flatten();
              Severity: Minor
              Found in lib/sparql/element/ElementGroup.js - About 1 hr to fix

                Function removeValueAt has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                Open

                    removeValueAt: function(talisRdfJson, coordinate) {
                
                        var ps = talisRdfJson[coordinate.s];
                        var is = ps ? ps[coordinate.p] : null;
                        var cs = is ? is[coordinate.i] : null;
                Severity: Minor
                Found in lib/rdf/talis/TalisRdfJsonUtils.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 addMethods has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    function addMethods(source) {
                        var ancestor = this.superclass && this.superclass.prototype,
                            properties = Object.keys(source);
                        //properties = _.keys(source);
                
                
                Severity: Minor
                Found in lib/ext/Class.js - About 1 hr to fix

                  Function createQueryCount has 35 lines of code (exceeds 25 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 1 hr to fix

                    Function talisRdfJsonToTurtle has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        talisRdfJsonToTurtle: function(data, prefixMapping) {
                            var ss = Object.keys(data);
                            ss.sort();
                    
                            var result = '';
                    Severity: Minor
                    Found in lib/io/TalisRdfJsonUtils.js - About 1 hr to fix

                      Function finalizeLoading has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          finalizeLoading: function(nodes) {
                              // Restructure all nodes that have been completely loaded,
                              var parents = [];
                      
                              nodes.forEach(function(node) {
                      Severity: Minor
                      Found in lib/geo/DataServiceBboxCache.js - About 1 hr to fix

                        Function prepareListService has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            prepareListService: function(pathHead) {
                        
                                //console.log('Preparing list service for pathHead: ' + pathHead);
                        
                                // null indicates to return the root facet
                        Severity: Minor
                        Found in lib/facete/facet_service/FacetServiceSparql.js - About 1 hr to fix

                          Function createQueryCount has 35 lines of code (exceeds 25 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

                            Function deserializeState has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                deserializeState: function(id, idToState, idToObj) {
                            
                                    var result;
                            
                                    var state = idToState[id];
                            Severity: Minor
                            Found in lib/util/Serializer.js - About 1 hr to fix

                              Function result has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                      var result = ServiceUtils.fetchCountRows(this.sparqlService, concept.getElement(), this.rowLimit).then(function(countInfo) {
                                          var canUseCounts = countInfo.hasMoreItems === false;
                              
                                          // Check if we can fetch all data at once
                                          // If not, we can switch to paginated mode
                              Severity: Minor
                              Found in lib/facete/facet_value_service/FacetValueService.js - About 1 hr to fix

                                Function subdivide has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    subdivide: function() {
                                        var depth = this._depth + 1;
                                
                                        var c = this.getCenter();
                                
                                
                                Severity: Minor
                                Found in lib/geo/QuadTreeNode.js - About 1 hr to fix

                                  Function fetchFacetTreePathRec has 33 lines of code (exceeds 25 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 1 hr to fix

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

                                        lookup: function(constraints) {
                                            // Note: For now we just assume subclasses of ConstraintBasePathValue
                                    
                                            var paths = [];
                                            var uriNodes = [];
                                    Severity: Minor
                                    Found in lib/facete/lookup_service/LookupServiceConstraintLabels.js - About 1 hr to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language