Showing 16 of 66 total issues
UiSuggestComponent
has 109 functions (exceeds 20 allowed). Consider refactoring. Open
@Component({
selector: 'ui-suggest',
styleUrls: ['./ui-suggest.component.scss'],
templateUrl: './ui-suggest.component.html',
encapsulation: ViewEncapsulation.None,
FixtureTestingUtils
has 30 functions (exceeds 20 allowed). Consider refactoring. Open
export class FixtureTestingUtils<T> {
get component() {
return this.fixture.componentInstance;
}
Function constructor
has 86 lines of code (exceeds 50 allowed). Consider refactoring. Open
constructor(
@Optional()
public intl: UiGridIntl,
protected _ref: ElementRef,
protected _cd: ChangeDetectorRef,
SelectionManager
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
export class SelectionManager<T extends IGridDataEntry> {
get selected(): T[] {
return Array.from(this._selection.values());
}
UiTreeSelectComponent
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
@Component({
standalone: true,
imports: [
CommonModule,
MatListModule,
Function updateValue
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
updateValue(inputValue: ISuggestValue | string, closeAfterSelect = true, refocus = true) {
let value = toSuggestValue(inputValue, this._isOnCustomValueIndex);
if (this.maxSelectionConfig.count <= this.value.length && !this.isItemSelected(value)) { return; }
if (value.loading !== VirtualScrollItemStatus.loaded || value.disabled === true) { 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 ngOnInit
has 55 lines of code (exceeds 50 allowed). Consider refactoring. Open
ngOnInit() {
if (this.alwaysExpanded || this.expandInline) {
this.open();
}
Function ngAfterViewInit
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
ngAfterViewInit() {
if (this.multiple) {
this._renderer.setProperty(this._fileInput, 'multiple', 'true');
}
- 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 _adjustLoadingRange
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private _adjustLoadingRange(
start: number,
end: number,
buffer: number,
items: VirtualScrollItem[] | readonly VirtualScrollItem[]): ListRange {
- 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 _getFocusableNode
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private _getFocusableNode(el: HTMLElement): HTMLElement | undefined {
if (this._checker.isFocusable(el)) {
return el;
}
- 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 mapInitialItems
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
{ total = 0, data = [] }: ISuggestValues<any>,
displayPriority: SuggestDisplayPriority,
value: ISuggestValue[],
loadingLabel: string,
isDown: boolean,
Function _emitFiles
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private _emitFiles(files: FileList) {
if (
!files?.length ||
this.disabled
) { 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
Consider simplifying this complex logical expression. Open
if (
!isArray(left) && !isArray(right) &&
!isDate(left) && !isDate(right) &&
isObject(left) && isObject(right)
) {
Function processFilesFromFileList
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
processFilesFromFileList(filesReceived: FileList, ignoreFoldersOrEmptyFiles = false) {
if (!filesReceived) {
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 filterItemsByPredicate
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function filterItemsByPredicate(
arr: ISuggestValue[],
predicate: (item: ISuggestValue) => boolean,
limit = 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 update
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
update(data: T[] | null) {
this.pristine = this.pristine &&
data == null;
data = cloneDeep(data ?? []);
- 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"