e-ucm/rage-analytics-frontend

View on GitHub

Showing 143 of 143 total issues

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

                                data.forEach(function (f) {
                                    $scope.visualizationFields.forEach(function (currentF) {
                                        if (currentF === f) {
                                            exist = true;
                                        }
Severity: Major
Found in app/public/js/controllers/kibana.js and 1 other location - About 2 hrs to fix
app/public/js/controllers/kibana.js on lines 195..204

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

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

                            data.forEach(function (f) {
                                $scope.visualizationFields.forEach(function (currentF) {
                                    if (currentF === f) {
                                        exist = true;
                                    }
Severity: Major
Found in app/public/js/controllers/kibana.js and 1 other location - About 2 hrs to fix
app/public/js/controllers/kibana.js on lines 451..460

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

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 app.js has 255 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: Minor
Found in app/public/js/controllers/app.js - About 2 hrs to fix

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

    services.factory('Groups', ['$resource', 'CONSTANTS',
        function ($resource, CONSTANTS) {
            return $resource(CONSTANTS.PROXY + '/classes/:classId/groups', {classId: '@_id'}, {
                get: { method: 'GET', isArray: true, url: CONSTANTS.PROXY + '/classes/:classId/groups'}
            });
    Severity: Major
    Found in app/public/js/services.js and 1 other location - About 2 hrs to fix
    app/public/js/services.js on lines 212..218

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

    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

    services.factory('Groupings', ['$resource', 'CONSTANTS',
        function ($resource, CONSTANTS) {
            return $resource(CONSTANTS.PROXY + '/classes/:classId/groupings', {classId: '@_id'}, {
                get: { method: 'GET', isArray: true, url: CONSTANTS.PROXY + '/classes/:classId/groupings'}
            });
    Severity: Major
    Found in app/public/js/services.js and 1 other location - About 2 hrs to fix
    app/public/js/services.js on lines 204..210

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

    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

                $ctrl.getUserThClass = function(usr, role) {
                    if ($ctrl.selectedGroup && $ctrl.isInSelectedGroup(usr, role)) {
                        return 'bg-success';
                    }
                    if ($ctrl.selectedGrouping && $ctrl.isInSelectedGrouping(usr, role)) {
    Severity: Major
    Found in app/public/js/controllers/participantsConf.js and 1 other location - About 2 hrs to fix
    app/public/js/controllers/activity.js on lines 465..473

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

    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

                $scope.getUserThClass = function (usr, role) {
                    if ($scope.selectedGroup && $scope.isInSelectedGroup(usr, role)) {
                        return 'bg-success';
                    }
                    if ($scope.selectedGrouping && $scope.isInSelectedGrouping(usr, role)) {
    Severity: Major
    Found in app/public/js/controllers/activity.js and 1 other location - About 2 hrs to fix
    app/public/js/controllers/participantsConf.js on lines 189..197

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

    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

                                    if (isDevVis) {
                                        $scope.checkboxVisualizationsDev[visualizationData._id] = true;
                                        if ($scope.selectedVisualizationDevList.indexOf(visualizationData._id) === -1) {
                                            $scope.selectedVisualizationDevList.push(visualizationData._id);
                                        }
    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 231..236

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

    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

                                    if (isTchVis) {
                                        $scope.checkboxVisualizationsTch[visualizationData._id] = true;
                                        if ($scope.selectedVisualizationTchList.indexOf(visualizationData._id) === -1) {
                                            $scope.selectedVisualizationTchList.push(visualizationData._id);
                                        }
    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 225..230

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

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

                var onSetActivity = function () {
                    Classes.get({classId: $scope.activity.classId}).$promise.then(function (c) {
                        classReady = true;
                        $scope.class = c;
                        if ($scope.activity.groupings && $scope.activity.groupings.length > 0) {
    Severity: Minor
    Found in app/public/js/controllers/activity.js - About 1 hr to fix

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

                  $scope.$watch('iframeDashboardUrl', function (newValue, oldValue) {
                      var iframeObj = document.getElementById('dashboardIframe');
                      if (iframeObj) {
                          iframeObj.src = newValue;
                          iframeObj.contentWindow.location.reload();
      Severity: Major
      Found in app/public/js/controllers/activity.js and 2 other locations - About 1 hr to fix
      app/public/js/controllers/activity.js on lines 600..606
      app/public/js/controllers/class.js on lines 32..38

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

      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

                  $scope.$watch('studentIframe', function (newValue, oldValue) {
                      var iframeObj = document.getElementById('dashboardIframeStudent');
                      if (iframeObj) {
                          iframeObj.src = newValue;
                          iframeObj.contentWindow.location.reload();
      Severity: Major
      Found in app/public/js/controllers/activity.js and 2 other locations - About 1 hr to fix
      app/public/js/controllers/activity.js on lines 592..598
      app/public/js/controllers/class.js on lines 32..38

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

      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

                  $scope.$watch('dashboardLink', function (newValue, oldValue) {
                      var iframeObj = document.getElementById('dashboardIframe');
                      if (iframeObj) {
                          iframeObj.src = newValue;
                          iframeObj.contentWindow.location.reload();
      Severity: Major
      Found in app/public/js/controllers/class.js and 2 other locations - About 1 hr to fix
      app/public/js/controllers/activity.js on lines 592..598
      app/public/js/controllers/activity.js on lines 600..606

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

      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

                          if (toAdd) {
                              route = CONSTANTS.PROXY + '/classes/groupings/' + $ctrl.selectedGrouping._id;
                          } else {
                              route = CONSTANTS.PROXY + '/classes/groupings/' + $ctrl.selectedGrouping._id + '/remove';
                          }
      Severity: Major
      Found in app/public/js/controllers/participantsConf.js and 1 other location - About 1 hr to fix
      app/public/js/controllers/participantsConf.js on lines 322..326

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

      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

                          if (toAdd) {
                              route = CONSTANTS.PROXY + '/classes/groups/' + $ctrl.selectedGroup._id;
                          } else {
                              route = CONSTANTS.PROXY + '/classes/groups/' + $ctrl.selectedGroup._id + '/remove';
                          }
      Severity: Major
      Found in app/public/js/controllers/participantsConf.js and 1 other location - About 1 hr to fix
      app/public/js/controllers/participantsConf.js on lines 379..383

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

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

                  $scope.acceptCourseClass = function (classObj) {
                      var courseId = $scope.courseId.id;
                      if (courseId === 'NEW') {
                          if ($scope.newCourse.newName) {
                              $http.post(CONSTANTS.PROXY + '/courses', {title: $scope.newCourse.newName})
      Severity: Minor
      Found in app/public/js/controllers/class-list.js - About 1 hr to fix

        Function createConfig has 36 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                createConfig: ['appPrefix', function (done, results) {
        
                    var fsOptions = {
                        encoding: 'utf-8'
                    };
        Severity: Minor
        Found in bin/setup.js - About 1 hr to fix

          Function setProgress has 36 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          ColumnProgress.prototype.setProgress = function (progress) {
              this.progressRectangle
                  .attr('height', this.height * progress)
                  .attr('y', this.y + this.height - (this.height * progress));
          
          
          Severity: Minor
          Found in app/public/js/ui.js - About 1 hr to fix

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

                            $scope.lti.launch = $location.$$protocol + '://' + $location.$$host + ':' + $location.$$port +
                                '/api/login/launch/' + myPrefix + '/' + CONSTANTS.PREFIX;
            Severity: Major
            Found in app/public/js/controllers/class.js and 1 other location - About 1 hr to fix
            app/public/js/controllers/class.js on lines 217..218

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

            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

                                    $scope.lti.launch = $location.$$protocol + '://' + $location.$$host + ':' + $location.$$port +
                                        '/api/login/launch/' + myPrefix + '/' + CONSTANTS.PREFIX;
            Severity: Major
            Found in app/public/js/controllers/class.js and 1 other location - About 1 hr to fix
            app/public/js/controllers/class.js on lines 146..147

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

            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