Showing 272 of 791 total issues
Function flagMonthsCalendar
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function flagMonthsCalendar(
monthCalendar: MonthsCalendarViewModel,
options: FlagMonthCalendarOptions
): MonthsCalendarViewModel {
monthCalendar.months.forEach(
Function prepareMatches
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected prepareMatches(options: any[]): void {
const limited: any[] = options.slice(0, this.typeaheadOptionsLimit);
if (this.typeaheadGroupField) {
let matches: TypeaheadMatch[] = [];
Function getPages
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected getPages(currentPage: number, totalPages: number): any[] {
const pages: any[] = [];
// Default page limits
let startPage = 1;
Function getPages
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected getPages(currentPage: number, totalPages: number): any[] {
const pages: any[] = [];
// Default page limits
let startPage = 1;
Function flagYearsCalendar
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function flagYearsCalendar(
yearsCalendar: YearsCalendarViewModel,
options: FlagYearsCalendarOptions
): YearsCalendarViewModel {
yearsCalendar.years.forEach(
Function translate
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
function translate(num: number, withoutSuffix: boolean, key: string, isFuture: boolean): string {
var result = '';
switch (key) {
case 's':
return isFuture ? 'muutaman sekunnin' : 'muutama sekunti';
Function monthsParse
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
monthsParse(monthName: string, format?: string, strict?: boolean): number {
let date;
let regex;
if (this._monthsParseExact) {
Function computeWeekdaysParse
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
private computeWeekdaysParse() {
const minPieces = [];
const shortPieces = [];
const longPieces = [];
const mixedPieces = [];
Function show
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
show(): void {
this._typeahead
.attach(TypeaheadContainerComponent)
// todo: add append to body, after updating positioning service
.to(this.container)
Function _getContentRef
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
private _getContentRef(
content: string | TemplateRef<any> | any,
context?: any,
initialState?: any
): ContentRef {
Function openModal
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
openModal(template: TemplateRef<any>) {
this.messages = [];
const _combine = Observable.combineLatest(
this.modalService.onShow,
Function add
has 32 lines of code (exceeds 25 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');
}
Function writeValue
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
writeValue(value: Date[] | string) {
if (!value) {
this._value = null;
} else {
const _localeKey = this._localeService.currentLocale;
- 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 removeSlide
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
removeSlide(slide: SlideComponent): void {
const remIndex = this._slides.indexOf(slide);
if (this._currentActiveSlide === remIndex) {
// removing of active slide
- 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 weekdaysRegex
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
weekdaysRegex(isStrict: boolean) {
if (this._weekdaysParseExact) {
if (!hasOwnProp(this, '_weekdaysRegex')) {
this.computeWeekdaysParse();
}
- 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 isValid
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export function isValid(config: DateParsingConfig): boolean {
if (config._isValid == null) {
const flags = getParsingFlags(config);
const parsedParts = Array.prototype.some.call(flags.parsedDateParts, function (i: number) {
return i != 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 showElement
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
protected showElement(): void {
// todo: replace this with component loader usage
if (
!this._element.nativeElement.parentNode ||
this._element.nativeElement.parentNode.nodeType !== Node.ELEMENT_NODE
- 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 mergeConfigs
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export function mergeConfigs(parentConfig: LocaleData,
childConfig: LocaleData) {
const res: LocaleData = Object.assign({}, parentConfig);
for (const childProp in childConfig) {
- 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 weekdaysMinRegex
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
weekdaysMinRegex(isStrict?: boolean): RegExp {
if (this._weekdaysParseExact) {
if (!hasOwnProp(this, '_weekdaysRegex')) {
this.computeWeekdaysParse();
}
- 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 weekdaysShortRegex
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
weekdaysShortRegex(isStrict?: boolean): RegExp {
if (this._weekdaysParseExact) {
if (!hasOwnProp(this, '_weekdaysRegex')) {
this.computeWeekdaysParse();
}
- 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"