Showing 161 of 406 total issues
Function lastRequest
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
lastRequest: function(promiseSupplierFn, abortFn, deferredFactoryFn) {
abortFn = abortFn || PromiseUtils.defaultAbortFn;
deferredFactoryFn = deferredFactoryFn || PromiseUtils.defaultDeferredFn;
var deferred = null;
Function createQueryCountDoesNotWorkWithVirtuoso
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
Open
createQueryCountDoesNotWorkWithVirtuoso: function(elements, limit, variable, outputVar, groupVars, useDistinct, options) {
var exprVar = variable ? new sparql.ExprVar(variable) : null;
- 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 createCombinedConcept
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
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();
Function processRefs
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
processRefs: function(baseName, source) {
var mappedConcept = source.getMappedConcept();
var sparqlService = source.getSparqlService();
var agg = mappedConcept.getAgg();
Function fetchResultSet
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
fetchResultSet: function(nodes) {
var self = this;
var nodeToBindings = this.nodeToBindings;
var stats = this.analyze(nodes);
Function fetchFacetTreePathHeadRec
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
fetchFacetTreePathHeadRec: function(facetService, facetTreeState, pathHead) {
var pathHeadToFilter = facetTreeState.getPathHeadToFilter();
var listFilter = pathHeadToFilter.get(pathHead) || new ListFilter(null, 10);
Function indexPredicates
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
indexPredicates: function(predicate, keyToGroup, predicateToGroupKey, source) {
predicateToGroupKey = predicateToGroupKey || {};
var p = predicate.id.toString(); //;getUri();
Function flatten
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
flatten: function() {
// Recursively call flatten the children
var els = this.elements.map(function(element) {
var r = element.flatten();
Function removeValueAt
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
Open
removeValueAt: function(talisRdfJson, coordinate) {
var ps = talisRdfJson[coordinate.s];
var is = ps ? ps[coordinate.p] : null;
var cs = is ? is[coordinate.i] : null;
- 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 addMethods
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function addMethods(source) {
var ancestor = this.superclass && this.superclass.prototype,
properties = Object.keys(source);
//properties = _.keys(source);
Function createQueryCount
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
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;
Function talisRdfJsonToTurtle
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
talisRdfJsonToTurtle: function(data, prefixMapping) {
var ss = Object.keys(data);
ss.sort();
var result = '';
Function finalizeLoading
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
finalizeLoading: function(nodes) {
// Restructure all nodes that have been completely loaded,
var parents = [];
nodes.forEach(function(node) {
Function prepareListService
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
prepareListService: function(pathHead) {
//console.log('Preparing list service for pathHead: ' + pathHead);
// null indicates to return the root facet
Function createQueryCount
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
createQueryCount: function(elements, limit, variable, outputVar, groupVars, useDistinct, options) {
var exprVar = variable ? new sparql.ExprVar(variable) : null;
Function deserializeState
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
deserializeState: function(id, idToState, idToObj) {
var result;
var state = idToState[id];
Function result
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
Function subdivide
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
subdivide: function() {
var depth = this._depth + 1;
var c = this.getCenter();
Function fetchFacetTreePathRec
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
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();
Function lookup
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
lookup: function(constraints) {
// Note: For now we just assume subclasses of ConstraintBasePathValue
var paths = [];
var uriNodes = [];