patternfly/angular-patternfly

View on GitHub

Showing 300 of 300 total issues

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

angular.module('patternfly.wizard').component('pfWizard', {
  transclude: true,
  bindings: {
    title: '@',
    wizardTitle: '@',
Severity: Minor
Found in src/wizard/wizard.component.js - About 3 hrs to fix

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

      controller: function ($scope, $log) {
        'use strict';
        var ctrl = this;
    
        var defaultPageSizeIncrements = [5, 10, 20, 40, 80, 100];
    Severity: Major
    Found in src/pagination/pagination.component.js - About 3 hrs to fix

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

        controller: function ($window, $timeout, $element) {
          'use strict';
          var ctrl = this;
      
          var setupGroups = function () {
      Severity: Major
      Found in src/notification/notification-drawer.component.js - About 3 hrs to fix

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

          controller: function (pfUtils, $element, $timeout, $log) {
            'use strict';
            var ctrl = this, prevData;
        
            ctrl.$onInit = function () {
        Severity: Major
        Found in src/charts/donut/donut-chart-component.js - About 3 hrs to fix

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

              this.getSelectedNodes = function() {
                var selectedNodes = [];
          
                for (var i = 0; i < this.nodes.length; ++i) {
                  var node = this.nodes[i];
          Severity: Major
          Found in src/canvas-view/canvas/canvas-viewmodel.js and 1 other location - About 3 hrs to fix
          src/canvas-view/canvas/canvas-viewmodel.js on lines 1065..1076

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

          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

              this.getSelectedConnections = function() {
                var selectedConnections = [];
          
                for (var i = 0; i < this.connections.length; ++i) {
                  var connection = this.connections[i];
          Severity: Major
          Found in src/canvas-view/canvas/canvas-viewmodel.js and 1 other location - About 3 hrs to fix
          src/canvas-view/canvas/canvas-viewmodel.js on lines 1035..1046

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

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

              link: function ($scope, $element, $attrs) {
                var contentElementHeight = function (contentElement) {
                  var contentHeight = contentElement.offsetHeight;
                  contentHeight += parseInt(getComputedStyle(contentElement).marginTop);
                  contentHeight += parseInt(getComputedStyle(contentElement).marginBottom);
          Severity: Major
          Found in src/utils/fixed-accordion.directive.js - About 3 hrs to fix

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

                  ctrl.defaultConfig.axis = {
                    x: {
                      show: ctrl.showXAxis === true,
                      type: 'timeseries',
                      tick: {
            Severity: Major
            Found in src/charts/line/line-chart.component.js and 1 other location - About 3 hrs to fix
            src/charts/sparkline/sparkline-chart.component.js on lines 190..208

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

            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.defaultConfig.axis = {
                    x: {
                      show: ctrl.showXAxis === true,
                      type: 'timeseries',
                      tick: {
            Severity: Major
            Found in src/charts/sparkline/sparkline-chart.component.js and 1 other location - About 3 hrs to fix
            src/charts/line/line-chart.component.js on lines 172..190

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

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

              this.$get = ['$timeout', '$log', function ($timeout, $log) {
                var delay = this.delay;
                var notifications = this.notifications;
                var verbose = this.verbose;
                var persist = this.persist;
            Severity: Major
            Found in src/notification/notification.js - About 3 hrs to fix

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

                controller: function () {
                  'use strict';
              
                  var ctrl = this;
                  var prevConfig;
              Severity: Major
              Found in src/toolbars/toolbar-component.js - About 3 hrs to fix

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

                  controller: function () {
                    'use strict';
                
                    var ctrl = this;
                    var prevConfig;
                Severity: Major
                Found in src/filters/simple-filter/filter-fields-component.js - About 2 hrs to fix

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

                    controller: function () {
                      'use strict';
                  
                      var ctrl = this;
                      var prevConfig;
                  Severity: Major
                  Found in src/sort/sort-component.js - About 2 hrs to fix

                    File list-view.component.js has 282 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    angular.module('patternfly.views').component('pfListView', {
                      bindings: {
                        config: '=?',
                        pageConfig: '=?',
                        items: '=',
                    Severity: Minor
                    Found in src/views/listview/list-view.component.js - About 2 hrs to fix

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

                        var createNodesViewModel = function(nodesDataModel) {
                          var nodesViewModel = [];
                      
                          if (nodesDataModel) {
                            for (var i = 0; i < nodesDataModel.length; ++i) {
                      Severity: Major
                      Found in src/canvas-view/canvas/canvas-viewmodel.js and 1 other location - About 2 hrs to fix
                      src/canvas-view/canvas/canvas-viewmodel.js on lines 436..446

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

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

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

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

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

                      Refactorings

                      Further Reading

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

                        var createNodeActionsViewModel = function(nodeActionsDataModel) {
                          var nodeActionsViewModel = [];
                      
                          if (nodeActionsDataModel) {
                            for (var i = 0; i < nodeActionsDataModel.length; ++i) {
                      Severity: Major
                      Found in src/canvas-view/canvas/canvas-viewmodel.js and 1 other location - About 2 hrs to fix
                      src/canvas-view/canvas/canvas-viewmodel.js on lines 386..396

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

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

                        pfCanvas.ConnectionViewModel = function(connectionDataModel, sourceConnector, destConnector) {
                          this.data = connectionDataModel;
                          this.source = sourceConnector;
                          this.dest = destConnector;
                      
                      
                      Severity: Major
                      Found in src/canvas-view/canvas/canvas-viewmodel.js - About 2 hrs to fix

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

                            link: function (scope, element, attrs, ctrl) {
                        
                              scope.inputCtrl = ctrl;
                              scope.valEnabled = !attrs.pfValidationDisabled;
                        
                        
                        Severity: Major
                        Found in src/validation/validation.js - About 2 hrs to fix

                          Function sparklineTooltip has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              ctrl.sparklineTooltip = function () {
                                return {
                                  contents: function (d) {
                                    var tipRows;
                                    var percentUsed = 0;
                          Severity: Major
                          Found in src/charts/sparkline/sparkline-chart.component.js - About 2 hrs to fix

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

                                ctrl.isPrevEnabled = function () {
                                  var enabled = angular.isUndefined(ctrl.prevEnabled) || ctrl.prevEnabled;
                                  if (ctrl.substeps && ctrl.selectedStep) {
                                    enabled = enabled && ctrl.selectedStep.isPrevEnabled();
                                  }
                            Severity: Major
                            Found in src/wizard/wizard-step.component.js and 1 other location - About 2 hrs to fix
                            src/wizard/wizard-step.component.js on lines 190..196

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

                            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