bsalex/angular-loading-overlay

View on GitHub

Showing 13 of 37 total issues

Function tests has 288 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    tests: function(dependencies: {
        bsLoadingOverlayService: BsLoadingOverlayService,
        $rootScope: angular.IRootScopeService,
        $q: angular.IQService
    }) {
Severity: Major
Found in source/BsLoadingOverlayService.spec.ts - About 1 day to fix

    File BsLoadingOverlayDirective.spec.ts has 542 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import * as angular from 'angular';
    import * as sinon from 'sinon';
    import 'angular-mocks';
    import 'jasmine';
    
    
    Severity: Major
    Found in source/BsLoadingOverlayDirective.spec.ts - About 1 day to fix

      File BsLoadingOverlayService.spec.ts has 304 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import * as angular from 'angular';
      import * as sinon from 'sinon';
      
      import BsLoadingOverlayModule from './BsLoadingOverlayModule';
      import {BsLoadingOverlayService} from './BsLoadingOverlayService';
      Severity: Minor
      Found in source/BsLoadingOverlayService.spec.ts - About 3 hrs to fix

        Function exports has 59 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: Major
        Found in karma.conf.js - About 2 hrs to fix

          Function BsLoadingOverlayDirective has 52 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              var BsLoadingOverlayDirective = (function () {
                  function BsLoadingOverlayDirective($compile, $rootScope, $templateRequest, $q, $timeout, bsLoadingOverlayService) {
                      var _this = this;
                      this.$compile = $compile;
                      this.$rootScope = $rootScope;
          Severity: Major
          Found in dist/angular-loading-overlay.js - About 2 hrs to fix

            Function BsLoadingOverlayService has 46 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                var BsLoadingOverlayService = (function () {
                    function BsLoadingOverlayService($rootScope, $q) {
                        var _this = this;
                        this.$rootScope = $rootScope;
                        this.$q = $q;
            Severity: Minor
            Found in dist/angular-loading-overlay.js - About 1 hr to fix

              Function BsLoadingOverlayInstance has 44 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  var BsLoadingOverlayInstance = (function () {
                      function BsLoadingOverlayInstance(referenceId, delay, activeClass, $element, overlayElement, $timeout, $q) {
                          this.referenceId = referenceId;
                          this.delay = delay;
                          this.activeClass = activeClass;
              Severity: Minor
              Found in dist/angular-loading-overlay.js - About 1 hr to fix

                Function BsLoadingOverlayDirective has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        function BsLoadingOverlayDirective($compile, $rootScope, $templateRequest, $q, $timeout, bsLoadingOverlayService) {
                            var _this = this;
                            this.$compile = $compile;
                            this.$rootScope = $rootScope;
                            this.$templateRequest = $templateRequest;
                Severity: Minor
                Found in dist/angular-loading-overlay.js - About 1 hr to fix

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

                              this.link = function (scope, $element, $attributes) {
                                  var templatePromise;
                                  var overlayElementScope;
                                  var globalConfig = _this.bsLoadingOverlayService.getGlobalConfig();
                                  var templateUrl = $attributes.bsLoadingOverlayTemplateUrl || globalConfig.templateUrl;
                  Severity: Minor
                  Found in dist/angular-loading-overlay.js - About 1 hr to fix

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

                            function BsLoadingOverlayInstance(referenceId, delay, activeClass, $element, overlayElement, $timeout, $q) {
                    Severity: Major
                    Found in dist/angular-loading-overlay.js - About 50 mins to fix

                      Function BsLoadingOverlayDirective has 6 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                              function BsLoadingOverlayDirective($compile, $rootScope, $templateRequest, $q, $timeout, bsLoadingOverlayService) {
                      Severity: Minor
                      Found in dist/angular-loading-overlay.js - About 45 mins to fix

                        Function BsLoadingOverlayDirectiveFactory has 6 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                            exports.BsLoadingOverlayDirectiveFactory = function ($compile, $rootScope, $templateRequest, $q, $timeout, bsLoadingOverlayService) { return (new BsLoadingOverlayDirective($compile, $rootScope, $templateRequest, $q, $timeout, bsLoadingOverlayService)); };
                        Severity: Minor
                        Found in dist/angular-loading-overlay.js - About 45 mins to fix

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

                              public add() {
                                  if (this.delay) {
                                      if (this.delayPromise) {
                                          this.$timeout.cancel(this.delayPromise);
                                      }
                          Severity: Minor
                          Found in source/BsLoadingOverlayInstance.ts - 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