Showing 125 of 296 total issues
Function limitError
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
limitError: function (test) {
test.expect(8);
function Model(attrs) {
this.attributes = attrs;
Function key
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
key: function (test) {
test.expect(12);
var instance = {
attributes: {
Function options
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
options: function (test) {
test.expect(6);
var instance = {
attributes: {
Function nested
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
nested: function (test) {
test.expect(4);
var instance = {
attributes: {
Function primaryKey
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
primaryKey: function (test) {
test.expect(18);
function Model(attrs) {
this.attributes = attrs;
Function options
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
options: function (test) {
test.expect(8);
function Model(attrs) {
this.attributes = attrs;
Function test1
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
test1: function (test) {
var _this = this;
test.expect(8);
var queue = [];
Function run
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Connection.prototype.run = function (query, options, cb) {
if (utils.isFunction(options)) {
cb = options;
options = {};
}
Function where
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
where: function (test) {
test.expect(3);
function Model(attrs) {
this.attributes = attrs;
Function simpleNestedValidateTrue
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
simpleNestedValidateTrue: function (test) {
test.expect(4);
var instance = {
attributes: {
Function exports
has a Cognitive Complexity of 8 (exceeds 5 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]): ';
- 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 deeply nested control flow statements. Open
if (newModels[localKey].relation === 'hasOne' && localValue.length) {
doc[localKey] = new models[newModels[localKey].modelName](localValue[0]);
} else {
doc[localKey] = new models[newModels[localKey].modelName].collection(localValue);
}
Avoid deeply nested control flow statements. Open
if (models[modelName].timestamps) {
attrs.updated = Model.r.now();
}
Avoid deeply nested control flow statements. Open
if (models[modelName].timestamps) {
attrs.updated = Model.r.now();
}
Avoid deeply nested control flow statements. Open
if (newModels[localKey].relation === 'hasOne' && localValue.length) {
doc[localKey] = new models[newModels[localKey].modelName](localValue[0]);
} else {
doc[localKey] = new models[newModels[localKey].modelName].collection(localValue);
}
Function exports
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
module.exports = function (container, utils, errors, Collection_prototype, Collection_findAll, Collection_getAll) {
Avoid deeply nested control flow statements. Open
if (newModels[localKey].relation === 'hasOne' && localValue.length) {
doc[localKey] = new models[newModels[localKey].modelName](localValue[0]);
} else {
doc[localKey] = new models[newModels[localKey].modelName].collection(localValue);
}
Function viewSource
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
docsApp.directive.viewSource = function ($timeout, $compile) {
return {
restrict: 'E',
replace: true,
template: [
- 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 defineModel
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
defineModel: function (test) {
test.expect(42);
for (var i = 0; i < support.TYPES_EXCEPT_STRING.length; i++) {
test.throws(
- 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 6 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function (container, Promise, utils, errors) {
/**
* @doc method
* @id Model.static_methods:destroyOne
* @name destroyOne
- 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"