craftninja/exp-starter-api

View on GitHub
models/user.js

Summary

Maintainability
A
2 hrs
Test Coverage

Function update has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

exports.update = async newProperties => {
  const oldProps = await this.find(newProperties.id);
  const properties = { ...oldProps, ...newProperties };
  if (newProperties.password) {
    const saltRounds = 10;
Severity: Minor
Found in models/user.js - About 1 hr to fix

    Function create has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    exports.create = async properties => {
      const errors = await validate(properties);
      if (errors) {
        return { errors };
      }
    Severity: Minor
    Found in models/user.js - About 1 hr to fix

      There are no issues that match your filters.

      Category
      Status