e-ucm/rage-analytics-backend

View on GitHub

Showing 590 of 590 total issues

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

    groups.getUserType = function (groupId, username, ignoreStudents, ignoreAssistants, ignoreTeachers) {
Severity: Minor
Found in lib/groups.js - About 35 mins to fix

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

        activities.updateResult = function (activityId, resultId, update, username, esClient) {
    Severity: Minor
    Found in lib/activities.js - About 35 mins to fix

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

          kibana.setGameVisualizationByTemplate = function (gameId, id, visualization, fields, esClient) {
      Severity: Minor
      Found in lib/kibana/kibana.js - About 35 mins to fix

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

            var getUserType = function(classRes, username, ignoreStudents, ignoreAssistants, ignoreTeachers) {
        Severity: Minor
        Found in lib/classes.js - About 35 mins to fix

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

              offlinetraces.createOfflinetraces = function (activityId, username, req, res, kahoot) {
          Severity: Minor
          Found in lib/offlinetraces.js - About 35 mins to fix

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

                kibana.createIndex = function(config, indexName, indexTemplateId, user, esClient) {
            Severity: Minor
            Found in lib/kibana/kibana.js - About 35 mins to fix

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

                  classes.isAuthorizedForExternal = function(domain, externalId, username, method, call) {
              Severity: Minor
              Found in lib/classes.js - About 35 mins to fix

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

                    groupings.getUserType = function(groupingId, username, ignoreStudents, ignoreAssistants, ignoreTeachers) {
                Severity: Minor
                Found in lib/groupings.js - About 35 mins to fix

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

                      classes.getUserType = function(classId, username, ignoreStudents, ignoreAssistants, ignoreTeachers) {
                  Severity: Minor
                  Found in lib/classes.js - About 35 mins to fix

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

                        groupings.getUserTypeForArray = function(groupingIds, username, ignoreStudents, ignoreAssistants, ignoreTeachers) {
                    Severity: Minor
                    Found in lib/groupings.js - About 35 mins to fix

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

                          kibana.createKibanaIndices = function (indexName, indexTemplateId, user, config, esClient) {
                      Severity: Minor
                      Found in lib/kibana/kibana.js - About 35 mins to fix

                        Function connectToDB has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                        var connectToDB = function (connectionString, dbVar) {
                            MongoClient.connect(connectionString, function (err, db) {
                                if (err) {
                                    console.log(err);
                                    console.log('Impossible to connect to MongoDB. Retrying in 5s');
                        Severity: Minor
                        Found in bin/permissions-recover.js - About 35 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 exports has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                        module.exports = (function() {
                            var Collection = require('easy-collections');
                            var _ = require('underscore');
                            var db = require('./db');
                            var versions = new Collection(db, 'versions');
                        Severity: Minor
                        Found in lib/versions.js - About 35 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 exports has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                        module.exports = (function () {
                            var Collection = require('easy-collections');
                            var players = new Collection(require('./db'), 'players');
                        
                            /**
                        Severity: Minor
                        Found in lib/players.js - About 35 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 parseCSV has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                        var parseCSV = function (trace) {
                            trace = trace.replace('\r', '');
                            var list = [];
                        
                            var escape = false;
                        Severity: Minor
                        Found in lib/csvToXAPI.js - About 35 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 toTrace has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                        Open

                        var toTrace = function (statement, trace) {
                        
                            var actor = statement.actor;
                            if (actor) {
                                var name = actor.name;
                        Severity: Minor
                        Found in lib/tracesConverter.js - About 35 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

                        Identical blocks of code found in 5 locations. Consider refactoring.
                        Open

                            co(function* () {
                        
                                let esClient = config.elasticsearch.esClient;
                                yield at(esClient.indices.refresh({index: '_all'}));
                        
                        
                        Severity: Major
                        Found in bin/upgrade/transformers/elastic/transformToVersion2.js and 4 other locations - About 35 mins to fix
                        bin/upgrade/transformers/elastic/transformToVersion2.js on lines 326..384
                        bin/upgrade/transformers/elastic/transformToVersion2.js on lines 911..955
                        bin/upgrade/transformers/elastic/transformToVersion2.js on lines 1031..1102
                        bin/upgrade/transformers/elastic/transformToVersion2.js on lines 1108..1159

                        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 46.

                        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

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

                                        if (add && body.title) {
                                            update.$set = {};
                                            update.$set.title = body.title;
                                        }
                        Severity: Minor
                        Found in lib/courses.js and 2 other locations - About 35 mins to fix
                        lib/groupings.js on lines 147..150
                        lib/groups.js on lines 178..181

                        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 46.

                        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

                        Identical blocks of code found in 5 locations. Consider refactoring.
                        Open

                            co(function* () {
                                let esClient = config.elasticsearch.esClient;
                                yield at(esClient.ping({requestTimeout: 2000}));
                                yield at(esClient.indices.refresh({index: '_all'}));
                                const responseIndices = yield at(esClient.cat.indices({format: 'json'}));
                        Severity: Major
                        Found in bin/upgrade/transformers/elastic/transformToVersion2.js and 4 other locations - About 35 mins to fix
                        bin/upgrade/transformers/elastic/transformToVersion2.js on lines 911..955
                        bin/upgrade/transformers/elastic/transformToVersion2.js on lines 1031..1102
                        bin/upgrade/transformers/elastic/transformToVersion2.js on lines 1108..1159
                        bin/upgrade/transformers/elastic/transformToVersion2.js on lines 1178..1207

                        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 46.

                        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

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

                                            if (add && body.name) {
                                                update.$set = {};
                                                update.$set.name = body.name;
                                            }
                        Severity: Minor
                        Found in lib/groups.js and 2 other locations - About 35 mins to fix
                        lib/courses.js on lines 111..114
                        lib/groupings.js on lines 147..150

                        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 46.

                        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