GeoKnow/Jassa-Core

View on GitHub

Showing 161 of 406 total issues

Function pre has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

                pre: function(scope, elem, attrs) {

                    var modelExpr = $parse(modelExprStr);
                    var pathExpr = $parse(pathExprStr);
                    var configExpr = $parse(configExprStr);
Severity: Minor
Found in demo/facet-typeahead-odple/facet-typeahead.js - About 1 hr to fix

    Function getSuggestions has 32 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        FacetTypeAheadServiceAngular.prototype.getSuggestions = function(filterString) {
            var config = this.configExpr(this.$scope);
    
            //var sparqlService = config.sparqlService;
    
    
    Severity: Minor
    Found in demo/facet-typeahead/facet-typeahead.js - About 1 hr to fix

      Function pre has 32 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

                      pre: function(scope, elem, attrs) {
      
                          var modelExpr = $parse(modelExprStr);
                          var pathExpr = $parse(pathExprStr);
                          var configExpr = $parse(configExprStr);
      Severity: Minor
      Found in demo/facet-typeahead/facet-typeahead.js - About 1 hr to fix

        Function getSuggestions has 32 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            FacetTypeAheadServiceAngular.prototype.getSuggestions = function(filterString) {
                var config = this.configExpr(this.$scope);
        
                //var sparqlService = config.sparqlService;
        
        
        Severity: Minor
        Found in demo/facet-typeahead-odple/facet-typeahead.js - About 1 hr to fix

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

            Function invalidate has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
            Open

                invalidate: function(serviceIri, graphIris, deleteEntries) {
                    if(!serviceIri) {
                        // Clear the whole cache
                        forEach(this.serviceToGraphsToCache, function(graphsToCache) {
                            graphsToCache.entries().forEach(function(entry) {
            Severity: Minor
            Found in lib/service/cache/SparqlCacheSupplier.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 finalizeLoading has a Cognitive Complexity of 11 (exceeds 5 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

            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 parseSpecCore has a Cognitive Complexity of 11 (exceeds 5 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

            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 createConstraints has 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                var createConstraints = function(idToModelPathMapping, searchFn, selectionOnly) {
            
                    var result = [];
                    var keys = Object.keys(idToModelPathMapping);
                    keys.forEach(function(key) {
            Severity: Minor
            Found in demo/facet-typeahead-odple/facet-typeahead.js - About 1 hr to fix

              Function parseArrayDynamic has 31 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  parseArrayDynamic: function(val) {
              
                      if (val.length !== 1) {
                          throw new Error('[ERROR] Arrays must have exactly one element that is either a string or an object', val);
                      }
              Severity: Minor
              Found in lib/sponate/TemplateParser.js - About 1 hr to fix

                Function createConstraints has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    var createConstraints = function(idToModelPathMapping, searchFn, selectionOnly) {
                
                        var result = [];
                        var keys = Object.keys(idToModelPathMapping);
                        keys.forEach(function(key) {
                Severity: Minor
                Found in demo/facet-typeahead/facet-typeahead.js - About 1 hr to fix

                  Function createLookupServiceNodeLabels has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      createLookupServiceNodeLabels: function(sparqlService, literalPreference, chunkSize) { //langs, predicates) {
                          //var blc = new BestLabelConfig(langs, predicates);
                          literalPreference = literalPreference || new LiteralPreference();
                          var blc = new BestLabelConfig(literalPreference);
                          var mappedConcept = MappedConceptUtils.createMappedConceptBestLabel(blc);
                  Severity: Minor
                  Found in lib/sponate/LookupServiceUtils.js - About 1 hr to fix

                    Function executeSelectRec has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        executeSelectRec: Promise.method(function(queryPaginator, prevResult) {
                            var query = queryPaginator.next();
                            //console.log('Query Pagination: ' + query);
                            if (!query) {
                                return prevResult;
                    Severity: Minor
                    Found in lib/service/query_execution/QueryExecutionPaginate.js - About 1 hr to fix

                      Function fetchCountQuery has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          fetchCountQuery: Promise.method(function(sparqlService, query, firstTimeoutInMs, limit) {
                      
                              var elements = [
                                  new ElementSubQuery(query),
                              ];
                      Severity: Minor
                      Found in lib/service/ServiceUtils.js - About 1 hr to fix

                        Function createDeferred has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            createDeferred: function(isCancellable) {
                                var _resolve;
                                var _reject;
                        
                                var promise = new Promise(function() {
                        Severity: Minor
                        Found in lib/util/PromiseUtils.js - About 1 hr to fix

                          Function lastRequestify has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              lastRequestify: function(obj) {
                                  var result = {};
                          
                                  var bind = function(val, obj) {
                                      var r = function() {
                          Severity: Minor
                          Found in lib/util/PromiseUtils.js - About 1 hr to fix

                            Function firstRequest has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                firstRequest: function(promiseSupplierFn, deferredFactoryFn) {
                                    var r = null;
                            
                                    return function() {
                                        if(r == null) {
                            Severity: Minor
                            Found in lib/util/PromiseUtils.js - About 1 hr to fix

                              Function createConceptResources has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  createConceptResources: function(facetConfig, path, excludeSelfConstraints) {
                                      var baseConcept = facetConfig.getBaseConcept();
                                      var rootFacetNode = facetConfig.getRootFacetNode();
                                      var constraintManager = facetConfig.getConstraintManager();
                              
                              
                              Severity: Minor
                              Found in lib/facete/FacetUtils.js - About 1 hr to fix

                                Function createFromTalisRdfJson has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    createFromTalisRdfJson: function(talisJson) {
                                        if (!talisJson || typeof(talisJson.type) === 'undefined') {
                                            throw new Error('Invalid node: ' + JSON.stringify(talisJson));
                                        }
                                
                                
                                Severity: Minor
                                Found in lib/rdf/NodeFactory.js - About 1 hr to fix

                                  Function purge_ has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  Cache.prototype.purge_ = function() {
                                    var tmparray = [];
                                    var purgeSize = Math.round(this.maxSize_ * this.fillFactor_);
                                    if (this.maxSize_ < 0)
                                      purgeSize = this.size() * this.fillFactor_;
                                  Severity: Minor
                                  Found in lib/ext/monsur-jscache.js - About 1 hr to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language