patternfly/angular-patternfly

View on GitHub

Showing 300 of 300 total issues

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

  controller: function ($window, $timeout, $injector, $location, $rootScope, $scope) {
    'use strict';
    var routeChangeListener,
      ctrl = this,
      $state;
Severity: Minor
Found in src/navigation/vertical-navigation.component.js - About 4 days 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 153 (exceeds 5 allowed). Consider refactoring.
Open

  controller: function (DTOptionsBuilder, DTColumnDefBuilder, $element, pfUtils, $log, $filter, $timeout, $sce) {
    'use strict';
    var ctrl = this, prevDtOptions, prevItems, prevPageConfig, prevShowCheckboxes;

    // Once datatables is out of active development I'll remove log statements
Severity: Minor
Found in src/table/tableview/table-view.component.js - About 3 days 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 558 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  controller: function  ($element, pfUtils, $scope, $window, $q) {
    'use strict';
    var ctrl = this;
    ctrl.canvas = null;
    ctrl.showNodeLabels = false;
Severity: Major
Found in src/charts/topology-map/topologyMap.component.js - About 2 days to fix

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

      controller: function  ($element, pfUtils, $scope, $window, $q) {
        'use strict';
        var ctrl = this;
        ctrl.canvas = null;
        ctrl.showNodeLabels = false;
    Severity: Minor
    Found in src/charts/topology-map/topologyMap.component.js - About 2 days 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 504 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      controller: function ($element, $attrs) {
        'use strict';
        var options, graph,
          ctrl = this,
          previousItems,
    Severity: Major
    Found in src/charts/topology/topology.component.js - About 2 days to fix

      Function exports has 496 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      module.exports = function (grunt) {
        'use strict';
      
        var nodeSass = require('node-sass');
        require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks);
      Severity: Major
      Found in Gruntfile.js - About 2 days to fix

        Function init has 491 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          function init () {
        
            // '--sass' command line argument exists?
            var sassBuild = grunt.option('sass');
        
        
        Severity: Major
        Found in Gruntfile.js - About 2 days to fix

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

            controller: function ($timeout, $scope) {
              'use strict';
              var ctrl = this,
                firstRun;
          
          
          Severity: Minor
          Found in src/wizard/wizard.component.js - About 2 days 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 467 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            controller: function ($window, $timeout, $injector, $location, $rootScope, $scope) {
              'use strict';
              var routeChangeListener,
                ctrl = this,
                $state;
          Severity: Major
          Found in src/navigation/vertical-navigation.component.js - About 2 days to fix

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

              controller: function ($window, $element, $timeout) {
                'use strict';
                var ctrl = this;
                var prevPageConfig, prevItems;
            
            
            Severity: Minor
            Found in src/views/listview/list-view.component.js - About 2 days 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 105 (exceeds 5 allowed). Consider refactoring.
            Open

              controller: function ($element, $attrs) {
                'use strict';
                var options, graph,
                  ctrl = this,
                  previousItems,
            Severity: Minor
            Found in src/charts/topology/topology.component.js - About 2 days 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

                  if (ctrl.config && ctrl.config.selectItems && item) {
                    if (ctrl.config.multiSelect && !ctrl.config.dblClick) {
            
                      alreadySelected = _.find(ctrl.config.selectedItems, function (itemObj) {
                        return itemObj === item;
            Severity: Major
            Found in src/views/cardview/card-view.component.js and 1 other location - About 1 day to fix
            src/views/listview/list-view.component.js on lines 164..198

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

            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 (ctrl.config && ctrl.config.selectItems && item) {
                    if (ctrl.config.multiSelect && !ctrl.config.dblClick) {
            
                      alreadySelected = _.find(ctrl.config.selectedItems, function (itemObj) {
                        return itemObj === item;
            Severity: Major
            Found in src/views/listview/list-view.component.js and 1 other location - About 1 day to fix
            src/views/cardview/card-view.component.js on lines 355..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 346.

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

              controller: function (DTOptionsBuilder, DTColumnDefBuilder, $element, pfUtils, $log, $filter, $timeout, $sce) {
                'use strict';
                var ctrl = this, prevDtOptions, prevItems, prevPageConfig, prevShowCheckboxes;
            
                // Once datatables is out of active development I'll remove log statements
            Severity: Major
            Found in src/table/tableview/table-view.component.js - About 1 day to fix

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

                  function setPagination () {
                    if (angular.isUndefined(ctrl.pageConfig)) {
                      ctrl.pageConfig = {
                        pageNumber: 1,
                        pageSize: ctrl.items.length,
              Severity: Major
              Found in src/views/cardview/card-view.component.js and 1 other location - About 1 day to fix
              src/views/listview/list-view.component.js on lines 246..273

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

              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

                  function setPagination () {
                    if (angular.isUndefined(ctrl.pageConfig)) {
                      ctrl.pageConfig = {
                        pageNumber: 1,
                        pageSize: ctrl.items.length,
              Severity: Major
              Found in src/views/listview/list-view.component.js and 1 other location - About 1 day to fix
              src/views/cardview/card-view.component.js on lines 429..456

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

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

                controller: function ($timeout, $scope) {
                  'use strict';
              
                  var ctrl = this,
                    firstRun;
              Severity: Minor
              Found in src/wizard/wizard-step.component.js - About 1 day 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 75 (exceeds 5 allowed). Consider refactoring.
              Open

                controller: function ($element, $window, $compile, $scope, $timeout) {
                  'use strict';
                  var ctrl = this, prevData;
              
                  var containerWidth, containerHeight, blockSize, numberOfRows;
              Severity: Minor
              Found in src/charts/heatmap/heatmap.component.js - About 1 day 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 73 (exceeds 5 allowed). Consider refactoring.
              Open

                controller: function () {
                  'use strict';
                  var ctrl = this;
                  var prevPageConfig, prevItems;
              
              
              Severity: Minor
              Found in src/views/cardview/card-view.component.js - About 1 day 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 ChartViewModel has 288 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                pfCanvas.ChartViewModel = function(chartDataModel) {
                  //
                  // Find a specific node within the chart.
                  //
                  this.findNode = function(nodeID) {
              Severity: Major
              Found in src/canvas-view/canvas/canvas-viewmodel.js - About 1 day to fix
                Severity
                Category
                Status
                Source
                Language