benmarch/angular-ui-tour

View on GitHub

Showing 25 of 56 total issues

Function uiTourBackdrop has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

export default function uiTourBackdrop($document, Hone) {
    'ngInject';

    var service = {},
        $body = angular.element($document[0].body),
Severity: Minor
Found in app/backdrop-service.js - About 45 mins 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 setRedirect has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    helpers.setRedirect = function (step, ctrl, direction, path, targetName) {
Severity: Minor
Found in app/tour-helpers.js - About 35 mins to fix

    Function attachEventHandlers has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        helpers.attachEventHandlers = function (scope, attrs, options, events, prefix) {
    Severity: Minor
    Found in app/tour-helpers.js - About 35 mins to fix

      Avoid too many return statements within this function.
      Open

              return null;
      Severity: Major
      Found in app/tour-controller.js - About 30 mins to fix

        Function uiTourDirective has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

        export default function uiTourDirective(TourHelpers) {
            'ngInject';
        
            return {
                restrict: 'EA',
        Severity: Minor
        Found in app/tour-directive.js - About 25 mins 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