Showing 272 of 791 total issues
Function onChange
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
@HostListener('keyup', ['$event'])
onChange(e: any): void {
if (this._container) {
// esc
if (e.keyCode === 27) {
- 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 meridiem
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
meridiem(hour, minute, isLower) {
if (hour < 5) {
return 'לפנות בוקר';
} else if (hour < 10) {
return 'בבוקר';
- 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 9 (exceeds 5 allowed). Consider refactoring. Open
meridiemHour(hour, meridiem) {
if (hour === 12) {
hour = 0;
}
if (meridiem === 'रात') {
- 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 relativeTimeWithPlural
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function relativeTimeWithPlural(num: number, withoutSuffix, key): string {
let format: { [key: string]: string } = {
ss: withoutSuffix ? 'секунда_секунди_секунд' : 'секунду_секунди_секунд',
mm: withoutSuffix ? 'хвилина_хвилини_хвилин' : 'хвилину_хвилини_хвилин',
hh: withoutSuffix ? 'година_години_годин' : 'годину_години_годин',
- 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 createDate
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
export function createDate(y?: number,
m = 0,
d = 1,
h = 0,
M = 0,
Function select
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
select(date: Date, isManual = true): void {
if (this.datepickerMode === this.minMode) {
if (!this.activeDate) {
this.activeDate = new Date(0, 0, 0, 0, 0, 0, 0);
}
- 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 visitClassDeclaration
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
visitClassDeclaration(fileName, classDeclaration) {
const symbol = this.program.getTypeChecker().getSymbolAtLocation(classDeclaration.name);
const description = getDescription(symbol);
const className = classDeclaration.name.text;
let directiveInfo, members;
- 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 extractFromRFC2822Strings
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function extractFromRFC2822Strings(yearStr: string, monthStr: string, dayStr: string, hourStr: string, minuteStr: string, secondStr: string): DateArray {
Function _setInputValue
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
_setInputValue(date: Date[]): void {
let range = '';
if (date) {
const start = !date[0] ? ''
: formatDate(date[0],
- 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 canChangeValue
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export function canChangeValue(
state: TimepickerComponentState,
event?: TimeChangeEvent
): boolean {
if (state.readonlyInput || state.disabled) {
- 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 8 (exceeds 5 allowed). Consider refactoring. Open
meridiemHour(hour, meridiem) {
if (hour === 12) {
hour = 0;
}
if (meridiem === '凌晨' || meridiem === '早上' ||
- 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 getSetWeekYearHelper
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function getSetWeekYearHelper(date: Date, input: number, week: number,
weekday: number, dow: number, doy: number): number | Date {
Function setScrollableMode
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
setScrollableMode(): void {
if (!this.ulElement) {
this.ulElement = this.element;
}
if (this.liElements.first) {
- 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 add
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
add(value: T, position: number = this.length): void {
if (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 preventEmptyHrefNav
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
@HostListener('document:click', ['$event'])
preventEmptyHrefNav(event: MouseEvent & {target: Element}): void {
let element: Element = event.target;
let preventNav = element.getAttribute('href') === '#';
- 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 setWeekAll
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function setWeekAll(date: Date, weekYear: number, week: number,
weekday: number, dow: number, doy: number): Date {
Function ngOnInit
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
ngOnInit(): void {
this.typeaheadOptionsLimit = this.typeaheadOptionsLimit || 20;
this.typeaheadMinLength =
this.typeaheadMinLength === void 0 ? 1 : this.typeaheadMinLength;
this.typeaheadWaitMs = this.typeaheadWaitMs || 0;
- 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 pickBy
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function pickBy(fn: Function, dates: Date[] | Date[][]): Date {
let _dates: Date[];
const _firstArg = dates[0];
if (isArray<Date>(_firstArg) && dates.length === 1) {
_dates = _firstArg;
- 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 listenToTriggers
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
export function listenToTriggers(renderer: Renderer2,
target: any,
triggers: string,
showFn: BsEventCallback,
hideFn: BsEventCallback,
Consider simplifying this complex logical expression. Open
if (!((milliseconds >= 0 && days >= 0 && months >= 0) ||
(milliseconds <= 0 && days <= 0 && months <= 0))) {
milliseconds += absCeil(monthsToDays(months) + days) * 864e5;
days = 0;
months = 0;