Showing 59 of 136 total issues
Function set
has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring. Open
set: function(models, options) {
options = _.defaults(options || {}, setOptions);
// options = _.merge({}, this.options, options);
if (options.parse) models = this.parse(models, options);
if (!_.isArray(models)) models = models ? [models] : [];
- 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 set
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
set: function(key, val, options) {
var attr, attrs, unset, changes, silent, changing, prev, current;
if (key == null) return this;
// Handle both `"key", value` and `{key: value}` -style arguments.
- 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
Collection
has 27 functions (exceeds 20 allowed). Consider refactoring. Open
var Collection = Base.extend({
'model': Model,
'initialize': function (models, options) {
Function save
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
save: function(key, val, options) {
var attrs, method, xhr, attributes = this.attributes;
// Handle both `"key", value` and `{key: value}` -style arguments.
if (key == null || typeof key === 'object') {
- 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 renderValues
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
'renderValues': function (model) {
var self = this;
var options = self.options;
var templates = options.templates;
- 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 Collection.js
has 271 lines of code (exceeds 250 allowed). Consider refactoring. Open
var Base = require('./Base');
var Model = require('./Model');
var _ = require('lodash');
var _super = Base.prototype;
Model
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
var Model = Base.extend({
'initialize': function (attributes, options) {
var self = this;
Function set
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
set: function(key, val, options) {
var attr, attrs, unset, changes, silent, changing, prev, current;
if (key == null) return this;
// Handle both `"key", value` and `{key: value}` -style arguments.
Function set
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
set: function(models, options) {
options = _.defaults(options || {}, setOptions);
// options = _.merge({}, this.options, options);
if (options.parse) models = this.parse(models, options);
if (!_.isArray(models)) models = models ? [models] : [];
Function renderValues
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
'renderValues': function (model) {
var self = this;
var options = self.options;
var templates = options.templates;
Function render
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
'render': function () {
var self = this;
var started = new Date();
Function run
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
'run': function (model) {
var self = this;
var deferred = self.deferred();
Function run
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
'run': function (src, params) {
var self = this;
if (typeof src !== 'string') {
Function run
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
'run': function (model) {
var self = this;
var deferred = self.deferred();
Function getNextBatch
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
'getNextBatch': function () {
var self = this;
var limit = self.limit;
var models = [];
- 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 filter
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
'filter': function (test, options) {
var self = this;
options || (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
Function run
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
'run': function (href, innerText, params, block) {
var self = this;
if (typeof href !== 'string') {
- 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 start
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
'start': function () {
var self = this;
var app = self.app = express();
Function plugin
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function plugin () {
asimov
.config('defaultLangCode', 'en')
.config('defaultLangFallback', true)
Function destroy
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
destroy: function(options) {
options = options ? _.clone(options) : {};
var model = this;
var success = options.success;
- 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"