patternfly/angular-patternfly

View on GitHub

Showing 300 of 300 total issues

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

  controller: function ($timeout, $scope) {
    'use strict';
    var ctrl = this,
      firstRun;

Severity: Major
Found in src/wizard/wizard.component.js - About 1 day to fix

    File canvas-viewmodel.js has 627 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /* eslint-disable */
    //
    // Global accessor.
    //
    var pfCanvas = {};
    Severity: Major
    Found in src/canvas-view/canvas/canvas-viewmodel.js - About 1 day to fix

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

        controller: function ($window, $element, $timeout) {
          'use strict';
          var ctrl = this;
          var prevPageConfig, prevItems;
      
      
      Severity: Major
      Found in src/views/listview/list-view.component.js - About 1 day to fix

        File topologyMap.component.js has 575 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        angular.module('patternfly.charts').component('pfTopologyMap', {
          bindings: {
            nodes: '<',
            edges: '<',
            selectNode: '&',
        Severity: Major
        Found in src/charts/topology-map/topologyMap.component.js - About 1 day to fix

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

            controller: function ($timeout, $scope) {
              'use strict';
          
              var ctrl = this,
                firstRun;
          Severity: Major
          Found in src/wizard/wizard-step.component.js - About 1 day to fix

            Function CanvasController has 232 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                  controller: function CanvasController ($scope, dragging, $element, $document) {
                    var ctrl = this;
            
                    //
                    // Translate the coordinates so they are relative to the svg element.
            Severity: Major
            Found in src/canvas-view/canvas/canvas-component.js - About 1 day to fix

              File topology.component.js has 524 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              angular.module('patternfly.charts').component('pfTopology', {
                bindings: {
                  items: '<',
                  relations: '<',
                  kinds: '<',
              Severity: Major
              Found in src/charts/topology/topology.component.js - About 1 day to fix

                Function topologyGraph has 210 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    function topologyGraph (selector, notify, options) {
                      var outer = d3.select(selector);
                
                      /* Kinds of objects to show */
                      var kinds = null;
                Severity: Major
                Found in src/charts/topology/topology.component.js - About 1 day to fix

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

                    controller: function ($element, $window, $compile, $scope, $timeout) {
                      'use strict';
                      var ctrl = this, prevData;
                  
                      var containerWidth, containerHeight, blockSize, numberOfRows;
                  Severity: Major
                  Found in src/charts/heatmap/heatmap.component.js - About 1 day to fix

                    File Gruntfile.js has 499 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    module.exports = function (grunt) {
                      'use strict';
                    
                      var nodeSass = require('node-sass');
                      require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
                    Severity: Minor
                    Found in Gruntfile.js - About 1 day to fix

                      File vertical-navigation.component.js has 487 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      angular.module('patternfly.navigation').component('pfVerticalNavigation', {
                        bindings: {
                          brandSrc: '@',
                          brandAlt: '@',
                          showBadges: '@',
                      Severity: Minor
                      Found in src/navigation/vertical-navigation.component.js - About 7 hrs to fix

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

                            ctrl.$doCheck = function () {
                              if (!angular.equals(ctrl.pageConfig, prevPageConfig)) {
                                setPagination();
                              }
                              if (!angular.equals(ctrl.items, prevItems)) {
                        Severity: Major
                        Found in src/views/cardview/card-view.component.js and 1 other location - About 6 hrs to fix
                        src/views/listview/list-view.component.js on lines 297..310

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

                        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

                            ctrl.$doCheck = function () {
                              if (!angular.equals(ctrl.pageConfig, prevPageConfig)) {
                                setPagination();
                              }
                              if (!angular.equals(ctrl.items, prevItems)) {
                        Severity: Major
                        Found in src/views/listview/list-view.component.js and 1 other location - About 6 hrs to fix
                        src/views/cardview/card-view.component.js on lines 473..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 165.

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

                          controller: function (pfUtils, $scope) {
                            'use strict';
                            var ctrl = this, prevData;
                            ctrl.$id = $scope.$id;
                        
                        
                        Severity: Major
                        Found in src/charts/donut/donut-pct-chart-component.js - About 6 hrs to fix

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

                            controller: function (pfUtils) {
                              'use strict';
                              var ctrl = this, prevChartData;
                          
                              ctrl.updateAll = function () {
                          Severity: Minor
                          Found in src/charts/sparkline/sparkline-chart.component.js - About 5 hrs 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 38 (exceeds 5 allowed). Consider refactoring.
                          Open

                            controller: function (pfUtils, $scope) {
                              'use strict';
                              var ctrl = this, prevData;
                              ctrl.$id = $scope.$id;
                          
                          
                          Severity: Minor
                          Found in src/charts/donut/donut-pct-chart-component.js - About 5 hrs 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 140 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            controller: function (pfUtils) {
                              'use strict';
                              var ctrl = this, prevChartData;
                          
                              ctrl.updateAll = function () {
                          Severity: Major
                          Found in src/charts/sparkline/sparkline-chart.component.js - About 5 hrs to fix

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

                              controller: function () {
                                'use strict';
                                var ctrl = this;
                                var prevPageConfig, prevItems;
                            
                            
                            Severity: Major
                            Found in src/views/cardview/card-view.component.js - About 5 hrs to fix

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

                                        $timeout(function () {
                                          if (step.focusSelectors) {
                                            _.find(step.focusSelectors, function (selector) {
                                              return focusElement = document.querySelector(selector);
                                            });
                              Severity: Major
                              Found in src/wizard/wizard-step.component.js and 1 other location - About 5 hrs to fix
                              src/wizard/wizard.component.js on lines 189..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 144.

                              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

                                        $timeout(function () {
                                          if (step.focusSelectors) {
                                            _.find(step.focusSelectors, function (selector) {
                                              return focusElement = document.querySelector(selector);
                                            });
                              Severity: Major
                              Found in src/wizard/wizard.component.js and 1 other location - About 5 hrs to fix
                              src/wizard/wizard-step.component.js on lines 240..260

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

                              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