e-ucm/rage-analytics-frontend

View on GitHub

Showing 116 of 143 total issues

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

    this.outerRectangle = svg.append('rect')
        .attr('x', 20)
        .attr('y', 10)
        .attr('width', 60)
        .attr('height', 80);
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 115..119

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

            isStudent: function () {
                return $localStorage.user && $localStorage.user.roles && $localStorage.user.roles.indexOf('student') !== -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 234..236
app/public/js/services.js on lines 237..239
app/public/js/services.js on lines 240..242

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

            isDeveloper: function () {
                return $localStorage.user && $localStorage.user.roles && $localStorage.user.roles.indexOf('developer') !== -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 234..236
app/public/js/services.js on lines 237..239
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 3 locations. Consider refactoring.
Open

                    $http.get(CONSTANTS.APIPATH + '/users/' + data.user._id + '/roles').success(function (data) {
                        $scope.$storage.user.roles = data;
                        // Timeout needed in order to ensure that the
                        // $localStorage changes are persisted, more info. at
                        // https://github.com/gsklee/ngStorage/issues/39
Severity: Major
Found in app/public/js/controllers/login.js and 2 other locations - About 1 hr to fix
app/public/js/controllers/login.js on lines 27..49
app/public/js/controllers/signup.js on lines 33..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 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 3 locations. Consider refactoring.
Open

                    $http.post(CONSTANTS.APIPATH + '/signup', $scope.user).success(function () {
                        $scope.errorResponse = '';
                        $window.location.href = 'login';
                    }).error(function (data, status) {
                        console.error('Error on post /signup: ' + JSON.stringify(data) + ', status: ' + status);
Severity: Major
Found in app/public/js/controllers/signup.js and 2 other locations - About 1 hr to fix
app/public/js/controllers/login.js on lines 32..45
app/public/js/controllers/login.js on lines 27..49

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

                $http.post(CONSTANTS.APIPATH + '/login', $scope.user).success(function (data) {
                    $localStorage.$reset();
                    $scope.$storage.user = data.user;
                    $cookies.put('rageUserCookie', data.user.token, {path: '/'});

Severity: Major
Found in app/public/js/controllers/login.js and 2 other locations - About 1 hr to fix
app/public/js/controllers/login.js on lines 32..45
app/public/js/controllers/signup.js on lines 33..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 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

            } else {
                listVisualizations = $scope.selectedVisualizationTchList ? $scope.selectedVisualizationTchList : [];
                checkboxList = $scope.checkboxVisualizationsTch ? $scope.checkboxVisualizationsTch : {};
                nameList = 'visualizationsTch';
            }
Severity: Minor
Found in app/public/js/controllers/kibana.js and 1 other location - About 55 mins to fix
app/public/js/controllers/kibana.js on lines 97..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 54.

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 (usr === 'dev') {
                listVisualizations = $scope.selectedVisualizationDevList ? $scope.selectedVisualizationDevList : [];
                checkboxList = $scope.checkboxVisualizationsDev ? $scope.checkboxVisualizationsDev : {};
                nameList = 'visualizationsDev';
            } else {
Severity: Minor
Found in app/public/js/controllers/kibana.js and 1 other location - About 55 mins to fix
app/public/js/controllers/kibana.js on lines 101..105

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

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

            $attrs.$observe('gameid', function () {
                if ($attrs.gameid && $attrs.versionid) {
                    loadByGameAndVersion($attrs.gameid, $attrs.versionid);
                }
            });
Severity: Minor
Found in app/public/js/controllers/activity-list.js and 1 other location - About 50 mins to fix
app/public/js/controllers/activity-list.js on lines 66..70

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

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

                            $http.get(CONSTANTS.PROXY + '/kibana/templates/fields/' + visualizationData._id).success(function (data) {
                                var exist = false;
                                data.forEach(function (f) {
                                    $scope.visualizationFields.forEach(function (currentF) {
                                        if (currentF === f) {
Severity: Major
Found in app/public/js/controllers/kibana.js and 7 other locations - About 50 mins to fix
app/public/js/controllers/class-list.js on lines 107..113
app/public/js/controllers/class-list.js on lines 105..117
app/public/js/controllers/class-list.js on lines 132..139
app/public/js/controllers/kibana.js on lines 193..245
app/public/js/controllers/kibana.js on lines 173..257
app/public/js/controllers/kibana.js on lines 431..490
app/public/js/controllers/kibana.js on lines 546..559

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

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

                        $http.get(CONSTANTS.PROXY + '/kibana/templates/fields/' + visualizationData._id).success(function (data) {
                            var exist = false;
                            data.forEach(function (f) {
                                $scope.visualizationFields.forEach(function (currentF) {
                                    if (currentF === f) {
Severity: Major
Found in app/public/js/controllers/kibana.js and 7 other locations - About 50 mins to fix
app/public/js/controllers/class-list.js on lines 107..113
app/public/js/controllers/class-list.js on lines 105..117
app/public/js/controllers/class-list.js on lines 132..139
app/public/js/controllers/kibana.js on lines 173..257
app/public/js/controllers/kibana.js on lines 449..478
app/public/js/controllers/kibana.js on lines 431..490
app/public/js/controllers/kibana.js on lines 546..559

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

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

                        $http.post(CONSTANTS.PROXY + '/courses', {title: $scope.newCourse.newName})
                            .success(function (data) {
                                $http.put(CONSTANTS.PROXY + '/classes/' + classObj._id, {courseId: data._id})
                                    .success(function () {
                                        getClasses();
Severity: Major
Found in app/public/js/controllers/class-list.js and 7 other locations - About 50 mins to fix
app/public/js/controllers/class-list.js on lines 107..113
app/public/js/controllers/class-list.js on lines 132..139
app/public/js/controllers/kibana.js on lines 193..245
app/public/js/controllers/kibana.js on lines 173..257
app/public/js/controllers/kibana.js on lines 449..478
app/public/js/controllers/kibana.js on lines 431..490
app/public/js/controllers/kibana.js on lines 546..559

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

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

                Games.get({gameId: gameId}).$promise.then(function(game) {
                    $scope.game = game;
                    afterLoad();
                });
Severity: Minor
Found in app/public/js/controllers/game.js and 1 other location - About 50 mins to fix
app/public/js/controllers/analysis.js on lines 32..35

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

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

            $attrs.$observe('versionid', function () {
                if ($attrs.gameid && $attrs.versionid) {
                    loadByGameAndVersion($attrs.gameid, $attrs.versionid);
                }
            });
Severity: Minor
Found in app/public/js/controllers/activity-list.js and 1 other location - About 50 mins to fix
app/public/js/controllers/activity-list.js on lines 60..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 52.

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

                                $http.put(CONSTANTS.PROXY + '/classes/' + classObj._id, {courseId: data._id})
                                    .success(function () {
                                        getClasses();
                                    }).error(function (data, status) {
                                    console.error('Error on put /classes/' + classObj._id + ' ' +
Severity: Major
Found in app/public/js/controllers/class-list.js and 7 other locations - About 50 mins to fix
app/public/js/controllers/class-list.js on lines 105..117
app/public/js/controllers/class-list.js on lines 132..139
app/public/js/controllers/kibana.js on lines 193..245
app/public/js/controllers/kibana.js on lines 173..257
app/public/js/controllers/kibana.js on lines 449..478
app/public/js/controllers/kibana.js on lines 431..490
app/public/js/controllers/kibana.js on lines 546..559

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

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

                Games.get({gameId: gameId}).$promise.then(function(game) {
                    $scope.game = game;
                    afterLoad();
                });
Severity: Minor
Found in app/public/js/controllers/analysis.js and 1 other location - About 50 mins to fix
app/public/js/controllers/game.js on lines 29..32

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

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

                $http.post(CONSTANTS.PROXY + '/kibana/templates/visualization/author/' + $scope.username,
                    $scope.templateVisualization.contents).success(function (visualizationData) {
                    $timeout(function () {
                        var visualizationBodyTemplate = $scope.dataWithField;
                        visualizationBodyTemplate.visualizationTemplate = $scope.templateVisualization.contents;
Severity: Major
Found in app/public/js/controllers/kibana.js and 7 other locations - About 50 mins to fix
app/public/js/controllers/class-list.js on lines 107..113
app/public/js/controllers/class-list.js on lines 105..117
app/public/js/controllers/class-list.js on lines 132..139
app/public/js/controllers/kibana.js on lines 193..245
app/public/js/controllers/kibana.js on lines 449..478
app/public/js/controllers/kibana.js on lines 431..490
app/public/js/controllers/kibana.js on lines 546..559

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

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

                            $http.post(CONSTANTS.PROXY + '/kibana/dashboard/activity/' + $scope.testIndex, dashboard)
                                .success(function (data) {
                                    var url = CONSTANTS.KIBANA + '/app/kibana#/dashboard/dashboard_' +
                                        $scope.testIndex + '?embed=true_g=(refreshInterval:(display:\'5%20seconds\',' +
                                        'pause:!f,section:1,value:5000),time:(from:now-1h,mode:quick,to:now))';
Severity: Major
Found in app/public/js/controllers/kibana.js and 7 other locations - About 50 mins to fix
app/public/js/controllers/class-list.js on lines 107..113
app/public/js/controllers/class-list.js on lines 105..117
app/public/js/controllers/class-list.js on lines 132..139
app/public/js/controllers/kibana.js on lines 193..245
app/public/js/controllers/kibana.js on lines 173..257
app/public/js/controllers/kibana.js on lines 449..478
app/public/js/controllers/kibana.js on lines 431..490

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

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

                    $http.put(CONSTANTS.PROXY + '/classes/' + classObj._id, reqObj)
                        .success(function () {
                            $scope.editCourse[classObj._id] = false;
                            getClasses();
                        }).error(function (data, status) {
Severity: Major
Found in app/public/js/controllers/class-list.js and 7 other locations - About 50 mins to fix
app/public/js/controllers/class-list.js on lines 107..113
app/public/js/controllers/class-list.js on lines 105..117
app/public/js/controllers/kibana.js on lines 193..245
app/public/js/controllers/kibana.js on lines 173..257
app/public/js/controllers/kibana.js on lines 449..478
app/public/js/controllers/kibana.js on lines 431..490
app/public/js/controllers/kibana.js on lines 546..559

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

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

                $http.post(CONSTANTS.PROXY + '/kibana/templates/visualization/author/' + $scope.username, visualization)
                    .success(function (visualizationData) {
                        $timeout(function () {
                            $http.post(CONSTANTS.PROXY + '/kibana/visualization/game/' + visualizationData._id + '/' + visualization.title,
                                $scope.dataWithField).success(function () {
Severity: Major
Found in app/public/js/controllers/kibana.js and 7 other locations - About 50 mins to fix
app/public/js/controllers/class-list.js on lines 107..113
app/public/js/controllers/class-list.js on lines 105..117
app/public/js/controllers/class-list.js on lines 132..139
app/public/js/controllers/kibana.js on lines 193..245
app/public/js/controllers/kibana.js on lines 173..257
app/public/js/controllers/kibana.js on lines 449..478
app/public/js/controllers/kibana.js on lines 546..559

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

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