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;
}
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) {
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) {
HashMap
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
var HashMap = Class.create({
initialize: function(fnEquals, fnHash) {
this.fnEquals = fnEquals ? fnEquals : ObjectUtils.isEqual;
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;
- 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 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();
- 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
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');
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));
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;
- 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 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');
}
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) {
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);
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();
Function execSelect
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
execSelect: function() {
//var self = this;
var cacheKey = this.cacheKey;
- 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 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();
- 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 createElementsAndExprs
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
createElementsAndExprs: function(facetNode, excludePath) {
// var triples = [];
var elements = [];
var resultExprs = [];
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;
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();
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;
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;