UiPath/angular-components

View on GitHub
projects/angular/components/ui-suggest/src/ui-suggest.component.ts

Summary

Maintainability
D
2 days
Test Coverage
A
91%

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,
Severity: Major
Found in projects/angular/components/ui-suggest/src/ui-suggest.component.ts - About 2 days to fix

    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; }
    
    
    Severity: Minor
    Found in projects/angular/components/ui-suggest/src/ui-suggest.component.ts - About 1 hr to fix

    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();
            }
    
    
    Severity: Major
    Found in projects/angular/components/ui-suggest/src/ui-suggest.component.ts - About 1 hr to fix

      There are no issues that match your filters.

      Category
      Status