NodeBB/NodeBB

View on GitHub

Showing 536 of 552 total issues

Function getSortedSetRange has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    async function getSortedSetRange(key, start, stop, sort, withScores) {
Severity: Minor
Found in src/database/postgres/sorted.js - About 35 mins to fix

    Function getSortedSetRevRangeByScore has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        module.getSortedSetRevRangeByScore = async function (key, start, count, max, min) {
    Severity: Minor
    Found in src/database/redis/sorted.js - About 35 mins to fix

      Function getEvents has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      events.getEvents = async function (filter, start, stop, from, to) {
      Severity: Minor
      Found in src/events.js - About 35 mins to fix

        Function getSortedSetRangeByScoreWithScores has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            module.getSortedSetRangeByScoreWithScores = async function (key, start, count, min, max) {
        Severity: Minor
        Found in src/database/redis/sorted.js - About 35 mins to fix

          Function getSortedSetRevRangeByLex has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              module.getSortedSetRevRangeByLex = async function (key, max, min, start, count) {
          Severity: Minor
          Found in src/database/redis/sorted.js - About 35 mins to fix

            Function getSortedSetRangeByScoreWithScores has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                module.getSortedSetRangeByScoreWithScores = async function (key, start, count, min, max) {
            Severity: Minor
            Found in src/database/postgres/sorted.js - About 35 mins to fix

              Function getSortedSetRangeByScoreWithScores has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  module.getSortedSetRangeByScoreWithScores = async function (key, start, count, min, max) {
              Severity: Minor
              Found in src/database/mongo/sorted.js - About 35 mins to fix

                Function getSortedSetRevRangeByScore has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    module.getSortedSetRevRangeByScore = async function (key, start, count, max, min) {
                Severity: Minor
                Found in src/database/mongo/sorted.js - About 35 mins to fix

                  Function getSortedSetRangeByScore has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      module.getSortedSetRangeByScore = async function (key, start, count, min, max) {
                  Severity: Minor
                  Found in src/database/redis/sorted.js - About 35 mins to fix

                    Function getCategoryData has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                    async function getCategoryData(cids, uid, selectedCid, states, privilege) {
                    Severity: Minor
                    Found in src/controllers/helpers.js - About 35 mins to fix

                      Function getItemData has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                      async function getItemData(sets, data, req, start, stop) {
                      Severity: Minor
                      Found in src/controllers/accounts/posts.js - About 35 mins to fix

                        Function getSortedSetRevRangeByScore has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            module.getSortedSetRevRangeByScore = async function (key, start, count, max, min) {
                        Severity: Minor
                        Found in src/database/postgres/sorted.js - About 35 mins to fix

                          Function getSortedSetRevRangeByScoreWithScores has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                              module.getSortedSetRevRangeByScoreWithScores = async function (key, start, count, max, min) {
                          Severity: Minor
                          Found in src/database/postgres/sorted.js - About 35 mins to fix

                            Function getSortedSetRangeByLex has 5 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                module.getSortedSetRangeByLex = async function (key, min, max, start, count) {
                            Severity: Minor
                            Found in src/database/redis/sorted.js - About 35 mins to fix

                              Function postCommand has 5 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                              exports.postCommand = async function (caller, command, eventName, notification, data) {
                              Severity: Minor
                              Found in src/api/helpers.js - About 35 mins to fix

                                Function executeCommand has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                async function executeCommand(caller, command, eventName, notification, data) {
                                Severity: Minor
                                Found in src/api/helpers.js - About 35 mins to fix

                                  Function fireVoteHook has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                      async function fireVoteHook(postData, uid, type, unvote, voteStatus) {
                                  Severity: Minor
                                  Found in src/posts/votes.js - About 35 mins to fix

                                    Function getPostsFromSet has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                    Open

                                        Posts.getPostsFromSet = async function (set, start, stop, uid, reverse) {
                                    Severity: Minor
                                    Found in src/posts/topics.js - About 35 mins to fix

                                      Function vote has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                      Open

                                          async function vote(type, unvote, pid, uid, voteStatus) {
                                      Severity: Minor
                                      Found in src/posts/votes.js - About 35 mins to fix

                                        Similar blocks of code found in 3 locations. Consider refactoring.
                                        Open

                                                categoryData.sort((c1, c2) => {
                                                    if (c1.parentCid !== c2.parentCid) {
                                                        return c1.parentCid - c2.parentCid;
                                                    }
                                                    return c1.order - c2.order;
                                        Severity: Minor
                                        Found in src/categories/search.js and 2 other locations - About 35 mins to fix
                                        src/categories/index.js on lines 338..343
                                        src/categories/index.js on lines 389..394

                                        Duplicated Code

                                        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                        Tuning

                                        This issue has a mass of 67.

                                        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                        Refactorings

                                        Further Reading

                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language