benmarch/angular-ui-tour

View on GitHub

Showing 25 of 56 total issues

Function uiTourController has 300 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export default function uiTourController($timeout, $q, $filter, $document, TourConfig, uiTourBackdrop, uiTourService, TourStepService, hotkeys) {
    'ngInject';

    var self = new EventEmitter(),
        stepList = [],
Severity: Major
Found in app/tour-controller.js - About 1 day to fix

    Function uiTourController has a Cognitive Complexity of 73 (exceeds 5 allowed). Consider refactoring.
    Open

    export default function uiTourController($timeout, $q, $filter, $document, TourConfig, uiTourBackdrop, uiTourService, TourStepService, hotkeys) {
        'ngInject';
    
        var self = new EventEmitter(),
            stepList = [],
    Severity: Minor
    Found in app/tour-controller.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 default has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
    Open

    export default function (Tether, $compile, $document, $templateCache, $rootScope, $window, $q, $timeout, positionMap, uiTourBackdrop) {
        'ngInject';
    
        const service = {},
            /* eslint-disable */
    Severity: Minor
    Found in app/tour-step-service.js - About 5 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 TourHelpers has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
    Open

    export default function TourHelpers($http, $compile, $location, TourConfig, $q, $injector, $timeout) {
        'ngInject';
    
        var helpers = {},
            safeApply,
    Severity: Minor
    Found in app/tour-helpers.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 default has 114 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export default function (Tether, $compile, $document, $templateCache, $rootScope, $window, $q, $timeout, positionMap, uiTourBackdrop) {
        'ngInject';
    
        const service = {},
            /* eslint-disable */
    Severity: Major
    Found in app/tour-step-service.js - About 4 hrs to fix

      File tour-controller.js has 305 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import angular from 'angular';
      import EventEmitter from 'events';
      
      export default function uiTourController($timeout, $q, $filter, $document, TourConfig, uiTourBackdrop, uiTourService, TourStepService, hotkeys) {
          'ngInject';
      Severity: Minor
      Found in app/tour-controller.js - About 3 hrs to fix

        Function tourStepDirective has 81 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export default function tourStepDirective(TourHelpers, uiTourService, $sce) {
            'ngInject';
        
            return {
                restrict: 'EA',
        Severity: Major
        Found in app/tour-step-directive.js - About 3 hrs to fix

          Function TourHelpers has 77 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export default function TourHelpers($http, $compile, $location, TourConfig, $q, $injector, $timeout) {
              'ngInject';
          
              var helpers = {},
                  safeApply,
          Severity: Major
          Found in app/tour-helpers.js - About 3 hrs to fix

            Function link has 74 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    link: function (scope, element, attrs, uiTourCtrl) {
                        var ctrl,
                            //Assign required options
                            step,
                            events = 'onShow onShown onHide onHidden onNext onPrev onBackdropClick'.split(' '),
            Severity: Major
            Found in app/tour-step-directive.js - About 2 hrs to fix

              Function TourConfig has 58 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export default function TourConfig() {
                  'ngInject';
              
                  var navigationInterceptorsEnabled = false,
                      config = {
              Severity: Major
              Found in app/tour-config-provider.js - About 2 hrs to fix

                Function goTo has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    self.goTo = async function (goTo) {
                        var currentStep = getCurrentStep(),
                            stepToShow = getStep(goTo),
                            actionMap = {
                                $prev: {
                Severity: Minor
                Found in app/tour-controller.js - About 1 hr to fix

                  Function uiTourBackdrop has 43 lines of code (exceeds 25 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 1 hr to fix

                    Function tourStepDirective has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                    Open

                    export default function tourStepDirective(TourHelpers, uiTourService, $sce) {
                        'ngInject';
                    
                        return {
                            restrict: 'EA',
                    Severity: Minor
                    Found in app/tour-step-directive.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 uiTourService has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export default function uiTourService($controller, $q) {
                        'ngInject';
                    
                        var service = {},
                            tours = [];
                    Severity: Minor
                    Found in app/tour-service.js - About 1 hr to fix

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

                      module.exports = function (config) {
                          config.set({
                      
                              // base path that will be used to resolve all patterns (eg. files, exclude)
                              basePath: '.',
                      Severity: Minor
                      Found in karma.conf.js - About 1 hr to fix

                        Function default has 10 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                        export default function (Tether, $compile, $document, $templateCache, $rootScope, $window, $q, $timeout, positionMap, uiTourBackdrop) {
                        Severity: Major
                        Found in app/tour-step-service.js - About 1 hr to fix

                          Function uiTourController has 9 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                          export default function uiTourController($timeout, $q, $filter, $document, TourConfig, uiTourBackdrop, uiTourService, TourStepService, hotkeys) {
                          Severity: Major
                          Found in app/tour-controller.js - About 1 hr to fix

                            Function uiTourDirective has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            export default function uiTourDirective(TourHelpers) {
                                'ngInject';
                            
                                return {
                                    restrict: 'EA',
                            Severity: Minor
                            Found in app/tour-directive.js - About 1 hr to fix

                              Function showStep has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  service.showStep = function (step, tour) {
                                      //ensure there is a step target
                                      if (step.elementId) {
                                          step.element = angular.element($document[0].getElementById(step.elementId));
                                      }
                              Severity: Minor
                              Found in app/tour-step-service.js - About 1 hr to fix

                                Function TourHelpers has 7 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                export default function TourHelpers($http, $compile, $location, TourConfig, $q, $injector, $timeout) {
                                Severity: Major
                                Found in app/tour-helpers.js - About 50 mins to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language