betajs/betajs-data

View on GitHub
src/modelling/models.js

Summary

Maintainability
A
3 hrs
Test Coverage

Function save has 57 lines of code (exceeds 25 allowed). Consider refactoring.
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) {
Severity: Major
Found in src/modelling/models.js - About 2 hrs to fix

    Avoid deeply nested control flow statements.
    Open

                                            if (this instanceof item)
                                                classname = item;
    Severity: Major
    Found in src/modelling/models.js - About 45 mins to fix

      Consider simplifying this complex logical expression.
      Open

                      if (this.option("auto_update") && (!this.isNew() || (!this.__disableSaveOnChange && this.__saveOnChange && (!this.__saveOnChangeWeak || !!value))))
                          this.save();
      Severity: Major
      Found in src/modelling/models.js - About 40 mins to fix

        There are no issues that match your filters.

        Category
        Status