philippebeck/nens

View on GitHub

Showing 12 of 17 total issues

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

    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

      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/ProjectCtrl.js - About 1 hr to fix

        Function updateUser has 36 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

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

          Function exports has 36 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          module.exports = (Sequelize, DataTypes) => {
            const ProjectModel = Sequelize.define("Projects", {
              id: {
                type: DataTypes.SMALLINT.UNSIGNED,
                primaryKey: true,
          Severity: Minor
          Found in model/ProjectModel.js - About 1 hr to fix

            Function updateImage has 32 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            exports.updateImage = async (req, res, next) => {
              const { IMAGE_NOT_UPDATED, IMAGE_UPDATED } = process.env;
              const ID = parseInt(req.params.id, 10);
            
              form.parse(req, async (err, fields, files) => {
            Severity: Minor
            Found in controller/ImageCtrl.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

                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

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

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

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

                    exports.createImage = async (req, res, next) => {
                      const { GALLERY_NOT_FOUND, IMAGE_CREATED, IMAGE_NOT_CREATED, IMG_EXT } = process.env;
                    
                      form.parse(req, async (err, fields, files) => {
                        if (err) { next(err); return }
                    Severity: Minor
                    Found in controller/ImageCtrl.js - About 1 hr to fix

                      Function setMessage has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      exports.setMessage = (total, paymentId, products) => {
                        const { CURRENCY_SYMBOL, ORDER_LIST, ORDER_NAME, ORDER_PAYMENT, ORDER_PRICE, ORDER_QUANTITY, ORDER_SUBJECT, ORDER_TITLE, ORDER_TOTAL } = process.env;
                      
                        let message = {};
                        message.subject = ORDER_SUBJECT;
                      Severity: Minor
                      Found in controller/OrderCtrl.js - About 1 hr to fix

                        Function forgotPass has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        exports.forgotPass = async (req, res, next) => {
                          const { AUTH_MESSAGE, CHECK_EMAIL, DISPO_EMAIL_REF, USER_NOT_PASS, USER_NOT_UPDATED } = process.env;
                        
                          form.parse(req, async (err, fields) => {
                            if (err) { next(err); return }
                        Severity: Minor
                        Found in controller/AuthCtrl.js - About 1 hr to fix
                          Severity
                          Category
                          Status
                          Source
                          Language