e-ucm/rage-analytics-backend

View on GitHub

Showing 590 of 590 total issues

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

    authtokens: [
        {
            _id: ObjectID('5a1577dfbfc960008bc5e059'),
            authToken: '5a14760fffce74008bddcabc5a1577dfbfc960008bc5e058787872071',
            gameplayId: ObjectID('5a1577dfbfc960008bc5e058'),
Severity: Major
Found in test/upgraderTests/mongo/upgradeInputs/exampleTo4IN.js and 1 other location - About 1 wk to fix
test/upgraderTests/mongo/upgradeOutputs/exampleTo4OUT.js on lines 124..345

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

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

    authtokens: [
        {
            _id: ObjectID('5a1577dfbfc960008bc5e059'),
            authToken: '5a14760fffce74008bddcabc5a1577dfbfc960008bc5e058787872071',
            gameplayId: ObjectID('5a1577dfbfc960008bc5e058'),
Severity: Major
Found in test/upgraderTests/mongo/upgradeOutputs/exampleTo4OUT.js and 1 other location - About 1 wk to fix
test/upgraderTests/mongo/upgradeInputs/exampleTo4IN.js on lines 130..351

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

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

module.exports = {
    games: [
        {
            _id: ObjectID('59315d0d370740006dc1a7b6'),
            title: 'g1',
Severity: Major
Found in test/upgraderTests/mongo/upgradeOutputs/exampleTo3OUT.js and 2 other locations - About 4 days to fix
test/upgraderTests/mongo/upgradeInputs/exampleControllerV2.js on lines 5..201
test/upgraderTests/mongo/upgradeInputs/exampleTo3IN.js on lines 5..201

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

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

module.exports = {
    games: [
        {
            _id: ObjectID('59315d0d370740006dc1a7b6'),
            title: 'g1',
Severity: Major
Found in test/upgraderTests/mongo/upgradeInputs/exampleControllerV2.js and 2 other locations - About 4 days to fix
test/upgraderTests/mongo/upgradeInputs/exampleTo3IN.js on lines 5..201
test/upgraderTests/mongo/upgradeOutputs/exampleTo3OUT.js on lines 5..201

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

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

module.exports = {
    games: [
        {
            _id: ObjectID('59315d0d370740006dc1a7b6'),
            title: 'g1',
Severity: Major
Found in test/upgraderTests/mongo/upgradeInputs/exampleTo3IN.js and 2 other locations - About 4 days to fix
test/upgraderTests/mongo/upgradeInputs/exampleControllerV2.js on lines 5..201
test/upgraderTests/mongo/upgradeOutputs/exampleTo3OUT.js on lines 5..201

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

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 797 lines of code (exceeds 25 allowed). Consider refactoring.
Open

module.exports = (function () {
    var Q = require('q');
    var request = require('request');
    var kibana = {};
    var async = require('async');
Severity: Major
Found in lib/kibana/kibana.js - About 3 days to fix

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

    module.exports = function (request, db, config) {
    
        /**-------------------------------------------------------------**/
        /**-------------------------------------------------------------**/
        /**                   Test Tracker                              **/
    Severity: Major
    Found in test/tests/collectorTest.js - About 3 days to fix

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

      module.exports = (function () {
          var Q = require('q');
          var Collection = require('easy-collections');
          var async = require('async');
          var db = require('./db');
      Severity: Major
      Found in lib/activities.js - About 3 days to fix

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

        module.exports = {
            games: [
                {
                    _id: ObjectID('59315d0d370740006dc1a7b6'),
                    title: 'g1',
        Severity: Major
        Found in test/upgraderTests/mongo/upgradeInputs/exampleControllerV1.js and 1 other location - About 2 days to fix
        test/upgraderTests/mongo/upgradeInputs/exampleTo2IN.js on lines 5..135

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

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

        module.exports = {
            games: [
                {
                    _id: ObjectID('59315d0d370740006dc1a7b6'),
                    title: 'g1',
        Severity: Major
        Found in test/upgraderTests/mongo/upgradeInputs/exampleTo2IN.js and 1 other location - About 2 days to fix
        test/upgraderTests/mongo/upgradeInputs/exampleControllerV1.js on lines 5..135

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

        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 527 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        module.exports = (function () {
            var Q = require('q');
            var Collection = require('easy-collections');
            var async = require('async');
            var db = require('./db');
        Severity: Major
        Found in lib/classes.js - About 2 days to fix

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

                      request.post('/api/collector/start/' + activityTrackingCode)
                          .expect(200)
                          .set('Accept', 'application/json')
                          .set('X-Gleaner-User', 'username')
                          .expect('Content-Type', /json/)
          Severity: Major
          Found in test/tests/attemptsTest.js and 1 other location - About 2 days to fix
          test/tests/attemptsTest.js on lines 98..128

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

          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

                      request.post('/api/collector/start/' + activityTrackingCode)
                          .expect(200)
                          .set('Accept', 'application/json')
                          .expect('Content-Type', /json/)
                          .end(function (err, res) {
          Severity: Major
          Found in test/tests/attemptsTest.js and 1 other location - About 2 days to fix
          test/tests/attemptsTest.js on lines 132..163

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

          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

          File tracesConverterTest.js has 934 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          /*
           * Copyright 2016 e-UCM (http://www.e-ucm.es/)
           *
           * Licensed under the Apache License, Version 2.0 (the "License");
           * you may not use this file except in compliance with the License.
          Severity: Major
          Found in test/tests/tracesConverterTest.js - About 2 days to fix

            File transformToVersion2.js has 905 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            /*
             * Copyright 2016 e-UCM (http://www.e-ucm.es/)
             *
             * Licensed under the Apache License, Version 2.0 (the "License");
             * you may not use this file except in compliance with the License.
            Severity: Major
            Found in bin/upgrade/transformers/elastic/transformToVersion2.js - About 2 days to fix

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

                      afterEach(function (done) {
                          db.collection('games').remove({}, function (err, removed) {
                              should.equal(err, null);
                              db.collection('classes').remove({}, function (err, removed) {
                                  should.equal(err, null);
              Severity: Major
              Found in test/upgraderTests/mongo/mongoTransformerTo4.js and 1 other location - About 2 days to fix
              test/upgraderTests/mongo/mongoTransformerTo4.js on lines 73..101

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

              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

                      beforeEach(function (done) {
                          db.collection('games').remove({}, function (err, removed) {
                              should.equal(err, null);
                              db.collection('classes').remove({}, function (err, removed) {
                                  should.equal(err, null);
              Severity: Major
              Found in test/upgraderTests/mongo/mongoTransformerTo4.js and 1 other location - About 2 days to fix
              test/upgraderTests/mongo/mongoTransformerTo4.js on lines 103..131

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

              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: {
              Severity: Major
              Found in test/upgraderTests/elastic/upgradeOutputs/kibanaIndexTo2OUT.js and 1 other location - About 2 days to fix
              test/upgraderTests/elastic/upgradeInputs/kibanaIndexTo2IN.js on lines 3..100

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

              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: {
              Severity: Major
              Found in test/upgraderTests/elastic/upgradeInputs/kibanaIndexTo2IN.js and 1 other location - About 2 days to fix
              test/upgraderTests/elastic/upgradeOutputs/kibanaIndexTo2OUT.js on lines 3..96

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

              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 correctly convert a Selected (Alternative) statement', function (done) {
              
                      var name = '57345599db69cf4200fa41d971088';
                      var event = 'selected';
                      var target = 'testName';
              Severity: Major
              Found in test/tests/tracesConverterTest.js and 1 other location - About 1 day to fix
              test/tests/tracesConverterTest.js on lines 248..301

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

              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