Showing 11 of 64 total issues
File index_spec.js
has 871 lines of code (exceeds 250 allowed). Consider refactoring. Open
require('./helpers/spec_helper');
var extend = require('extend');
var Channel = require('../examples/models/channel'),
Function exports
has 263 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(klass, options, extras) {
describe(klass.className, function() {
var Channel = require('../../examples/models/channel');
var scope, adapter, channelA, channelB, withRecords = function(done) {
adapter.create({_id: 123, name: 'Channel A', buffered: 400, list: [20, 40]}, function(r) {
File relation_spec.js
has 358 lines of code (exceeds 250 allowed). Consider refactoring. Open
require('./helpers/spec_helper');
describe('Relation', function() {
var Relation = require('..')().Relation;
var Channel, relation;
Function set
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
set: function() { var name, from, to, options = arguments[0],
keyValue = arguments.length == 2, result = {};
if(!arguments[0]) return;
if(keyValue) { options = {};
- 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 adapter_helper.js
has 265 lines of code (exceeds 250 allowed). Consider refactoring. Open
module.exports = function(klass, options, extras) {
describe(klass.className, function() {
var Channel = require('../../examples/models/channel');
var scope, adapter, channelA, channelB, withRecords = function(done) {
adapter.create({_id: 123, name: 'Channel A', buffered: 400, list: [20, 40]}, function(r) {
File index.js
has 259 lines of code (exceeds 250 allowed). Consider refactoring. Open
require('progenitor.js')();
var extend = require('extend'),
inflect = require('i')(),
adapterCache = { },
Function isValid
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
isValid: function() {
var i, name, valid = true,
validate = this.class.validate || {},
presence = validate.presence || [],
format = validate.format || {},
- 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 asJSON
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
asJSON: function() {
var name, json = {
id: this.id.toString(),
createdAt: this.get('createdAt'),
updatedAt: this.get('updatedAt')
- 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 get
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
get: function(name) {
if(name == 'id') return this.id;
if(this.class.belongsTo.indexOf(name) >= 0) {
var id = this.get(inflect.foreign_key(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 assignOptions
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function assignOptions(options) {
var id = options.id || options._id;
this.persisted = 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 find
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
find: function(id) { var model;
if(id && (typeof id == 'string' || id._bsontype === 'ObjectID')) {
this.loaded = false;
id = Document.Adapter.ids.isValid(id) ? Document.Adapter.ids.next(id) : 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"