e-ucm/rage-analytics-backend

View on GitHub

Showing 590 of 590 total issues

Function exports has 275 lines of code (exceeds 25 allowed). Consider refactoring.
Open

module.exports = function (request, db) {

    /**-------------------------------------------------------------**/
    /**-------------------------------------------------------------**/
    /**                   Test Sessions API                         **/
Severity: Major
Found in test/tests/activitiesTest.js - About 1 day to fix

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

            it('should not POST an analysis with indices.json that contains indices without the key ',
                function (done) {
                    // Creating archives
                    var zip = new AdmZip();
    
    
    Severity: Major
    Found in test/tests/analysisTest.js and 1 other location - About 1 day to fix
    test/tests/analysisTest.js on lines 180..207

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

    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 2 locations. Consider refactoring.
    Open

            it('should not POST an analysis with indices.json without key field',
                function (done) {
                    // Creating archives
                    var zip = new AdmZip();
    
    
    Severity: Major
    Found in test/tests/analysisTest.js and 1 other location - About 1 day to fix
    test/tests/analysisTest.js on lines 240..267

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

    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

    Function exports has 271 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    module.exports = (function () {
        var Collection = require('easy-collections');
        var db = require('./db');
        var utils = require('./utils');
        var groups = new Collection(db, 'groups');
    Severity: Major
    Found in lib/groups.js - About 1 day to fix

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

      var traces = [
          {
              id: 'vis_id1000',
              type: 'visualization',
              source: {
      test/upgraderTests/elastic/upgradeOutputs/templateIndexTo2OUTtest.js on lines 3..64

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

      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 2 locations. Consider refactoring.
      Open

      var traces = [
          {
              id: 'vis_id1000',
              type: 'visualization',
              source: {
      test/upgraderTests/elastic/upgradeOutputs/gameIndexTo2OUTtest.js on lines 3..64

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

      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

      Function exports has 260 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      module.exports = (function () {
          var Q = require('q');
          var Collection = require('easy-collections');
          var db = require('./db');
          var analysis = new Collection(db, 'analysis');
      Severity: Major
      Found in lib/analysis.js - About 1 day to fix

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

                it('should DELETE a course', function (done) {
                    request.delete('/api/classes/groups/' + idGroup)
                        .expect(200)
                        .set('X-Gleaner-User', 'teacher')
                        .set('Accept', 'application/json')
        Severity: Major
        Found in test/tests/groupsTest.js and 1 other location - About 1 day to fix
        test/tests/groupingsTest.js on lines 179..199

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

        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 2 locations. Consider refactoring.
        Open

                it('should DELETE a course', function (done) {
                    request.delete('/api/classes/groupings/' + idGrouping)
                        .expect(200)
                        .set('X-Gleaner-User', 'teacher')
                        .set('Accept', 'application/json')
        Severity: Major
        Found in test/tests/groupingsTest.js and 1 other location - About 1 day to fix
        test/tests/groupsTest.js on lines 218..238

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

        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

        Function exports has 247 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        module.exports = (function () {
            var Q = require('q');
            var Collection = require('easy-collections');
            var db = require('./db');
            var games = new Collection(db, 'games');
        Severity: Major
        Found in lib/games.js - About 1 day to fix

          Function exports has 245 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          module.exports = (function () {
              var Collection = require('easy-collections');
              var db = require('./db');
              var utils = require('./utils');
              var groups = require('./groups');
          Severity: Major
          Found in lib/groupings.js - About 1 day to fix

            Function exports has 239 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            module.exports = function (request, db) {
            
                /**-------------------------------------------------------------**/
                /**-------------------------------------------------------------**/
                /**                   Test Analysis API                         **/
            Severity: Major
            Found in test/tests/analysisTest.js - About 1 day to fix

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

                      it('should GET my attempts', function (done) {
                          request.post('/api/collector/start/' + activityTrackingCode)
                              .expect(200)
                              .set('Accept', 'application/json')
                              .set('X-Gleaner-User', 'Student1')
              Severity: Major
              Found in test/tests/attemptsTest.js and 1 other location - About 1 day to fix
              test/tests/attemptsTest.js on lines 252..271

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

              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 2 locations. Consider refactoring.
              Open

                      it('should GET any user attempts', function (done) {
                          request.post('/api/collector/start/' + activityTrackingCode)
                              .expect(200)
                              .set('Accept', 'application/json')
                              .set('X-Gleaner-User', 'username')
              Severity: Major
              Found in test/tests/attemptsTest.js and 1 other location - About 1 day to fix
              test/tests/attemptsTest.js on lines 231..250

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

              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

              Function exports has 229 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              module.exports = function (kafkaService, stormService) {
              
                  /**
                   * @api {get} /activities Returns the Activities.
                   * @apiName GetActivities
              Severity: Major
              Found in routes/activities.js - About 1 day to fix

                Function exports has 224 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                module.exports = function (request, db) {
                
                    /**-------------------------------------------------------------**/
                    /**-------------------------------------------------------------**/
                    /**                     Test Games API                          **/
                Severity: Major
                Found in test/tests/gamesTest.js - About 1 day to fix

                  Function exports has 222 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  module.exports = function (request, db) {
                  
                      /**-------------------------------------------------------------**/
                      /**-------------------------------------------------------------**/
                      /**                   Test Attempts API                         **/
                  Severity: Major
                  Found in test/tests/attemptsTest.js - About 1 day to fix

                    File classes.js has 530 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    'use strict';
                    
                    module.exports = (function () {
                        var Q = require('q');
                        var Collection = require('easy-collections');
                    Severity: Major
                    Found in lib/classes.js - About 1 day to fix

                      File exampleTo4IN.js has 524 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      // jscs:disable requireCamelCaseOrUpperCaseIdentifiers
                      'use strict';
                      
                      var ObjectID = require('mongodb').ObjectID;
                      
                      
                      Severity: Major
                      Found in test/upgraderTests/mongo/upgradeInputs/exampleTo4IN.js - About 1 day to fix

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

                            groups.getUserTypeForArray = function (groupIds, username, ignoreStudents, ignoreAssistants, ignoreTeachers) {
                                if (groupIds.length > 0) {
                                    groupIds = groupIds.slice(0);
                                    var groupId = groupIds.shift();
                                    return groups.getUserType(groupId, username, ignoreStudents, ignoreAssistants, ignoreTeachers)
                        Severity: Major
                        Found in lib/groups.js and 1 other location - About 1 day to fix
                        lib/groupings.js on lines 252..283

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

                        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