Showing 70 of 76 total issues
Function Evaluator
has a Cognitive Complexity of 216 (exceeds 5 allowed). Consider refactoring. Open
var Evaluator = function(topNode, viewModels, parseTrees, interface, mainModel) {
// Replace all mustaches in text with the value at their paths
var resolveMustaches = function(text, scope, node, cb) {
// Collect mustaches in reverse order
- 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 Evaluator
has 683 lines of code (exceeds 25 allowed). Consider refactoring. Open
var Evaluator = function(topNode, viewModels, parseTrees, interface, mainModel) {
// Replace all mustaches in text with the value at their paths
var resolveMustaches = function(text, scope, node, cb) {
// Collect mustaches in reverse order
File evaluator.js
has 688 lines of code (exceeds 250 allowed). Consider refactoring. Open
var _ = require('./utils.js');
var Scope = require('./scope.js');
// Renders a parse tree from <topNode> downward and emits either
Function evaluate
has 306 lines of code (exceeds 25 allowed). Consider refactoring. Open
evaluate: function(node, scope, preFormated) {
var self = this;
var frag = interface.createFragment();
var recurse = function(frag, scope, pre) {
Function StreamInterface
has a Cognitive Complexity of 64 (exceeds 5 allowed). Consider refactoring. Open
var StreamInterface = function() {
var pending = 0;
var streamCb;
var topNode;
- 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 ServerApplication
has 238 lines of code (exceeds 25 allowed). Consider refactoring. Open
var ServerApplication = function(options) {
// Create express app
var expressApp = express();
var environment = expressApp.get('env');
Function Instance
has 217 lines of code (exceeds 25 allowed). Consider refactoring. Open
var Instance = function() {
var inst = {
klass: 'Instance',
model: null,
id: null,
Function Instance
has a Cognitive Complexity of 55 (exceeds 5 allowed). Consider refactoring. Open
var Instance = function() {
var inst = {
klass: 'Instance',
model: null,
id: 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 Query
has 135 lines of code (exceeds 25 allowed). Consider refactoring. Open
var Query = function(modelOrCollection, query, options) {
query = query || {};
options = options || {};
var allCache;
Function StreamInterface
has 108 lines of code (exceeds 25 allowed). Consider refactoring. Open
var StreamInterface = function() {
var pending = 0;
var streamCb;
var topNode;
File model.js
has 334 lines of code (exceeds 250 allowed). Consider refactoring. Open
var Query = require('./query.js');
var Collection = require('./collection.js');
var _ = require('./utils.js');
Function ClientDataInterface
has 98 lines of code (exceeds 25 allowed). Consider refactoring. Open
var ClientDataInterface = function(model) {
var localStore = ClientStore(model.name);
var url = model.url();
var cache = {};
Function Query
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
var Query = function(modelOrCollection, query, options) {
query = query || {};
options = options || {};
var allCache;
- 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 createDOMElement
has 91 lines of code (exceeds 25 allowed). Consider refactoring. Open
createDOMElement: function(tag, id, classes, attributes) {
return {
tag: tag,
id: id,
className: classes ? classes.join(' ') : '',
Function Scope
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
var Scope = function() {
var layers = [];
return {
layers: layers,
- 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 LocalStore
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
var LocalStore = function(modelName) {
// Iterate all items in local storage belonging to our model
var all = function(cb) {
for(var i = 0; i < localStorage.length; i++) {
var key = localStorage.key(i);
Function Scope
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
var Scope = function() {
var layers = [];
return {
layers: layers,
Function ClientApplication
has 83 lines of code (exceeds 25 allowed). Consider refactoring. Open
var ClientApplication = function() {
// Save view model declarations for lookup in templates
var viewModels = {};
// Create main model singleton instance
Function Collection
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
var Collection = function(array) {
if(array && array.klass == 'Collection') return array;
var col = {
klass: 'Collection',
items: [],
Function parseStatement
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
parseStatement: function(line) {
var m;
var out;
// if
if(m = line.match(/{{if\s+(.+)}}/)) {