Showing 70 of 76 total issues
Function ViewModel
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
var ViewModel = function(name, reference, constructor) {
var model = Model('_view', reference);
return {
klass: 'ViewModel',
name: name,
- 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 separateMethods
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
var separateMethods = function(reference) {
var ret = {
defaults: {},
methods: {},
collections: {},
- 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 parseAttribute
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
parseAttribute: function(str) {
var attr = {type: 'static', value: str};
// Dynamic attribute
if(str[0] == '{') {
// Trim off curlies
- 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
Avoid too many return
statements within this function. Open
if(op == '<=') return a <= b;
Avoid too many return
statements within this function. Open
if(op == '>=') return a >= b;
Avoid too many return
statements within this function. Open
return obj[seg];
Function Model
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
var Model = function(dbCollection, reference, constructor) {
var ref = separateMethods(reference);
var model = {
klass: 'Model',
name: dbCollection,
- 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 makeCollections
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Collection.makeCollections = function(data, inst) {
return _.map(data, function(value, key) {
if(Array.isArray(value)) {
var col = Collection(value);
if(inst) col.on('change', function() {
- 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 UndoManager
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
var UndoManager = function(items) {
var milestones = [{}];
var reverseIndex = 0;
var dontRecord = false;
- 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 Router
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
var Router = function() {
var listeners = {};
var suppressNextPopstate = false;
var scrollTo = function(id) {
- 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"