e-ucm/rage-analytics-frontend

View on GitHub
app/public/js/controllers/kibana.js

Summary

Maintainability
F
2 wks
Test Coverage

File kibana.js has 610 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*
 * Copyright 2016 e-UCM (http://www.e-ucm.es/)
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
Severity: Major
Found in app/public/js/controllers/kibana.js - About 1 day to fix

    Function getTempleateVisualizations has 112 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            $scope.getTempleateVisualizations = function () {
                if ($scope.game && $scope.version) {
    
                    $http.get(CONSTANTS.PROXY + '/kibana/templates/index/' + $scope.game._id)
                        .success(function (data) {
    Severity: Major
    Found in app/public/js/controllers/kibana.js - About 4 hrs to fix

      Function submitTemplateVisualization has 84 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              $scope.submitTemplateVisualization = function () {
                  $scope.templateVisualization.contents = JSON.parse($scope.templateVisualization.contents);
                  if ($scope.templateVisualization.contents) {
                      var isDevVis = $scope.templateVisualization.contents.isDeveloper;
                      var isTchVis = $scope.templateVisualization.contents.isTeacher;
      Severity: Major
      Found in app/public/js/controllers/kibana.js - About 3 hrs to fix

        Function selectVisualization has 69 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                $scope.selectVisualization = function (usr, visualizationId) {
                    $scope.waitOperation = true;
                    var checkboxList;
                    var listVisualizations;
                    var obj = {};
        Severity: Major
        Found in app/public/js/controllers/kibana.js - About 2 hrs to fix

          Function generateTestVisualization has 62 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  $scope.generateTestVisualization = function () {
                      var panels = [];
                      var uiStates = {};
          
                      // Add index
          Severity: Major
          Found in app/public/js/controllers/kibana.js - About 2 hrs to fix

            Function addTemplateVisualization has 60 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    $scope.addTemplateVisualization = function () {
                        var visualization = JSON.parse(document.getElementById('exampleVisualization').value);
                        if (visualization) {
                            $http.post(CONSTANTS.PROXY + '/kibana/templates/visualization/author/' + $scope.username, visualization)
                                .success(function (visualizationData) {
            Severity: Major
            Found in app/public/js/controllers/kibana.js - About 2 hrs to fix

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

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

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

                            $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

                                        $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

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

                                        $http.post(CONSTANTS.PROXY + '/kibana/visualization/game/' + $scope.game._id + '/' + visualizationData._id,
                                            $scope.dataWithField).success(function () {
                
                                        }).error(function (data, status) {
                                            console.error('Error on post /kibana/visualization/game/' + $scope.game._id + '/' + visualizationData._id + ' ' +
                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 247..253

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

                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

                                    $http.post(CONSTANTS.PROXY + '/kibana/visualization/game/' + $scope.game._id + '/' + visualizationData._id,
                                        $scope.dataWithField).success(function () {
                
                                    }).error(function (data, status) {
                                        console.error('Error on post /kibana/visualization/game/' + $scope.game._id + '/' + visualizationData._id + ' ' +
                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 480..486

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

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

                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

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

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

                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

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

                Duplicated Code

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

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

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

                Tuning

                This issue has a mass of 55.

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

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

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

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

                Refactorings

                Further Reading

                Similar blocks of code found in 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

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

                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.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 + '/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

                There are no issues that match your filters.

                Category
                Status