patternfly/angular-patternfly

View on GitHub

Showing 300 of 300 total issues

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

    Function controller has 30 lines of code (exceeds 25 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

      Function controller has 30 lines of code (exceeds 25 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

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

              ctrl.maxZoom = function () {
                if (ctrl.chartViewModel && ctrl.chartViewModel.zoom) {
                  return ctrl.chartViewModel.zoom.isMax();
                }
        
        
        Severity: Major
        Found in src/canvas-view/canvas-editor/canvas-editor.component.js and 1 other location - About 1 hr to fix
        src/canvas-view/canvas-editor/canvas-editor.component.js on lines 152..158

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

        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

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

        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

              if (endConnectorIndex === -1) {
                endConnectorIndex = endNode.outputConnectors.indexOf(endConnector);
                endConnectorType = 'output';
                if (endConnectorIndex === -1) {
                  throw new Error("Failed to find dest connector within inputConnectors or outputConnectors of dest node.");
        Severity: Major
        Found in src/canvas-view/canvas/canvas-viewmodel.js and 1 other location - About 1 hr to fix
        src/canvas-view/canvas/canvas-viewmodel.js on lines 723..729

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

        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

              if (startConnectorIndex === -1) {
                startConnectorIndex = startNode.inputConnectors.indexOf(startConnector);
                startConnectorType = 'input';
                if (startConnectorIndex === -1) {
                  throw new Error("Failed to find source connector within either inputConnectors or outputConnectors of source node.");
        Severity: Major
        Found in src/canvas-view/canvas/canvas-viewmodel.js and 1 other location - About 1 hr to fix
        src/canvas-view/canvas/canvas-viewmodel.js on lines 735..741

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

        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

          pfCanvas.computeConnectionDestTangent = function(pt1, pt2) {
            return {
              x: pfCanvas.computeConnectionDestTangentX(pt1, pt2),
              y: pfCanvas.computeConnectionDestTangentY(pt1, pt2)
            };
        Severity: Major
        Found in src/canvas-view/canvas/canvas-viewmodel.js and 1 other location - About 1 hr to fix
        src/canvas-view/canvas/canvas-viewmodel.js on lines 578..583

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

        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

          pfCanvas.computeConnectionSourceTangent = function(pt1, pt2) {
            return {
              x: pfCanvas.computeConnectionSourceTangentX(pt1, pt2),
              y: pfCanvas.computeConnectionSourceTangentY(pt1, pt2)
            };
        Severity: Major
        Found in src/canvas-view/canvas/canvas-viewmodel.js and 1 other location - About 1 hr to fix
        src/canvas-view/canvas/canvas-viewmodel.js on lines 602..607

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

        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

              if (changesObj.nextTooltip) {
                if (_.get(ctrl.wizard, 'selectedStep') === ctrl) {
                  ctrl.wizard.nextTooltip = changesObj.nextTooltip.currentValue;
                }
              }
        Severity: Major
        Found in src/wizard/wizard-step.component.js and 1 other location - About 1 hr to fix
        src/wizard/wizard-step.component.js on lines 157..161

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

        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 (ctrl.navHoverTimeout === undefined) {
                    item.navHoverTimeout = $timeout(function () {
                      ctrl.hoverTertiaryNav = true;
                      item.isHover = true;
                      item.navHoverTimeout = undefined;
        Severity: Major
        Found in src/navigation/vertical-navigation.component.js and 1 other location - About 1 hr to fix
        src/navigation/vertical-navigation.component.js on lines 429..435

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

        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

              if (changesObj.prevTooltip) {
                if (_.get(ctrl.wizard, 'selectedStep') === ctrl) {
                  ctrl.wizard.prevTooltip = changesObj.prevTooltip.currentValue;
                }
              }
        Severity: Major
        Found in src/wizard/wizard-step.component.js and 1 other location - About 1 hr to fix
        src/wizard/wizard-step.component.js on lines 151..155

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

        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 (ctrl.navHoverTimeout === undefined && !item.isHover) {
                    item.navHoverTimeout = $timeout(function () {
                      ctrl.hoverSecondaryNav = true;
                      item.isHover = true;
                      item.navHoverTimeout = undefined;
        Severity: Major
        Found in src/navigation/vertical-navigation.component.js and 1 other location - About 1 hr to fix
        src/navigation/vertical-navigation.component.js on lines 464..470

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

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

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

          Function donutTooltip has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              ctrl.donutTooltip = function () {
                return {
                  contents: function (d) {
                    // Default to percent format
                    var tooltipContent =
          Severity: Minor
          Found in src/charts/donut/donut-pct-chart-component.js - About 1 hr to fix

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

                    ctrl.$onInit = function () {
                      var backspaceKeyCode = 8;
                      var deleteKeyCode = 46;
                      var aKeyCode = 65;
                      var escKeyCode = 27;
            Severity: Minor
            Found in src/canvas-view/canvas/canvas-component.js - About 1 hr to fix

              Function selectRowsByChecked has 28 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function selectRowsByChecked () {
                    if (ctrl.config.showCheckboxes) {
                      $timeout(function () {
                        var oTable, rows, checked;
              
              
              Severity: Minor
              Found in src/table/tableview/table-view.component.js - About 1 hr to fix

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

                    this.getChartHeight = function() {
                      var height = (pfCanvas.defaultHeight / this.min) * this.getLevel();
                
                      return height;
                    };
                Severity: Major
                Found in src/canvas-view/canvas/canvas-viewmodel.js and 1 other location - About 1 hr to fix
                src/canvas-view/canvas/canvas-viewmodel.js on lines 1123..1127

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

                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

                      node.x = Math.max(node.size + 1, Math.min(ctrl.canvasW - node.size - 1, node.x));
                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 390..390

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

                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.getChartWidth = function() {
                      var width = (pfCanvas.defaultWidth / this.min) * this.getLevel();
                
                      return width;
                    };
                Severity: Major
                Found in src/canvas-view/canvas/canvas-viewmodel.js and 1 other location - About 1 hr to fix
                src/canvas-view/canvas/canvas-viewmodel.js on lines 1114..1118

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

                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