Showing 272 of 791 total issues
Function ngOnInit
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
ngOnInit(): void {
if (typeof window !== 'undefined') {
this.classMap = this.elementRef.nativeElement.getAttribute('class') || '';
}
// watch for maxSize
- 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 positionElements
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public positionElements(
hostElement: HTMLElement,
targetElement: HTMLElement,
placement: string,
appendToBody?: boolean
- 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 getValueFromObject
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function getValueFromObject(object: any, option: string): string {
if (!option || typeof object !== 'object') {
return object.toString();
}
- 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 calendar
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function calendar(date: Date,
time: Date,
formats: CalendarSpec,
locale: Locale = getLocale(),
config: DateParsingConfig = {}): string {
- 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 ordinal
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
ordinal(_num: number, period: string): string {
const num = Number(_num);
switch (period) {
// TODO: Return 'e' when day of month > 1. Move this case inside
// block for masculine words below.
- 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 finalizeAsyncCall
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected finalizeAsyncCall(matches: any[]): void {
this.prepareMatches(matches);
this.typeaheadLoading.emit(false);
this.typeaheadNoResults.emit(!this.hasMatches());
- 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 nextWeek
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
nextWeek(date: Date, now: Date) {
if (getWeek(now) !== getWeek(date)) {
switch (getDayOfWeek(date)) {
case 0:
return '[В следующее] dddd [в] LT';
- 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 lastWeek
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
lastWeek(date: Date, now: Date) {
if (getWeek(now) !== getWeek(date)) {
switch (getDayOfWeek(date)) {
case 0:
return '[В прошлое] dddd [в] LT';
- 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 meridiemHour
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
meridiemHour(hour, meridiem) {
if (hour === 12) {
hour = 0;
}
if (meridiem === 'pagi') {
- 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 active
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
set active(active: boolean) {
if (this._active === active) {
return;
}
if ((this.disabled && active) || !active) {
- 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 remove
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
remove(position = 0): void {
if (this.length === 0 || position < 0 || position >= this.length) {
throw new Error('Position is out of the list');
}
- 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 listen
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
listen(listenOpts: ListenOptions): ComponentLoader<T> {
this.triggers = listenOpts.triggers || this.triggers;
this._listenOpts.outsideClick = listenOpts.outsideClick;
listenOpts.target = listenOpts.target || this._elementRef.nativeElement;
- 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
Avoid too many return
statements within this function. Open
return Object.assign({}, state, newState);
Avoid too many return
statements within this function. Open
return Object.assign({}, state, newState);
Avoid too many return
statements within this function. Open
return ii;
Avoid too many return
statements within this function. Open
return state;
Avoid too many return
statements within this function. Open
return Object.assign({}, state, { value: _newTime });
Avoid too many return
statements within this function. Open
return undefined;
Avoid too many return
statements within this function. Open
return ii;
Avoid too many return
statements within this function. Open
return ii !== -1 ? ii : null;