patternfly/angular-patternfly

View on GitHub

Showing 300 of 300 total issues

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

      node.y = Math.max(node.size + 1, Math.min(ctrl.canvasH - node.size - 1, node.y));
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 389..389

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

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

  controller: function () {
    'use strict';

    var ctrl = this;

Severity: Minor
Found in src/filters/filter-panel/filter-panel-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 next has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    ctrl.next = function (callback) {
      var enabledSteps = ctrl.getEnabledSteps();

      // Save the step  you were on when next() was invoked
      var index = stepIdx(ctrl.selectedStep);
Severity: Minor
Found in src/wizard/wizard.component.js - About 1 hr to fix

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

      bindings: {
        chartData: '=',
        chartTitle: '=',
        chartFooter: '=',
        units: '=',
    src/table/tableview/table-view.component.js on lines 2..13

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

    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

      bindings: {
        config: '<?',
        dtOptions: '<?',
        colummns: '<?',
        columns: '<?',
    Severity: Major
    Found in src/table/tableview/table-view.component.js and 1 other location - About 1 hr to fix
    src/charts/utilization-bar/utilization-bar-chart.component.js on lines 152..163

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

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

        controller: function ($timeout, $attrs) {
          var ctrl = this, prevConfig;
    
          // store the chart object
          var chart;
    Severity: Minor
    Found in src/charts/c3/c3-chart.component.js - About 1 hr to fix

      Consider simplifying this complex logical expression.
      Open

            if (ctrl.tooltipStyle) {
              ctrl.tooltipStyle = {
                size: ctrl.tooltipStyle.size || 12,
                font: ctrl.tooltipStyle.font || '"Open Sans", Helvetica, Arial, sans-serif',
                textColor: ctrl.tooltipStyle.textColor || '#FFFFFF',
      Severity: Major
      Found in src/charts/topology-map/topologyMap.component.js - About 1 hr to fix

        Function controller has 8 arguments (exceeds 4 allowed). Consider refactoring.
        Open

          controller: function (DTOptionsBuilder, DTColumnDefBuilder, $element, pfUtils, $log, $filter, $timeout, $sce) {
        Severity: Major
        Found in src/table/tableview/table-view.component.js - About 1 hr to fix

          Function message has 8 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              notifications.message = function (type, header, message, isPersistent, closeCallback, actionTitle, actionCallback, menuActions) {
          Severity: Major
          Found in src/notification/notification.js - About 1 hr to fix

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

                  if (insertBefore) {
                    ctrl.steps.splice(ctrl.steps.indexOf(insertBefore), 0, step);
                  } else {
                    ctrl.steps.push(step);
                  }
            Severity: Major
            Found in src/wizard/wizard-step.component.js and 1 other location - About 1 hr to fix
            src/wizard/wizard.component.js on lines 263..267

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

            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 (insertBefore) {
                    ctrl.steps.splice(ctrl.steps.indexOf(insertBefore), 0, step);
                  } else {
                    ctrl.steps.push(step);
                  }
            Severity: Major
            Found in src/wizard/wizard.component.js and 1 other location - About 1 hr to fix
            src/wizard/wizard-step.component.js on lines 281..285

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

            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.cancel = function () {
                  if (ctrl.onCancel) {
                    if (ctrl.onCancel() !== false) {
                      ctrl.reset();
                    }
            Severity: Minor
            Found in src/wizard/wizard.component.js and 1 other location - About 55 mins to fix
            src/wizard/wizard.component.js on lines 376..382

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

            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.finish = function () {
                  if (ctrl.onFinish) {
                    if (ctrl.onFinish() !== false) {
                      ctrl.reset();
                    }
            Severity: Minor
            Found in src/wizard/wizard.component.js and 1 other location - About 55 mins to fix
            src/wizard/wizard.component.js on lines 384..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 54.

            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

                    added.append("image")
                      .attr("xlink:href", function (d) {
                        // overwrite this . . .
                        var iconInfo = ctrl.icons[d.item.kind];
                        switch (iconInfo.type) {
            Severity: Minor
            Found in src/charts/topology/topology.component.js and 1 other location - About 55 mins to fix
            src/charts/topology/topology.component.js on lines 425..449

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

            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 (angular.isUndefined(ctrl.stepPriority)) {
                    ctrl.stepPriority = 999;
                  } else {
                    ctrl.stepPriority = parseInt(ctrl.stepPriority);
                  }
            Severity: Minor
            Found in src/wizard/wizard-step.component.js and 1 other location - About 55 mins to fix
            src/wizard/wizard-substep.component.js on lines 72..76

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

            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 (angular.isUndefined(ctrl.stepPriority)) {
                    ctrl.stepPriority = 999;
                  } else {
                    ctrl.stepPriority = parseInt(ctrl.stepPriority);
                  }
            Severity: Minor
            Found in src/wizard/wizard-substep.component.js and 1 other location - About 55 mins to fix
            src/wizard/wizard-step.component.js on lines 127..131

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

            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.dragEnd = function () {
                  if (angular.isFunction(ctrl.config.dragEnd)) {
                    ctrl.config.dragEnd();
                  }
                };
            Severity: Minor
            Found in src/views/listview/list-view.component.js and 1 other location - About 55 mins to fix
            src/views/listview/list-view.component.js on lines 318..322

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

            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.dragMoved = function () {
                  if (angular.isFunction(ctrl.config.dragMoved)) {
                    ctrl.config.dragMoved();
                  }
                };
            Severity: Minor
            Found in src/views/listview/list-view.component.js and 1 other location - About 55 mins to fix
            src/views/listview/list-view.component.js on lines 312..316

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

            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 ngEmbedApp has 7 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                            function($templateCache,   $browser,  docsRootScope, $location,   $sniffer,   $animate,   $exceptionHandler) {
            Severity: Major
            Found in misc/angular-bootstrap-prettify.js - About 50 mins to fix

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

                  this.sourceCoordY = function() {
                    return this.source.parentNode().y() + this.source.y();
                  };
              Severity: Major
              Found in src/canvas-view/canvas/canvas-viewmodel.js and 3 other locations - About 50 mins to fix
              src/canvas-view/canvas/canvas-viewmodel.js on lines 463..465
              src/canvas-view/canvas/canvas-viewmodel.js on lines 486..488
              src/canvas-view/canvas/canvas-viewmodel.js on lines 490..492

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

              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