designcreateplay/NodeBB

View on GitHub

Showing 459 of 552 total issues

Avoid too many return statements within this function.
Open

                return next(new Error('[[error:invalid-login-credentials]]'));
Severity: Major
Found in src/controllers/authentication.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

            return res.render('chats', payload);
    Severity: Major
    Found in src/controllers/accounts/chats.js - About 30 mins to fix

      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)}`);
      Severity: Major
      Found in src/controllers/topics.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                return helpers.redirect(res, `/category/${categoryFields.slug}?${qs.stringify(req.query)}`, true);
        Severity: Major
        Found in src/controllers/category.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                  return helpers.redirect(res, 'admin/settings/general');
          Severity: Major
          Found in src/controllers/admin.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                return helpers.notAllowed(req, res);
            Severity: Major
            Found in src/controllers/admin.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                      return next();
              Severity: Major
              Found in src/controllers/accounts/chats.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                        return next();
                Severity: Major
                Found in src/controllers/category.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                          return next();
                  Severity: Major
                  Found in src/controllers/category.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                            return helpers.redirect(res, `/category/${categoryData.slug}/${categoryData.topic_count}?${qs.stringify(req.query)}`);
                    Severity: Major
                    Found in src/controllers/category.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                                  return next(new Error('[[error:local-login-disabled]]'));
                      Severity: Major
                      Found in src/controllers/authentication.js - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                return res.rows[0].e;
                        Severity: Major
                        Found in src/database/postgres/main.js - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                      return 'string';
                          Severity: Major
                          Found in src/database/mongo/main.js - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                return true;
                            Severity: Major
                            Found in src/routes/feeds.js - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                          return config;
                              Severity: Major
                              Found in install/databases.js - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                        return await prompt.get(questions.postgres);
                                Severity: Major
                                Found in install/databases.js - About 30 mins to fix

                                  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]]');
                                          }
                                  Severity: Minor
                                  Found in src/socket.io/topics/tools.js - About 25 mins to fix

                                  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;
                                      }
                                  
                                  
                                  Severity: Minor
                                  Found in src/plugins/hooks.js - About 25 mins to fix

                                  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 = {};
                                      }
                                  
                                  
                                  Severity: Minor
                                  Found in src/meta/build.js - About 25 mins to fix

                                  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();
                                      }
                                  
                                  
                                  Severity: Minor
                                  Found in src/routes/feeds.js - About 25 mins to fix

                                  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

                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language