ForestAdmin/forest-express-sequelize

View on GitHub
src/services/has-many-dissociator.js

Summary

Maintainability
A
3 hrs
Test Coverage
A
96%

Function HasManyDissociator has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function HasManyDissociator(model, association, options, params, data) {
  const OPERATORS = Operators.getInstance(options);
  const isDelete = Boolean(params.delete);

  this.perform = () => {
Severity: Minor
Found in src/services/has-many-dissociator.js - About 1 hr to fix

    Function perform has 34 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      this.perform = () => {
        const associatedIds = _.map(data.data, (value) => value.id);
        return orm.findRecord(model, params.recordId)
          .then((record) => {
            let removeAssociation = false;
    Severity: Minor
    Found in src/services/has-many-dissociator.js - About 1 hr to fix

      Function HasManyDissociator has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      function HasManyDissociator(model, association, options, params, data) {
      Severity: Minor
      Found in src/services/has-many-dissociator.js - About 35 mins to fix

        There are no issues that match your filters.

        Category
        Status