Showing 2 of 7 total issues
Function prototype
has 176 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
CircuitBreaker.prototype = (function () {
/**
* Method for initialization
* @param {Object} [options] the configuration options for the instance
* @param {Number} [options.slidingTimeWindow = 30000] - the time window that will be used for state calculations [milliseconds]
Consider simplifying this complex logical expression. Open
Open
if (!this.initialized) {
options = options || {};
this.slidingTimeWindow = !isNaN(options.slidingTimeWindow) && 0 < options.slidingTimeWindow ? parseInt(options.slidingTimeWindow, 10) : 30000;
this.bucketsNumber = !isNaN(options.bucketsNumber) && 0 < options.bucketsNumber ? parseInt(options.bucketsNumber, 10) : 10;