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);
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;
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);
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;
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;
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) {
- 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 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) {
- 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 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;
- 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 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) {
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);
}
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) {
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);
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;
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),
];
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() {
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() {
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) {
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();
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));
}
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_;