e-ucm/rage-analytics-frontend

View on GitHub

Showing 143 of 143 total issues

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

        companyName: ['projectName', function (done) {

            var promptOptions = {
                default: defaultValues.companyName || 'e-UCM Research Group'
            };
Severity: Major
Found in bin/setup.js and 2 other locations - About 1 hr to fix
bin/setup.js on lines 91..98
bin/setup.js on lines 107..114

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

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

        apiPath: ['companyName', function (done) {

            var promptOptions = {
                default: defaultValues.apiPath || 'localhost:3000/api'
            };
Severity: Major
Found in bin/setup.js and 2 other locations - About 1 hr to fix
bin/setup.js on lines 83..90
bin/setup.js on lines 107..114

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

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

        appPrefix: ['port', function (done) {

            var promptOptions = {
                default: defaultValues.appPrefix || 'gleaner'
            };
Severity: Major
Found in bin/setup.js and 2 other locations - About 1 hr to fix
bin/setup.js on lines 83..90
bin/setup.js on lines 91..98

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

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

                transformRequest: function (data, headersGetter) {
                    if (data._id !== undefined) {
                        delete data._id;
                    }
                    if (data.classId !== undefined) {
Severity: Minor
Found in app/public/js/services.js - About 1 hr to fix

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

                $scope.isUsingGroups = function () {
                    return !$scope.isUsingGroupings() && $scope.class.groups && $scope.class.groups.length > 0;
                };
    Severity: Major
    Found in app/public/js/controllers/class.js and 1 other location - About 1 hr to fix
    app/public/js/controllers/activity.js on lines 373..375

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

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

                $ctrl.modifyGroup = function (usr, role, toAdd) {
                    if ($ctrl.selectedGroup) {
                        var route;
                        if (toAdd) {
                            route = CONSTANTS.PROXY + '/classes/groups/' + $ctrl.selectedGroup._id;
    Severity: Minor
    Found in app/public/js/controllers/participantsConf.js - About 1 hr to fix

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

                  $scope.isUsingGroups = function () {
                      return !$scope.isUsingGroupings() && $scope.activity.groups && $scope.activity.groups.length > 0;
                  };
      Severity: Major
      Found in app/public/js/controllers/activity.js and 1 other location - About 1 hr to fix
      app/public/js/controllers/class.js on lines 200..202

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

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

                  var dashboardLink = function (userName, attempt) {
                      var url = CONSTANTS.KIBANA + '/app/kibana#/dashboard/dashboard_' +
                          $scope.activity._id + '?embed=true_g=(refreshInterval:(display:\'5%20seconds\',' +
                          'pause:!f,section:1,value:5000),time:(from:now-1h,mode:quick,to:now))';
                      if (url.startsWith('localhost')) {
      Severity: Minor
      Found in app/public/js/controllers/activity.js - About 1 hr to fix

        Function selectField has 30 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                $scope.selectField = function (visualizationField, newField) {
                    $scope.dataWithField[visualizationField] = newField;
                    $scope.selectedVisualizationDevList.forEach(function (visualization) {
                        $http.post(CONSTANTS.PROXY + '/kibana/visualization/game/' + $scope.game._id + '/' + visualization.id, $scope.dataWithField)
                            .success(function () {
        Severity: Minor
        Found in app/public/js/controllers/kibana.js - About 1 hr to fix

          Function calculateResults has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                      var calculateResults = function (rawResults) {
                          var results = [];
                          rawResults.forEach(function (result) {
                              $scope.version.alias = $scope.version.alias ? $scope.version.alias : 'this.name';
                              result.name = evalExpression.call(result, $scope.version.alias, 'Unknown');
          Severity: Minor
          Found in app/public/js/controllers/activity.js - About 1 hr to fix

            Function inviteUser has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                        $ctrl.inviteUser = function (role) {
                            var object = {participants: {}};
                            var user;
                            switch (role) {
                                case 'teacher': {
            Severity: Minor
            Found in app/public/js/controllers/participantsConf.js - About 1 hr to fix

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

                              } else {
                                  $scope.games = Games.public();
                                  $scope.classes = Classes.my();
                                  $scope.activities = Activities.my();
                              }
              Severity: Major
              Found in app/public/js/controllers/toolbar.js and 1 other location - About 1 hr to fix
              app/public/js/controllers/activity-list.js on lines 44..48

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

              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 loadAll = function () {
                              $scope.activities = Activities.my();
                              $scope.classes = Classes.my();
                              $scope.games = Games.public();
                          };
              Severity: Major
              Found in app/public/js/controllers/activity-list.js and 1 other location - About 1 hr to fix
              app/public/js/controllers/toolbar.js on lines 42..46

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

              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

                              Versions.get({gameId: gameId, versionId: versionId}).$promise.then(function(version) {
                                  $scope.version = version;
                                  afterLoad();
                              });
              Severity: Major
              Found in app/public/js/controllers/game.js and 1 other location - About 1 hr to fix
              app/public/js/controllers/analysis.js on lines 36..39

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

              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

                              Versions.get({gameId: gameId, versionId: versionId}).$promise.then(function(version) {
                                  $scope.version = version;
                                  afterLoad();
                              });
              Severity: Major
              Found in app/public/js/controllers/analysis.js and 1 other location - About 1 hr to fix
              app/public/js/controllers/game.js on lines 33..36

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

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

              var RadialProgress = function (div, initialProgress) {
                  var svg = d3.select(div).append('svg')
                      .attr('viewBox', '0 0 100 100');
              
                  this.outerCircle = svg.append('circle')
              Severity: Minor
              Found in app/public/js/ui.js - About 1 hr to fix

                Function updateOfflineTraces has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                            function updateOfflineTraces() {
                                if ($scope.activity && $scope.activity.offline) {
                                    $http.get(CONSTANTS.PROXY + '/offlinetraces/' + $scope.activity._id, {
                                        transformRequest: angular.identity,
                                        headers: {
                Severity: Minor
                Found in app/public/js/controllers/activity.js - About 1 hr to fix

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

                                      console.error('Error on post /kibana/visualization/list/' + $scope.game._id + '/' + visualizationId + ' ' +
                                          JSON.stringify(data) + ', status: ' + status);
                  Severity: Major
                  Found in app/public/js/controllers/kibana.js and 1 other location - About 1 hr to fix
                  app/public/js/controllers/kibana.js on lines 148..149

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

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

                              isAdmin: function () {
                                  return $localStorage.user && $localStorage.user.roles && $localStorage.user.roles.indexOf('admin') !== -1;
                              },
                  Severity: Major
                  Found in app/public/js/services.js and 3 other locations - About 1 hr to fix
                  app/public/js/services.js on lines 237..239
                  app/public/js/services.js on lines 240..242
                  app/public/js/services.js on lines 243..245

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

                  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

                      this.middleRectangle = svg.append('rect')
                          .attr('x', 25)
                          .attr('y', 15)
                          .attr('width', 50)
                          .attr('height', 70);
                  Severity: Major
                  Found in app/public/js/ui.js and 1 other location - About 1 hr to fix
                  app/public/js/ui.js on lines 109..113

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

                  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