Showing 272 of 791 total issues
Function calculateReducer
has 45 lines of code (exceeds 25 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;
Function monthsParse
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
monthsParse(monthName: string, format?: string, strict?: boolean): number {
let date;
let regex;
if (this._monthsParseExact) {
- 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 showBackdrop
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
protected showBackdrop(callback?: Function): void {
if (
this._isShown &&
this.config.backdrop &&
(!this.backdrop || !this.backdrop.instance.isShown)
- 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 setEventHandlers
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
setEventHandlers(container: BsDatepickerAbstractComponent): BsDatepickerEffects {
container.setViewMode = (event: BsDatepickerViewMode): void => {
this._store.dispatch(this._actions.changeViewMode(event));
};
Function show
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
show(): void {
if (
this.isOpen ||
this.isDisabled ||
this._delayTimeoutId ||
Function visitClassDeclaration
has 42 lines of code (exceeds 25 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;
Function show
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
show(): void {
if (this.isOpen || this.isDisabled) {
return;
}
Function dayOfYearFromWeekInfo
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
function dayOfYearFromWeekInfo(config: DateParsingConfig): DateParsingConfig {
let w, weekYear, week, weekday, dow, doy, temp, weekdayOverflow;
w = config._w;
if (w.GG != null || w.W != null || w.E != null) {
Function show
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
show(opts: {
content?: string | TemplateRef<any>;
context?: any;
initialState?: any; [key: string]: any;
} = {}
Function diff
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function diff(date: Date, input: Date,
units: UnitOfTime, asFloat: boolean,
config: DateParsingConfig = {}
): number {
if (!isDateValid(date)) {
Function getPages
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
protected getPages(currentPage: number, totalPages: number): any[] {
const pages: any[] = [];
// Default page limits
let startPage = 1;
- 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 getPages
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
protected getPages(currentPage: number, totalPages: number): any[] {
const pages: any[] = [];
// Default page limits
let startPage = 1;
- 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 a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
private findNextSlideIndex(direction: Direction, force: boolean): number {
let nextSlideIndex = 0;
if (
!force &&
- 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 formatReducer
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
function formatReducer(state: BsDatepickerState,
action: Action): BsDatepickerState {
if (state.view.mode === 'day') {
const formattedMonths = state.monthsModel.map((month, monthIndex) =>
formatDaysCalendar(month, getFormatOptions(state), monthIndex)
Function position
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
public position(element: HTMLElement, round = true): ClientRect {
let elPosition: ClientRect;
let parentOffset: ClientRect = {
width: 0,
height: 0,
Function weekdaysParse
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
weekdaysParse(weekdayName?: string, format?: string, strict?: boolean): number {
let i;
let regex;
if (this._weekdaysParseExact) {
Function showBackdrop
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected showBackdrop(callback?: Function): void {
if (
this._isShown &&
this.config.backdrop &&
(!this.backdrop || !this.backdrop.instance.isShown)
Function handleMonthStrictParse
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
private handleMonthStrictParse(monthName: string, format: string, strict?: boolean) {
const llc = monthName.toLocaleLowerCase();
let i;
let ii;
let mom;
Function chooseLocale
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function chooseLocale(names: string[]): Locale {
let next;
let locale;
let i = 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 setUTCOffset
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export function setUTCOffset(date: Date, input: number | string, keepLocalTime?: boolean, keepMinutes?: boolean, config: DateParsingConfig = {}): Date {
const offset = config._offset || 0;
let localAdjust;
let _input = input;
let _date = 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"