patternfly/angular-patternfly

View on GitHub

Showing 300 of 300 total issues

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

  controller: function () {
    'use strict';
    var ctrl = this;

    var heatmapColorPatternDefaults = ['#d4f0fa', '#F9D67A', '#EC7A08', '#CE0000'];
Severity: Minor
Found in src/charts/heatmap/heatmap-legend.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 12 (exceeds 5 allowed). Consider refactoring.
Open

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

    ctrl.$onInit = function () {
Severity: Minor
Found in src/modals/modal-overlay/modal-overlay.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 12 (exceeds 5 allowed). Consider refactoring.
Open

  controller: function () {
    'use strict';

    var ctrl = this;
    var prevConfig;
Severity: Minor
Found in src/filters/simple-filter/filter-results-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 12 (exceeds 5 allowed). Consider refactoring.
Open

    controller: function ( $uibModal ) {
      'use strict';

      var ctrl = this;
      var modalInstance;
Severity: Minor
Found in src/modals/modal-overlay/modal-overlay.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 Factory has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  function Factory ($rootScope) {
    //
    // Element that the mouse capture applies to, defaults to 'document'
    // unless the 'mouse-capture' directive is used.
    //
Severity: Minor
Found in src/canvas-view/canvas/mouse-capture-service.js - About 1 hr to fix

    Function ZoomViewModel has 35 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      pfCanvas.ZoomViewModel = function() {
        this.max = 1; // Max zoom level
        this.min = parseFloat(".5"); // Min zoom level
        this.inc = parseFloat(".25"); // Zoom level increment
        this.level = this.max; // Zoom level
    Severity: Minor
    Found in src/canvas-view/canvas/canvas-viewmodel.js - About 1 hr to fix

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

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

        Function goTo has 34 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            ctrl.goTo = function (step) {
              var focusElement = null;
        
              if (ctrl.wizard.isWizardDone() || !step.okToNavAway || step === ctrl.selectedStep) {
                return;
        Severity: Minor
        Found in src/wizard/wizard-step.component.js - About 1 hr to fix

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

              ctrl.$onInit = function () {
                ctrl.modalId = ctrl.resolve.modalId;
                ctrl.titleId = ctrl.resolve.titleId || "modalTitle";
                ctrl.modalTitle = ctrl.resolve.modalTitle;
                ctrl.hideCloseIcon = ctrl.resolve.hideCloseIcon || false;
          Severity: Minor
          Found in src/modals/modal-overlay/modal-overlay.component.js - About 1 hr to fix

            Function ConnectorViewModel has 34 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              pfCanvas.ConnectorViewModel = function(connectorDataModel, x, y, parentNode) {
                this.data = connectorDataModel;
            
                this._parentNode = parentNode;
                this._x = x;
            Severity: Minor
            Found in src/canvas-view/canvas/canvas-viewmodel.js - About 1 hr to fix

              Consider simplifying this complex logical expression.
              Open

                    if (step.allowClickNav &&
                      ctrl.selectedStep &&
                      !ctrl.wizardDone &&
                      ctrl.selectedStep.okToNavAway &&
                      (ctrl.selectedStep.nextEnabled || (step.stepPriority < ctrl.selectedStep.stepPriority)) &&
              Severity: Critical
              Found in src/wizard/wizard.component.js - About 1 hr to fix

                Function drawEdges has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    ctrl.drawEdges = function () {
                      var quadtree = d3.geom.quadtree(ctrl.force.nodes());
                      ctrl.context.strokeStyle = 'rgba(150, 150, 150, 0.6)';
                      ctrl.context.lineWidth = 1;
                      ctrl.edges.forEach(function (d) {
                Severity: Minor
                Found in src/charts/topology-map/topologyMap.component.js - About 1 hr to fix

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

                        link: function ($scope, $element, $attrs, controller, $transclude) {
                          var iChildScope;
                          var iScopeType;
                  
                          if (!$transclude) {
                  Severity: Minor
                  Found in src/utils/transclude-directive.js - About 1 hr to fix

                    Function updateConfigOptions has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        ctrl.updateConfigOptions = function () {
                          var props = "";
                    
                          if (ctrl.debug) {
                            $log.debug("  updateConfigOptions");
                    Severity: Minor
                    Found in src/table/tableview/table-view.component.js - About 1 hr to fix

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

                            if (ctrl.blockPadding === undefined || isNaN(ctrl.blockPadding)) {
                              ctrl.padding = 2;
                            } else {
                              ctrl.padding = parseInt(ctrl.blockPadding);
                            }
                      Severity: Major
                      Found in src/charts/heatmap/heatmap.component.js and 2 other locations - About 1 hr to fix
                      src/charts/heatmap/heatmap.component.js on lines 346..350
                      src/charts/heatmap/heatmap.component.js on lines 358..362

                      Duplicated Code

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

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

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

                      Tuning

                      This issue has a mass of 61.

                      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

                            if (ctrl.rangeHoverSize === undefined || isNaN(ctrl.rangeHoverSize)) {
                              ctrl.rangeHoverSize = 15;
                            } else {
                              ctrl.rangeHoverSize = parseInt(ctrl.rangeHoverSize);
                            }
                      Severity: Major
                      Found in src/charts/heatmap/heatmap.component.js and 2 other locations - About 1 hr to fix
                      src/charts/heatmap/heatmap.component.js on lines 346..350
                      src/charts/heatmap/heatmap.component.js on lines 352..356

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

                      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

                            if (ctrl.minBlockSize === undefined || isNaN(ctrl.minBlockSize)) {
                              ctrl.minSize = 2;
                            } else {
                              ctrl.minSize = parseInt(ctrl.minBlockSize);
                            }
                      Severity: Major
                      Found in src/charts/heatmap/heatmap.component.js and 2 other locations - About 1 hr to fix
                      src/charts/heatmap/heatmap.component.js on lines 352..356
                      src/charts/heatmap/heatmap.component.js on lines 358..362

                      Duplicated Code

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

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

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

                      Tuning

                      This issue has a mass of 61.

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

                            function click () {
                              var node;
                              var edge;
                              var addKey = ctrl.ctrlKey();
                              if (d3.event.defaultPrevented) {
                      Severity: Minor
                      Found in src/charts/topology-map/topologyMap.component.js - About 1 hr to fix

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

                            link: function ($scope, $element, $attributes) {
                              var charsMaxLimit = $attributes.charsMaxLimit;
                              var charsWarnRemaining = $attributes.charsWarnRemaining;
                              var countRemainingFld = angular.element(document.getElementById($attributes.countFld));
                              var blockInputAtMaxLimit = ($attributes.blockInputAtMaxLimit === 'true');
                        Severity: Minor
                        Found in src/form/remaining-chars-count/remaining-chars-count.directive.js - About 1 hr to fix

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

                            controller: function () {
                              'use strict';
                              var ctrl = this;
                          
                              var heatmapColorPatternDefaults = ['#d4f0fa', '#F9D67A', '#EC7A08', '#CE0000'];
                          Severity: Minor
                          Found in src/charts/heatmap/heatmap-legend.component.js - About 1 hr to fix
                            Severity
                            Category
                            Status
                            Source
                            Language