src/modelling/models.js
Function save
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
save: function(transaction_id) {
if (this.isRemoved())
return Promise.create({});
var promise = this.option("save_invalid") ? Promise.value(true) : this.validate();
return promise.mapSuccess(function(valid) {
Avoid deeply nested control flow statements. Open
Open
if (this instanceof item)
classname = item;
Consider simplifying this complex logical expression. Open
Open
if (this.option("auto_update") && (!this.isNew() || (!this.__disableSaveOnChange && this.__saveOnChange && (!this.__saveOnChangeWeak || !!value))))
this.save();