Showing 125 of 296 total issues
Function getPoolSize
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
getPoolSize: function (test) {
var _this = this;
test.expect(7);
Function exports
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function (Promise, utils, errors) {
var IllegalArgumentError = errors.IllegalArgumentError;
/**
* @doc method
Function lifecycle
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
lifecycle: function (test) {
test.expect(8);
var instance = {
beforeValidate: prototype.beforeValidate,
Function exports
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
Open
module.exports = function (Promise, utils, errors, models) {
/**
* @doc method
* @id Model.instance_methods:destroy
* @name destroy
- 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 reset
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
reset: function () {
// 3rd-party dependencies
container.register('r', function () {
return require('rethinkdbdash');
});
Function sanitize
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
return Promise.resolve().then(function sanitize() {
if (!utils.isObject(options)) {
throw new IllegalArgumentError(errorPrefix + 'options: Must be an object', { actual: typeof options, expected: 'object' });
} else if (!utils.isObject(key) && !utils.isString(key)) {
throw new IllegalArgumentError(errorPrefix + 'key: Must be a string or an object!', { actual: typeof key, expected: 'string|object' });
Function exports
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function (Promise, utils, errors) {
var IllegalArgumentError = errors.IllegalArgumentError;
/**
* @doc method
Function isNew
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
isNew: function (test) {
test.expect(2);
var instance = {
attributes: {
Function unset
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function unset(key, options, cb) {
var _this = this;
// Check pre-conditions
options = options ? (options === true ? { validate: true } : options) : {};
Function exports
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function (r, Promise, utils, errors) {
/**
* @doc function
* @id Connection.class:constructor
Function get
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
get: function (test) {
test.expect(11);
var instance = {
attributes: {
Function methodsExist
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
methodsExist: function (test) {
test.expect(30);
test.ok(typeof Model.get, 'function');
test.ok(typeof Model.getAll, 'function');
Function manyInsert
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
manyInsert: function (test) {
test.expect(4003);
connection.configure({
max: 100
Function profile
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
profile: function (test) {
test.expect(5);
function Model(attrs) {
this.attributes = attrs;
Function exports
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function (container, utils, errors, Collection_prototype, Collection_findAll, Collection_getAll) {
/**
* @doc function
* @name Collection
Function profile
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
profile: function (test) {
test.expect(5);
function Model(attrs) {
this.attributes = attrs;
Function normalIsNew
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
normalIsNew: function (test) {
test.expect(3);
var instance = {
attributes: {
Function clear
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function clear(options, cb) {
var _this = this;
// Check pre-conditions
options = options ? (options === true ? { validate: true } : options) : {};
Function link
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
link: function(scope, element, attrs) {
element.bind('click', function(){
element.addClass('loading');
Function validateWithError
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
validateWithError: function (test) {
test.expect(6);
var instance = {
attributes: {