Showing 13 of 37 total issues
Function tests
has 288 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
tests: function(dependencies: {
bsLoadingOverlayService: BsLoadingOverlayService,
$rootScope: angular.IRootScopeService,
$q: angular.IQService
}) {
File BsLoadingOverlayDirective.spec.ts
has 542 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import * as angular from 'angular';
import * as sinon from 'sinon';
import 'angular-mocks';
import 'jasmine';
File BsLoadingOverlayService.spec.ts
has 304 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import * as angular from 'angular';
import * as sinon from 'sinon';
import BsLoadingOverlayModule from './BsLoadingOverlayModule';
import {BsLoadingOverlayService} from './BsLoadingOverlayService';
Function exports
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function(config) {
config.set({
// base path that will be used to resolve all patterns (eg. files, exclude)
basePath: '',
Function BsLoadingOverlayDirective
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var BsLoadingOverlayDirective = (function () {
function BsLoadingOverlayDirective($compile, $rootScope, $templateRequest, $q, $timeout, bsLoadingOverlayService) {
var _this = this;
this.$compile = $compile;
this.$rootScope = $rootScope;
Function BsLoadingOverlayService
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var BsLoadingOverlayService = (function () {
function BsLoadingOverlayService($rootScope, $q) {
var _this = this;
this.$rootScope = $rootScope;
this.$q = $q;
Function BsLoadingOverlayInstance
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var BsLoadingOverlayInstance = (function () {
function BsLoadingOverlayInstance(referenceId, delay, activeClass, $element, overlayElement, $timeout, $q) {
this.referenceId = referenceId;
this.delay = delay;
this.activeClass = activeClass;
Function BsLoadingOverlayDirective
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function BsLoadingOverlayDirective($compile, $rootScope, $templateRequest, $q, $timeout, bsLoadingOverlayService) {
var _this = this;
this.$compile = $compile;
this.$rootScope = $rootScope;
this.$templateRequest = $templateRequest;
Function link
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.link = function (scope, $element, $attributes) {
var templatePromise;
var overlayElementScope;
var globalConfig = _this.bsLoadingOverlayService.getGlobalConfig();
var templateUrl = $attributes.bsLoadingOverlayTemplateUrl || globalConfig.templateUrl;
Function BsLoadingOverlayInstance
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function BsLoadingOverlayInstance(referenceId, delay, activeClass, $element, overlayElement, $timeout, $q) {
Function BsLoadingOverlayDirective
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
function BsLoadingOverlayDirective($compile, $rootScope, $templateRequest, $q, $timeout, bsLoadingOverlayService) {
Function BsLoadingOverlayDirectiveFactory
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
exports.BsLoadingOverlayDirectiveFactory = function ($compile, $rootScope, $templateRequest, $q, $timeout, bsLoadingOverlayService) { return (new BsLoadingOverlayDirective($compile, $rootScope, $templateRequest, $q, $timeout, bsLoadingOverlayService)); };
Function add
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
public add() {
if (this.delay) {
if (this.delayPromise) {
this.$timeout.cancel(this.delayPromise);
}
- Read upRead up
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"