Showing 0 of 7 total issues
Function houseValidate
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Wontfix
exports.houseValidate = (req, res, next) => { const houseValidation = Joi.object({ image: Joi.string().required().messages({ "any.required": res.__('image is required'), "string.empty": res.__('image not empty')
Similar blocks of code found in 3 locations. Consider refactoring. Wontfix
bathrooms: Joi.number().min(1).required().messages({ "any.required": res.__('bathrooms should be required'), "number.empty": res.__('bathrooms should not be empty'), "number.min": res.__('bathrooms should minimun equal to 1'), "any.only": res.__('bathrooms should be number')
- Read upRead up
Similar blocks of code found in 3 locations. Consider refactoring. Wontfix
bedrooms: Joi.number().min(1).required().messages({ "any.required": res.__('bedrooms should be required'), "number.empty": res.__('bedrooms should not be empty'), "number.min": res.__('bedrooms should minimun equal to 1'), "any.only": res.__('bedrooms should be number number')
- Read upRead up
Similar blocks of code found in 3 locations. Consider refactoring. Wontfix
price: Joi.number().min(5000).required().messages({ "any.required": res.__('price should be required'), "number.empty": res.__('price should not be empty'), "number.min": res.__('price should minimun equal to 5000'), "any.only": res.__('price should be number number')
- Read upRead up
Similar blocks of code found in 6 locations. Consider refactoring. Wontfix
image: Joi.string().required().messages({ "any.required": res.__('image is required'), "string.empty": res.__('image not empty') }),
- Read upRead up
Similar blocks of code found in 6 locations. Consider refactoring. Wontfix
location: Joi.string().required().messages({ "any.required": res.__('location is required'), "string.empty": res.__('location not empty') }),
- Read upRead up
Identical blocks of code found in 4 locations. Consider refactoring. Wontfix
if (result.error) return res.status(400).json({ message: result.error.details[0].message });
- Read upRead up