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

                $http.get(CONSTANTS.PROXY + '/kibana/visualization/list/dev/' + $scope.game._id)
                    .success(function (data) {
                        $scope.selectedVisualizationDevList = data;
                        data.forEach(function (visualization) {
                            $scope.checkboxVisualizationsDev[visualization] = true;
Severity: Major
Found in app/public/js/controllers/kibana.js and 1 other location - About 3 days to fix
app/public/js/controllers/kibana.js on lines 654..699

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

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

                $http.get(CONSTANTS.PROXY + '/kibana/visualization/list/tch/' + $scope.game._id)
                    .success(function (data) {
                        $scope.selectedVisualizationTchList = data;
                        data.forEach(function (visualization) {
                            $scope.checkboxVisualizationsTch[visualization] = true;
Severity: Major
Found in app/public/js/controllers/kibana.js and 1 other location - About 3 days to fix
app/public/js/controllers/kibana.js on lines 607..652

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

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

            $ctrl.unlockGroups = function() {
                var route = CONSTANTS.PROXY + '/classes/' + $ctrl.class._id + '/remove';
                if ($ctrl.unlockedGroupings) {
                    $http.put(route, {groupings: $ctrl.class.groupings}).success(function (data) {
                        $ctrl.class = data;
Severity: Major
Found in app/public/js/controllers/participantsConf.js and 3 other locations - About 1 day to fix
app/public/js/controllers/activity.js on lines 377..399
app/public/js/controllers/activity.js on lines 401..423
app/public/js/controllers/participantsConf.js on lines 99..121

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

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

            $scope.unlockGroups = function () {
                var route = CONSTANTS.PROXY + '/activities/' + $scope.activity._id + '/remove';
                if ($scope.unlockedGroupings) {
                    $http.put(route, {groupings: $scope.activity.groupings}).success(function (data) {
                        $scope.activity = data;
Severity: Major
Found in app/public/js/controllers/activity.js and 3 other locations - About 1 day to fix
app/public/js/controllers/activity.js on lines 401..423
app/public/js/controllers/participantsConf.js on lines 75..97
app/public/js/controllers/participantsConf.js on lines 99..121

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

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

            $ctrl.unlockGroupings = function() {
                var route = CONSTANTS.PROXY + '/classes/' + $ctrl.class._id + '/remove';
                if ($ctrl.unlockedGroups) {
                    $http.put(route, {groups: $ctrl.class.groups}).success(function (data) {
                        $ctrl.class = data;
Severity: Major
Found in app/public/js/controllers/participantsConf.js and 3 other locations - About 1 day to fix
app/public/js/controllers/activity.js on lines 377..399
app/public/js/controllers/activity.js on lines 401..423
app/public/js/controllers/participantsConf.js on lines 75..97

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

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

            $scope.unlockGroupings = function () {
                var route = CONSTANTS.PROXY + '/activities/' + $scope.activity._id + '/remove';
                if ($scope.unlockedGroups) {
                    $http.put(route, {groups: $scope.activity.groups}).success(function (data) {
                        $scope.activity = data;
Severity: Major
Found in app/public/js/controllers/activity.js and 3 other locations - About 1 day to fix
app/public/js/controllers/activity.js on lines 377..399
app/public/js/controllers/participantsConf.js on lines 75..97
app/public/js/controllers/participantsConf.js on lines 99..121

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

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.selectedVisualizationTchList.forEach(function (visualization) {
                $http.post(CONSTANTS.PROXY + '/kibana/visualization/game/' + $scope.game._id + '/' + visualization.id, $scope.dataWithField)
                    .success(function () {
                        var body = JSON.parse(JSON.stringify($scope.dataWithField).split('.').join('(dot)'));
                        $http.post(CONSTANTS.PROXY + '/kibana/visualization/tuples/fields/game/' + $scope.game._id, body).success(function (data) {
Severity: Major
Found in app/public/js/controllers/kibana.js and 1 other location - About 1 day to fix
app/public/js/controllers/kibana.js on lines 304..318

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

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.selectedVisualizationDevList.forEach(function (visualization) {
                $http.post(CONSTANTS.PROXY + '/kibana/visualization/game/' + $scope.game._id + '/' + visualization.id, $scope.dataWithField)
                    .success(function () {
                        var body = JSON.parse(JSON.stringify($scope.dataWithField).split('.').join('(dot)'));
                        $http.post(CONSTANTS.PROXY + '/kibana/visualization/tuples/fields/game/' + $scope.game._id, body).success(function (data) {
Severity: Major
Found in app/public/js/controllers/kibana.js and 1 other location - About 1 day to fix
app/public/js/controllers/kibana.js on lines 319..333

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

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 activityChart = dash.createLineChart({
                        container: '#lrsActivityLastYear svg',
                        groupBy: 'stored',
                        range: {
                            start: (new Date(Date.now() - year)).toISOString(),
Severity: Major
Found in app/public/js/controllers/analytics.js and 1 other location - About 1 day to fix
app/public/js/controllers/analytics.js on lines 98..118

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 222.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

                    var activity2Chart = dash.createLineChart({
                        container: '#lrsActivityLastWeek svg',
                        groupBy: 'stored',
                        range: {
                            start: (new Date(Date.now() - week)).toISOString(),
Severity: Major
Found in app/public/js/controllers/analytics.js and 1 other location - About 1 day to fix
app/public/js/controllers/analytics.js on lines 72..92

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 222.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

            $ctrl.checkGroup = function (group) {
                var route = CONSTANTS.PROXY + '/classes/' + $ctrl.class._id;
                if ($ctrl.class.groups && $ctrl.class.groups.indexOf(group._id) !== -1) {
                    route += '/remove';
                }
Severity: Major
Found in app/public/js/controllers/participantsConf.js and 2 other locations - About 1 day to fix
app/public/js/controllers/activity.js on lines 496..507
app/public/js/controllers/participantsConf.js on lines 136..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 199.

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

            $ctrl.checkGrouping = function (grouping) {
                var route = CONSTANTS.PROXY + '/classes/' + $ctrl.class._id;
                if ($ctrl.class.groupings && $ctrl.class.groupings.indexOf(grouping._id) !== -1) {
                    route += '/remove';
                }
Severity: Major
Found in app/public/js/controllers/participantsConf.js and 2 other locations - About 1 day to fix
app/public/js/controllers/activity.js on lines 496..507
app/public/js/controllers/participantsConf.js on lines 123..134

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

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.checkGroup = function (group) {
                var route = CONSTANTS.PROXY + '/activities/' + $scope.activity._id;
                if ($scope.activity.groups && $scope.activity.groups.indexOf(group._id) !== -1) {
                    route += '/remove';
                }
Severity: Major
Found in app/public/js/controllers/activity.js and 2 other locations - About 1 day to fix
app/public/js/controllers/participantsConf.js on lines 123..134
app/public/js/controllers/participantsConf.js on lines 136..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 199.

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.isInSelectedGrouping = function (id, role) {
                if ($scope.selectedGrouping) {
                    if (role === 'group') {
                        return $scope.selectedGrouping.groups.indexOf(id) !== -1;
                    }
Severity: Major
Found in app/public/js/controllers/activity.js and 1 other location - About 1 day to fix
app/public/js/controllers/participantsConf.js on lines 199..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 196.

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.isInSelectedGrouping = function (id, role) {
                if ($ctrl.selectedGrouping) {
                    if (role === 'group') {
                        return $ctrl.selectedGrouping.groups.indexOf(id) !== -1;
                    }
Severity: Major
Found in app/public/js/controllers/participantsConf.js and 1 other location - About 1 day to fix
app/public/js/controllers/activity.js on lines 475..494

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

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.removeGrouping = function (grouping) {
                if (grouping.name && grouping.name.trim() !== '') {
                    var route = CONSTANTS.PROXY + '/classes/groupings/' + grouping._id;
                    $http.delete(route).success(function (data) {
                        updateGroupings();
Severity: Major
Found in app/public/js/controllers/participantsConf.js and 1 other location - About 6 hrs to fix
app/public/js/controllers/participantsConf.js on lines 352..362

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

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.removeGroup = function (group) {
                if (group.name && group.name.trim() !== '') {
                    var route = CONSTANTS.PROXY + '/classes/groups/' + group._id;
                    $http.delete(route).success(function (data) {
                        updateGroups();
Severity: Major
Found in app/public/js/controllers/participantsConf.js and 1 other location - About 6 hrs to fix
app/public/js/controllers/participantsConf.js on lines 394..404

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

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

                        $http.post(CONSTANTS.PROXY + '/kibana/templates/index/' + $scope.game._id, $scope.index.contents).success(function (data) {
                            $timeout(function () {
                                $http.get(CONSTANTS.PROXY + '/kibana/templates/fields/' + $scope.game._id).success(function (data) {
                                    $scope.dropfields = data;
                                    $scope.selectedIndex = $scope.indexTitle;
Severity: Major
Found in app/public/js/controllers/kibana.js and 1 other location - About 5 hrs to fix
app/public/js/controllers/kibana.js on lines 393..403

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

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

                $http.post(CONSTANTS.PROXY + '/kibana/templates/index/' + $scope.game._id, index).success(function (data) {
                    $timeout(function () {
                        $http.get(CONSTANTS.PROXY + '/kibana/templates/fields/' + $scope.game._id).success(function (data) {
                            $scope.dropfields = data;
                            $scope.selectedIndex = index.title;
Severity: Major
Found in app/public/js/controllers/kibana.js and 1 other location - About 5 hrs to fix
app/public/js/controllers/kibana.js on lines 271..281

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

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.changeTitle = function () {
                $http.put(CONSTANTS.PROXY + '/games/' + $scope.game._id, {title: $scope.game.title}).success(function (data) {
                }).error(function (data, status) {
                    console.error('Error on put /games/' + $scope.game._id + ' ' + JSON.stringify(data) + ', status: ' + status);
                });
Severity: Major
Found in app/public/js/controllers/game.js and 1 other location - About 5 hrs to fix
app/public/js/controllers/game.js on lines 75..80

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

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