patternfly/angular-patternfly

View on GitHub

Showing 300 of 300 total issues

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

      if (centerLabelText.bigText && !centerLabelText.smText) {
        donutChartTitle.text(centerLabelText.bigText);
      } else {
        donutChartTitle.insert('tspan').text(centerLabelText.bigText).classed('donut-title-big-pf', true).attr('dy', 0).attr('x', 0);
        donutChartTitle.insert('tspan').text(centerLabelText.smText).classed('donut-title-small-pf', true).attr('dy', 20).attr('x', 0);
Severity: Major
Found in src/charts/donut/donut-pct-chart-component.js and 1 other location - About 5 hrs to fix
src/charts/donut/donut-chart-component.js on lines 85..90

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

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

      if (centerLabelText.bigText && !centerLabelText.smText) {
        donutChartTitle.text(centerLabelText.bigText);
      } else {
        donutChartTitle.insert('tspan').text(centerLabelText.bigText).classed('donut-title-big-pf', true).attr('dy', 0).attr('x', 0);
        donutChartTitle.insert('tspan').text(centerLabelText.smText).classed('donut-title-small-pf', true).attr('dy', 20).attr('x', 0);
Severity: Major
Found in src/charts/donut/donut-chart-component.js and 1 other location - About 5 hrs to fix
src/charts/donut/donut-pct-chart-component.js on lines 173..178

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

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

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

angular.module('patternfly.table').component('pfTableView', {
  bindings: {
    config: '<?',
    dtOptions: '<?',
    colummns: '<?',
Severity: Minor
Found in src/table/tableview/table-view.component.js - About 5 hrs to fix

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

      controller: function () {
        'use strict';
    
        var ctrl = this;
        var prevConfig;
    Severity: Minor
    Found in src/sort/sort-component.js - About 4 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 119 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        controller: function ($timeout) {
          var ctrl = this;
    
          ctrl.$onInit = function () {
            ctrl.newNodeCount = 0;
    Severity: Major
    Found in src/canvas-view/canvas-editor/canvas-editor.component.js - About 4 hrs to fix

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

        controller: function ($scope, $log) {
          'use strict';
          var ctrl = this;
      
          var defaultPageSizeIncrements = [5, 10, 20, 40, 80, 100];
      Severity: Minor
      Found in src/pagination/pagination.component.js - About 4 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

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

            $timeout(function() {
              var parentDiv = undefined;
              var nextElement;
      
              nextElement = event.target;
      Severity: Major
      Found in src/views/listview/list-view.component.js and 1 other location - About 4 hrs to fix
      src/table/tableview/table-view.component.js on lines 449..463

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

      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 () {
              var parentDiv = undefined;
              var nextElement;
      
              nextElement = event.target;
      Severity: Major
      Found in src/table/tableview/table-view.component.js and 1 other location - About 4 hrs to fix
      src/views/listview/list-view.component.js on lines 136..150

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

      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 29 (exceeds 5 allowed). Consider refactoring.
      Open

        controller: function ($scope) {
          'use strict';
          var ctrl = this;
      
          ctrl.$onInit = function () {
      Severity: Minor
      Found in src/wizard/wizard-substep.component.js - About 4 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 NodeViewModel has 104 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        pfCanvas.NodeViewModel = function(nodeDataModel) {
          this.data = nodeDataModel;
      
          // set the default width value of the node
          if (!this.data.width || this.data.width < 0) {
      Severity: Major
      Found in src/canvas-view/canvas/canvas-viewmodel.js - About 4 hrs to fix

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

          controller: function () {
            'use strict';
        
            var ctrl = this;
            var prevConfig;
        Severity: Minor
        Found in src/filters/simple-filter/filter-fields-component.js - About 4 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

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

              if ((blockSize - ctrl.padding) > ctrl.maxSize) {
                blockSize = ctrl.padding + ctrl.maxSize;
        
                // Attempt to square off the area, check if square fits
                numberOfRows = Math.ceil(Math.sqrt(ctrl.data.length));
        Severity: Major
        Found in src/charts/heatmap/heatmap.component.js and 1 other location - About 3 hrs to fix
        src/charts/heatmap/heatmap.component.js on lines 199..210

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

        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 if ((blockSize - ctrl.padding) < ctrl.minSize) {
                blockSize = ctrl.padding + ctrl.minSize;
        
                // Attempt to square off the area, check if square fits
                numberOfRows = Math.ceil(Math.sqrt(ctrl.data.length));
        Severity: Major
        Found in src/charts/heatmap/heatmap.component.js and 1 other location - About 3 hrs to fix
        src/charts/heatmap/heatmap.component.js on lines 190..210

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

        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 5 locations. Consider refactoring.
        Open

          angular.module('patternfly.wizard').component('pfWizFinish', {
            bindings: {
              callback: "=?"
            },
            controller: function ($element, $scope) {
        Severity: Major
        Found in src/wizard/wizard-buttons.js and 4 other locations - About 3 hrs to fix
        src/wizard/wizard-buttons.js on lines 28..43
        src/wizard/wizard-buttons.js on lines 45..60
        src/wizard/wizard-buttons.js on lines 79..94
        src/wizard/wizard-buttons.js on lines 96..111

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

        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 5 locations. Consider refactoring.
        Open

          angular.module('patternfly.wizard').component('pfWizNext', {
            bindings: {
              callback: "=?"
            },
            controller: function ($element, $scope) {
        Severity: Major
        Found in src/wizard/wizard-buttons.js and 4 other locations - About 3 hrs to fix
        src/wizard/wizard-buttons.js on lines 45..60
        src/wizard/wizard-buttons.js on lines 62..77
        src/wizard/wizard-buttons.js on lines 79..94
        src/wizard/wizard-buttons.js on lines 96..111

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

        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 5 locations. Consider refactoring.
        Open

          angular.module('patternfly.wizard').component('pfWizReset', {
            bindings: {
              callback: "=?"
            },
            controller: function ($element, $scope) {
        Severity: Major
        Found in src/wizard/wizard-buttons.js and 4 other locations - About 3 hrs to fix
        src/wizard/wizard-buttons.js on lines 28..43
        src/wizard/wizard-buttons.js on lines 45..60
        src/wizard/wizard-buttons.js on lines 62..77
        src/wizard/wizard-buttons.js on lines 79..94

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

        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 5 locations. Consider refactoring.
        Open

          angular.module('patternfly.wizard').component('pfWizPrevious', {
            bindings: {
              callback: "=?"
            },
            controller: function ($element, $scope) {
        Severity: Major
        Found in src/wizard/wizard-buttons.js and 4 other locations - About 3 hrs to fix
        src/wizard/wizard-buttons.js on lines 28..43
        src/wizard/wizard-buttons.js on lines 62..77
        src/wizard/wizard-buttons.js on lines 79..94
        src/wizard/wizard-buttons.js on lines 96..111

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

        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 5 locations. Consider refactoring.
        Open

          angular.module('patternfly.wizard').component('pfWizCancel', {
            bindings: {
              callback: "=?"
            },
            controller: function ($element, $scope) {
        Severity: Major
        Found in src/wizard/wizard-buttons.js and 4 other locations - About 3 hrs to fix
        src/wizard/wizard-buttons.js on lines 28..43
        src/wizard/wizard-buttons.js on lines 45..60
        src/wizard/wizard-buttons.js on lines 62..77
        src/wizard/wizard-buttons.js on lines 96..111

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

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

            function render (args) {
              var vertices = args[0];
              var added = args[1];
              var event;
        
        
        Severity: Major
        Found in src/charts/topology/topology.component.js - About 3 hrs to fix

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

            controller: function () {
              'use strict';
          
              var ctrl = this;
              var prevConfig;
          Severity: Minor
          Found in src/toolbars/toolbar-component.js - About 3 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

          Severity
          Category
          Status
          Source
          Language