philippebeck/nens

View on GitHub
controller/ProductCtrl.js

Summary

Maintainability
A
2 hrs
Test Coverage

Consider simplifying this complex logical expression.
Open

  if (!IS_NAME_CHECKED || !IS_DESC_CHECKED || !IS_ALT_CHECKED || !IS_PRICE_CHECKED || !ID_CAT_CHECKED) {
    return res.status(403).json({ 
      message: CHECK_NAME || CHECK_TEXT || CHECK_NAME || CHECK_PRICE || CHECK_CAT
    });
  }
Severity: Critical
Found in controller/ProductCtrl.js - About 1 hr to fix

    Function updateProduct has 29 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    exports.updateProduct = async (req, res, next) => {
      const { PRODUCT_NOT_UPDATED, PRODUCT_UPDATED } = process.env;
      const ID = parseInt(req.params.id, 10);
    
      form.parse(req, async (err, fields, files) => {
    Severity: Minor
    Found in controller/ProductCtrl.js - About 1 hr to fix

      There are no issues that match your filters.

      Category
      Status