Showing 125 of 296 total issues
File filter.relations.test.js
has 270 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'),
Function exports
has a Cognitive Complexity of 18 (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 a Cognitive Complexity of 18 (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 clone
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
clone: function (test) {
test.expect(3);
function constructor(attrs) {
return {
Function exports
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (mout) {
return {
contains: mout.array.contains,
every: mout.array.every,
filter: mout.array.filter,
Function exports
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (Promise, utils, errors) {
var IllegalArgumentError = errors.IllegalArgumentError;
/**
* @doc method
Function exports
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function (utils, errors, Model_set, Model_setSync, Model_unset, Model_clear, Model_save, Model_destroy, Model_load) {
return {
/**
- 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 Gruntfile.js
has 256 lines of code (exceeds 250 allowed). Consider refactoring. Open
module.exports = function (grunt) {
require('jit-grunt')(grunt, {
simplemocha: 'grunt-simple-mocha'
});
Function set
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
function set(key, value, options, cb) {
var _this = this;
// Check pre-conditions
if (utils.isFunction(value)) {
Function defineModel
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
reheat.defineModel = function (name, staticProps, protoProps) {
if (!utils.isString(name)) {
throw new errors.IllegalArgumentError(errorPrefix + 'name: Must be a string!', { name: { actual: typeof name, expected: 'string' } });
} else if (models[name]) {
throw new errors.RuntimeError(errorPrefix + 'name: A Model with that name already exists!');
Function findAll
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
function findAll(predicate, options, cb) {
if (utils.isFunction(options)) {
cb = options;
options = {};
}
Function exports
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (utils, errors) {
var IllegalArgumentError = errors.IllegalArgumentError,
ValidationError = errors.ValidationError,
UnhandledError = errors.UnhandledError;
Function setSync
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
function setSync(key, value, options) {
// Check pre-conditions
if (utils.isObject(key) && !options) {
options = value;
}
Function createLifecycle
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
createLifecycle: function (test) {
test.expect(9);
var Post = reheat.defineModel('Post', {
tableName: tableName,
Function viewSource
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
docsApp.directive.viewSource = function ($timeout, $compile) {
return {
restrict: 'E',
replace: true,
template: [
Function exports
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function (container, utils, errors, Collection_prototype, Collection_findAll, Collection_getAll) {
/**
* @doc function
* @name Collection
- 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 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (utils, Model_findOne, Model_prototype, Model_destroyOne) {
/**
* @doc function
* @name Model
Function normal
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
normal: function (test) {
test.expect(3);
var instance = {
attributes: {
Function sanitize
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
return Promise.resolve().bind(this).then(function sanitize() {
if (!utils.isObject(predicate)) {
throw new IllegalArgumentError(errorPrefix + 'predicate: Must be an object!', { actual: typeof predicate, expected: 'object' });
} else if (!utils.isObject(options)) {
Function options
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
options: function (test) {
test.expect(8);
var instance = {
attributes: {