src/server.js
Function publishEndpointHandler
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function publishEndpointHandler() {
return async (req, res, next) => {
const hub = req.app.get('hub');
// Authorize publisher
Avoid too many return
statements within this function. Open
Open
return res.status(401).send('Unauthorized');
Avoid too many return
statements within this function. Open
Open
return res.status(400).send(`Exceeded limit of ${hub.config.maxTopics} topics`);
Avoid too many return
statements within this function. Open
Open
return next(err);
Avoid too many return
statements within this function. Open
Open
return res.status(200).send(updateId);
Avoid too many return
statements within this function. Open
Open
return res.status(400).send('Invalid "retry" parameter');