philippebeck/nens

View on GitHub
controller/ArticleCtrl.js

Summary

Maintainability
A
2 hrs
Test Coverage

Consider simplifying this complex logical expression.
Open

  if (!IS_NAME_CHECKED || !IS_TEXT_CHECKED || !IS_ALT_CHECKED || !IS_URL_CHECKED || !IS_CAT_CHECKED) {
    return res.status(403).json({ 
      message: CHECK_NAME || CHECK_TEXT || CHECK_NAME || CHECK_URL || CHECK_CAT
    });
  }
Severity: Critical
Found in controller/ArticleCtrl.js - About 1 hr to fix

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

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

      There are no issues that match your filters.

      Category
      Status