patternfly/angular-patternfly

View on GitHub

Showing 300 of 300 total issues

Function deleteSelected has 43 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    this.deleteSelected = function() {
      var newNodeViewModels = [];
      var newNodeDataModels = [];

      var deletedNodeIds = [];
Severity: Minor
Found in src/canvas-view/canvas/canvas-viewmodel.js - About 1 hr to fix

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

        ctrl.$doCheck = function () {
          // do a deep compare on chartData and config
          if (!angular.equals(ctrl.chartData, prevChartData) || !angular.equals(ctrl.config, prevConfig)) {
            ctrl.updateAll();
          }
    src/charts/trends/trends-chart.component.js on lines 285..290
    src/charts/utilization-bar/utilization-bar-chart.component.js on lines 204..209

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 69.

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

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

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

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

    Refactorings

    Further Reading

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

        ctrl.$doCheck = function () {
          // do a deep compare on chartData and config
          if (!angular.equals(ctrl.chartData, prevChartData) || !angular.equals(ctrl.config, prevConfig)) {
            ctrl.updateAll();
          }
    Severity: Major
    Found in src/charts/trends/trends-chart.component.js and 2 other locations - About 1 hr to fix
    src/charts/utilization-bar/utilization-bar-chart.component.js on lines 204..209
    src/charts/utilization-trend/utilization-trend-chart-component.js on lines 234..239

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 69.

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

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

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

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

    Refactorings

    Further Reading

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

        ctrl.$doCheck = function () {
          // do a deep compare on chartData and layout
          if (!angular.equals(ctrl.chartData, prevChartData) || !angular.equals(ctrl.layout, prevLayout)) {
            ctrl.updateAll();
          }
    src/charts/trends/trends-chart.component.js on lines 285..290
    src/charts/utilization-trend/utilization-trend-chart-component.js on lines 234..239

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 69.

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

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

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

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

    Refactorings

    Further Reading

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

            $scope.maxZoom = function () {
              return (ctrl.chart.chartViewModel && ctrl.chart.chartViewModel.zoom) ? ctrl.chart.chartViewModel.zoom.isMax() : false;
            };
    Severity: Major
    Found in src/canvas-view/canvas/canvas-component.js and 1 other location - About 1 hr to fix
    src/canvas-view/canvas/canvas-component.js on lines 336..338

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

    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.minZoom = function () {
              return (ctrl.chart.chartViewModel && ctrl.chart.chartViewModel.zoom) ? ctrl.chart.chartViewModel.zoom.isMin() : false;
            };
    Severity: Major
    Found in src/canvas-view/canvas/canvas-component.js and 1 other location - About 1 hr to fix
    src/canvas-view/canvas/canvas-component.js on lines 333..335

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

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

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

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

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

    Refactorings

    Further Reading

    Function controller has 41 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      controller: function (pfUtils) {
        'use strict';
        var ctrl = this, prevChartData, prevConfig;
        var SMALL = 30, LARGE = 60;
    
    
    Severity: Minor
    Found in src/charts/trends/trends-chart.component.js - About 1 hr to fix

      Function $onInit has 41 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          ctrl.$onInit = function () {
            firstRun = true;
            ctrl.steps = [];
            ctrl.context = {};
            ctrl.title =  ctrl.stepTitle;
      Severity: Minor
      Found in src/wizard/wizard-step.component.js - About 1 hr to fix

        Function digest has 41 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

              function digest () {
                var pnodes = nodes;
                var plookup = lookup;
                var item, id, kind, node;
                var i, len, relation, s, t;
        Severity: Minor
        Found in src/charts/topology/topology.component.js - About 1 hr to fix

          Function open has 41 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                ctrl.open = function () {
                  modalInstance = $uibModal.open({
                    component: 'pfModalOverlayContent',
                    backdrop: ctrl.backgroundClose ? true : 'static',
                    resolve: {
          Severity: Minor
          Found in src/modals/modal-overlay/modal-overlay.component.js - About 1 hr to fix

            Function link has 41 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                link: function(scope, element, attr) {
                  var name = '',
                    stylesheet = '<link rel="stylesheet" href="http://twitter.github.com/bootstrap/assets/css/bootstrap.css">\n',
                    fields = {
                      html: '',
            Severity: Minor
            Found in misc/angular-bootstrap-prettify.js - About 1 hr to fix

              Function updateAll has 40 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  ctrl.updateAll = function () {
                    // Need to deep watch changes in chart data
                    prevChartData = angular.copy(ctrl.chartData);
              
                    // Create an ID for the chart based on the chartId in the config if given
              Severity: Minor
              Found in src/charts/sparkline/sparkline-chart.component.js - About 1 hr to fix

                Function updateConfig has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    var updateConfig = function () {
                      //Allow overriding of defaults
                      if (ctrl.maxBlockSize === undefined || isNaN(ctrl.maxBlockSize)) {
                        ctrl.maxSize = 64;
                      } else {
                Severity: Minor
                Found in src/charts/heatmap/heatmap.component.js - About 1 hr to fix

                  Function itemClick has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      ctrl.itemClick = function (e, item) {
                        var alreadySelected;
                        var selectionChanged = false;
                        var continueEvent = true;
                  
                  
                  Severity: Minor
                  Found in src/views/cardview/card-view.component.js - About 1 hr to fix

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

                            vertices
                              .attr("cx", function (d) {
                                d.x = d.fixed ? d.x : Math.max(radius, Math.min(width - radius, d.x));
                                return d.x;
                              })
                    Severity: Major
                    Found in src/charts/topology/topology.component.js and 1 other location - About 1 hr to fix
                    src/charts/topology/topology.component.js on lines 137..145

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

                    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

                              translateX = Math.min(0, Math.max(ctrl.zoom.translate()[0], ctrl.canvasW - ctrl.canvasW * ctrl.zoom.scale()));
                    Severity: Major
                    Found in src/charts/topology-map/topologyMap.component.js and 1 other location - About 1 hr to fix
                    src/charts/topology-map/topologyMap.component.js on lines 279..279

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

                    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

                              translateY = Math.min(0, Math.max(ctrl.zoom.translate()[1], ctrl.canvasH - ctrl.canvasH * ctrl.zoom.scale()));
                    Severity: Major
                    Found in src/charts/topology-map/topologyMap.component.js and 1 other location - About 1 hr to fix
                    src/charts/topology-map/topologyMap.component.js on lines 278..278

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

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

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

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

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

                    Refactorings

                    Further Reading

                    Function controller has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                    Open

                      controller: function () {
                        'use strict';
                        var ctrl = this;
                    
                        ctrl.footerCallBackFn = function () {
                    Severity: Minor
                    Found in src/card/basic/card.component.js - About 1 hr to fix

                    Cognitive Complexity

                    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                    A method's cognitive complexity is based on a few simple rules:

                    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                    • Code is considered more complex for each "break in the linear flow of the code"
                    • Code is considered more complex when "flow breaking structures are nested"

                    Further reading

                    Function controller has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                    Open

                      controller: function (pfUtils) {
                        'use strict';
                        var ctrl = this, prevChartData, prevConfig;
                        var SMALL = 30, LARGE = 60;
                    
                    
                    Severity: Minor
                    Found in src/charts/trends/trends-chart.component.js - About 1 hr to fix

                    Cognitive Complexity

                    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                    A method's cognitive complexity is based on a few simple rules:

                    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                    • Code is considered more complex for each "break in the linear flow of the code"
                    • Code is considered more complex when "flow breaking structures are nested"

                    Further reading

                    Function controller has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                    Open

                      controller: function (pfUtils) {
                        'use strict';
                        var ctrl = this, prevChartData, prevConfig;
                    
                        ctrl.updateAll = function () {
                    Severity: Minor
                    Found in src/charts/utilization-trend/utilization-trend-chart-component.js - About 1 hr to fix

                    Cognitive Complexity

                    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                    A method's cognitive complexity is based on a few simple rules:

                    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                    • Code is considered more complex for each "break in the linear flow of the code"
                    • Code is considered more complex when "flow breaking structures are nested"

                    Further reading

                    Severity
                    Category
                    Status
                    Source
                    Language