Showing 272 of 791 total issues
Function visitMembers
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
visitMembers(members) {
const inputs = [];
const outputs = [];
const methods = [];
const properties = [];
- 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 updateLocale
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export function updateLocale(name: string, config?: LocaleData): Locale {
let _config = config;
if (_config != null) {
let parentConfig = baseConfig;
- 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 defineLocale
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export function defineLocale(name: string, config?: LocaleData): Locale {
if (config === null) {
// useful for testing
delete locales[name];
globalLocale = getLocale('en');
- 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 isDurationValid
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export function isDurationValid(duration: Partial<DateObject>): boolean {
const durationKeys = Object.keys(duration);
if (durationKeys
.some((key: keyof DateObject) => {
return (key in orderingHash)
- 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 prepareConfig
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export function prepareConfig(config: DateParsingConfig): DateParsingConfig {
let input = config._i;
const format = config._f;
config._locale = config._locale || getLocale(config._l);
- 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 10 (exceeds 5 allowed). Consider refactoring. Open
ordinal(_num: number): string {
const num = Number(_num);
let b = num % 10,
output = (~~(num % 100 / 10) === 1) ? 'e' :
(b === 1) ? 'a' :
- 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 show
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
show(opts: {
content?: string | TemplateRef<any>;
context?: any;
initialState?: any; [key: string]: any;
} = {}
- 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 10 (exceeds 5 allowed). Consider refactoring. Open
ordinal(_num: number): string {
const num = Number(_num);
const b = num % 10,
output = (~~(num % 100 / 10) === 1) ? 'th' :
(b === 1) ? 'st' :
- 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 configFromInput
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function configFromInput(config: DateParsingConfig): DateParsingConfig {
const input = config._i;
if (isUndefined(input)) {
config._d = new Date();
} else if (isDate(input)) {
- 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 findNextSlideIndex
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
private findNextSlideIndex(direction: Direction, force: boolean): number {
let nextSlideIndex = 0;
if (
!force &&
Function bubble
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function bubble(dur: Duration): Duration {
let milliseconds = dur._milliseconds;
let days = dur._days;
let months = dur._months;
const data = dur._data;
Function translate
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function translate(num: number, withoutSuffix: boolean, key: string, isFuture: boolean): string {
switch (key) {
case 's':
return (isFuture || withoutSuffix) ? 'néhány másodperc' : 'néhány másodperce';
case 'ss':
Function ngOnInit
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
ngOnInit(): void {
if (typeof window !== 'undefined') {
this.classMap = this.elementRef.nativeElement.getAttribute('class') || '';
}
// watch for maxSize
Function mergeConfigs
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function mergeConfigs(parentConfig: LocaleData,
childConfig: LocaleData) {
const res: LocaleData = Object.assign({}, parentConfig);
for (const childProp in childConfig) {
Function ngOnInit
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
ngOnInit(): void {
if (typeof window !== 'undefined') {
this.classMap = this.elementRef.nativeElement.getAttribute('class') || '';
}
// watch for maxSize
Function computeMonthsParse
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
private computeMonthsParse() {
const shortPieces: string[] = [];
const longPieces: string[] = [];
const mixedPieces: string[] = [];
let date;
Function listenToTriggersV2
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function listenToTriggersV2(renderer: Renderer2,
options: ListenOptions): Function {
const parsedTriggers = parseTriggers(options.triggers);
const target = options.target;
// do nothing
Consider simplifying this complex logical expression. Open
if (
day.isOtherMonth !== newDay.isOtherMonth ||
day.isHovered !== newDay.isHovered ||
day.isSelected !== newDay.isSelected ||
day.isSelectionStart !== newDay.isSelectionStart ||
Function constructor
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
constructor(
private _state: BsDropdownState,
private cd: ChangeDetectorRef,
private _renderer: Renderer2,
_element: ElementRef
- 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 calculateReducer
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function calculateReducer(state: BsDatepickerState): BsDatepickerState {
// how many calendars
const displayMonths = state.displayMonths;
// use selected date on initial rendering if set
let viewDate = state.view.date;
- 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"