Showing 272 of 791 total issues
Function autoPosition
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
private autoPosition(
targetElPosition: ClientRect,
hostElPosition: ClientRect,
targetElement: HTMLElement,
preferredPosition?: 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 hightlight
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
hightlight(match: TypeaheadMatch, query: any): string {
let itemStr: string = match.value;
let itemStrHelper: string = (this.parent && this.parent.typeaheadLatinize
? latinize(itemStr)
: itemStr).toLowerCase();
- 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 onItemDragover
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
onItemDragover(event: DragEvent, i: number): void {
if (!this.transfer.getItem()) {
return;
}
event.preventDefault();
Function getControlsValue
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function getControlsValue(
state: TimepickerComponentState
): TimepickerComponentState {
const {
hourStep,
Function hightlight
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
hightlight(match: TypeaheadMatch, query: any): string {
let itemStr: string = match.value;
let itemStrHelper: string = (this.parent && this.parent.typeaheadLatinize
? latinize(itemStr)
: itemStr).toLowerCase();
Function defineLocale
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function defineLocale(name: string, config?: LocaleData): Locale {
if (config === null) {
// useful for testing
delete locales[name];
globalLocale = getLocale('en');
Function select
has 29 lines of code (exceeds 25 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);
}
Function configFromStringAndArray
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function configFromStringAndArray(config: DateParsingConfig): DateParsingConfig {
let tempConfig;
let bestMoment;
let scoreToBeat;
let currentScore;
Function startOf
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function startOf(date: Date, unit: UnitOfTime, isUTC?: boolean): Date {
const _date = cloneDate(date);
// the following switch intentionally omits break keywords
// to utilize falling through the cases.
switch (unit) {
Function autoPosition
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
private autoPosition(
targetElPosition: ClientRect,
hostElPosition: ClientRect,
targetElement: HTMLElement,
preferredPosition?: string
Function as
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
as(_units: string): number {
if (!this.isValid()) {
return NaN;
}
let days;
Function setUTCOffset
has 29 lines of code (exceeds 25 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;
Function ngOnInit
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
ngOnInit(): void {
if (this.isAnimated) {
this._renderer.addClass(
this._element.nativeElement,
CLASS_NAME.FADE
Function visitMembers
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
visitMembers(members) {
const inputs = [];
const outputs = [];
const methods = [];
const properties = [];
Function isValid
has 28 lines of code (exceeds 25 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;
Function formatDaysCalendar
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function formatDaysCalendar(daysCalendar: DaysCalendarModel,
formatOptions: DatepickerFormatOptions,
monthIndex: number): DaysCalendarViewModel {
return {
month: daysCalendar.month,
Function show
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
show(): void {
if (
this.isOpen ||
this.isDisabled ||
this._delayTimeoutId ||
- 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 configFromStringAndArray
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export function configFromStringAndArray(config: DateParsingConfig): DateParsingConfig {
let tempConfig;
let bestMoment;
let scoreToBeat;
let currentScore;
- 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 b = num % 10;
const output =
toInt((num % 100) / 10) === 1
? 'th'
- 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 validate
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
validate(c: AbstractControl): ValidationErrors | null {
const _value: Date | string = c.value;
if (_value === null || _value === undefined || _value === '') {
return 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"