Showing 459 of 552 total issues
Avoid too many return
statements within this function. Open
return next(new Error('[[error:invalid-login-credentials]]'));
Avoid too many return
statements within this function. Open
return res.render('chats', payload);
Avoid too many return
statements within this function. Open
return helpers.redirect(res, `/topic/${tid}/${req.params.slug}${postIndex > topicData.postcount ? `/${topicData.postcount}` : ''}${generateQueryString(req.query)}`);
Avoid too many return
statements within this function. Open
return helpers.redirect(res, `/category/${categoryFields.slug}?${qs.stringify(req.query)}`, true);
Avoid too many return
statements within this function. Open
return helpers.redirect(res, 'admin/settings/general');
Avoid too many return
statements within this function. Open
return helpers.notAllowed(req, res);
Avoid too many return
statements within this function. Open
return next();
Avoid too many return
statements within this function. Open
return next();
Avoid too many return
statements within this function. Open
return next();
Avoid too many return
statements within this function. Open
return helpers.redirect(res, `/category/${categoryData.slug}/${categoryData.topic_count}?${qs.stringify(req.query)}`);
Avoid too many return
statements within this function. Open
return next(new Error('[[error:local-login-disabled]]'));
Avoid too many return
statements within this function. Open
return res.rows[0].e;
Avoid too many return
statements within this function. Open
return 'string';
Avoid too many return
statements within this function. Open
return true;
Avoid too many return
statements within this function. Open
return config;
Avoid too many return
statements within this function. Open
return await prompt.get(questions.postgres);
Function exports
has a Cognitive Complexity of 11 (exceeds 10 allowed). Consider refactoring. Open
module.exports = function (SocketTopics) {
SocketTopics.loadTopicTools = async function (socket, data) {
if (!socket.uid) {
throw new Error('[[error:no-privileges]]');
}
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function fireFilterHook
has a Cognitive Complexity of 11 (exceeds 10 allowed). Consider refactoring. Open
async function fireFilterHook(hook, hookList, params) {
if (!Array.isArray(hookList) || !hookList.length) {
return params;
}
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function build
has a Cognitive Complexity of 11 (exceeds 10 allowed). Consider refactoring. Open
exports.build = async function (targets, options) {
if (!options) {
options = {};
}
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Function generateForTopic
has a Cognitive Complexity of 11 (exceeds 10 allowed). Consider refactoring. Open
async function generateForTopic(req, res, next) {
if (meta.config['feeds:disableRSS']) {
return next();
}
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"