Easybuoy/storemanager

View on GitHub
server/controllers/productController.js

Summary

Maintainability
A
1 hr
Test Coverage

Function createProduct has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  static createProduct(req, res) {
    const { errors, isValid } = productsValidation.validateProductInput(req.body);
    // Check validation
    if (!isValid) {
      return res.status(400).json(errors);
Severity: Minor
Found in server/controllers/productController.js - About 1 hr to fix

    Avoid too many return statements within this function.
    Open

        return res.json({ message: 'Unable to delete product.' });
    Severity: Major
    Found in server/controllers/productController.js - About 30 mins to fix

      There are no issues that match your filters.

      Category
      Status