Function addToCookies
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
addToCookies(key, value) {
if (Tools.isUndefined(value)) {
return false;
} else if (Tools.isArray(value) || Tools.isObject(value)) {
Function addToLocalStorage
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private addToLocalStorage(key, value) {
// Let's convert undefined values to null to get the value consistent
if (Tools.isUndefined(value)) {
value = null;
- 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"
Further reading
Function getFromCookies
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
getFromCookies(key) {
if (!this.browserSupportsCookies) {
this._$rootScope.$broadcast("AngularAppInsights.Storage.notification.error", "COOKIES_NOT_SUPPORTED");
return false;
}
- 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"
Further reading
Function addToLocalStorage
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
private addToLocalStorage(key, value) {
// Let's convert undefined values to null to get the value consistent
if (Tools.isUndefined(value)) {
value = null;
Function addToCookies
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
addToCookies(key, value) {
if (Tools.isUndefined(value)) {
return false;
} else if (Tools.isArray(value) || Tools.isObject(value)) {
- 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"
Further reading
Function getFromLocalStorage
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private getFromLocalStorage(key) {
if (!this.browserSupportsLocalStorage() || this._self.storageType === "cookie") {
if (!this.browserSupportsLocalStorage()) {
this._$rootScope.$broadcast("AngularAppInsights.Storage.notification.warning", "LOCAL_STORAGE_NOT_SUPPORTED");
- 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"