Showing 125 of 296 total issues
Function relations
has 373 lines of code (exceeds 25 allowed). Consider refactoring. Open
relations: function (test) {
var user = new User({
name: 'John Anderson'
}),
user2 = new User({
File index.test.js
has 715 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*jshint loopfunc:true*/
var errors = require('../../../../build/instrument/lib/support/errors'),
SandboxedModule = require('sandboxed-module'),
Connection = SandboxedModule.require('../../../../build/instrument/lib/connection', {
Function exports
has 254 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (grunt) {
require('jit-grunt')(grunt, {
simplemocha: 'grunt-simple-mocha'
});
Function exports
has 205 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (container, Promise, utils, errors) {
var errorPrefix = 'Collection.findAll(predicate[, options][, cb]): ';
var IllegalArgumentError = errors.IllegalArgumentError;
var RuntimeError = errors.RuntimeError;
File relations.test.js
has 490 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*jshint loopfunc:true*/
var Connection = require('../../../../build/instrument/lib/connection'),
reheat = require('../../../../build/instrument/lib'),
utils = require('../../../../build/instrument/lib/support/utils'),
File filter.test.js
has 478 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*jshint loopfunc:true*/
var filter = require('../../../../../build/instrument/lib/model/static/filter'),
errors = require('../../../../../build/instrument/lib/support/errors'),
support = require('../../../../support/support'),
Function exports
has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function (container, Promise, utils, errors) {
var errorPrefix = 'Collection.findAll(predicate[, options][, cb]): ';
var IllegalArgumentError = errors.IllegalArgumentError;
var RuntimeError = errors.RuntimeError;
- 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 relations
has 154 lines of code (exceeds 25 allowed). Consider refactoring. Open
relations: function (test) {
var user = new User({
name: 'John Anderson'
}),
user2 = new User({
Function _findAll
has 147 lines of code (exceeds 25 allowed). Consider refactoring. Open
function _findAll(predicate, options) {
var Collection = this;
var models = container.get('models');
var Model;
Function exports
has 146 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (container, Promise, utils, errors) {
var errorPrefix = 'Collection.getAll(keys, index[, options][, cb]): ';
var IllegalArgumentError = errors.IllegalArgumentError;
var RuntimeError = errors.RuntimeError;
Function exports
has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function (utils, errors) {
var IllegalArgumentError = errors.IllegalArgumentError,
ValidationError = errors.ValidationError,
UnhandledError = errors.UnhandledError;
- 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 exports
has 140 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (Promise, utils, errors, models) {
/**
* @doc method
* @id Model.instance_methods:save
* @name save
Function getAll
has 140 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getAll(keys, index, options, cb) {
var Collection = this;
var models = container.get('models');
var Model;
Function exports
has 138 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (Collection_save, utils, errors, Promise) {
var protoProps = {
/**
Function save
has 137 lines of code (exceeds 25 allowed). Consider refactoring. Open
function save(options, cb) {
var relationsToMerge = {};
var childRelations = {};
var Model = this.constructor;
Function exports
has 133 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (container, Promise, utils, errors) {
/**
* @doc method
* @id Model.static_methods:findOne
* @name findOne
Function findOne
has 130 lines of code (exceeds 25 allowed). Consider refactoring. Open
function findOne(primaryKey, options, cb) {
var models = container.get('models');
var newModels = {};
var merge = {};
var query;
Function exports
has 128 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (container, Promise, utils, errors) {
var IllegalArgumentError = errors.IllegalArgumentError;
var RuntimeError = errors.RuntimeError;
var errorPrefix = 'Model.load(relations[, options][, cb]): ';
Function exports
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function (Promise, utils, errors) {
var IllegalArgumentError = errors.IllegalArgumentError;
/**
* @doc method
- 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 exports
has 125 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (utils, errors, Model_set, Model_setSync, Model_unset, Model_clear, Model_save, Model_destroy, Model_load) {
return {
/**