e-ucm/rage-analytics-backend

View on GitHub

Showing 244 of 590 total issues

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

              Avoid too many return statements within this function.
              Open

                      return extensions.indexOf(i) !== -1;
              Severity: Major
              Found in bin/upgrade/transformers/elastic/transformToVersion2.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                                return logError('Controllers are pending, but no transforms are possible (system locked)!',
                                    status, callback);
                Severity: Major
                Found in bin/upgrade/upgrader.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                              return equal;
                  Severity: Major
                  Found in test/upgraderTests/upgraderTestUtils.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                                            return;
                    Severity: Major
                    Found in test/upgraderTests/upgraderTestUtils.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                                  return csvtraces;
                      Severity: Major
                      Found in lib/offlinetraces.js - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                    return buildReturnError('Object definition is missing for statement, ' + statement);
                        Severity: Major
                        Found in lib/tracesConverter.js - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                                  return {
                                                      error: 'No score cell (G' + playerId + ') value found on sheet ' + question
                                                  };
                          Severity: Major
                          Found in lib/offlinetraces.js - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                        return {
                                            error: 'Unexpected error: ' + err.toString()
                                        };
                            Severity: Major
                            Found in lib/offlinetraces.js - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                                      return {
                                                          error: 'No response cell (D' + playerId + ') value found on sheet ' + question
                                                      };
                              Severity: Major
                              Found in lib/offlinetraces.js - About 30 mins to fix
                                Severity
                                Category
                                Status
                                Source
                                Language