UiPath/angular-components

View on GitHub

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

    FixtureTestingUtils has 30 functions (exceeds 20 allowed). Consider refactoring.
    Open

    export class FixtureTestingUtils<T> {
        get component() {
            return this.fixture.componentInstance;
        }
    
    
    Severity: Minor
    Found in projects/angular/testing/src/utilities/fixture-testing-utils.ts - About 3 hrs to fix

      Identical blocks of code found in 2 locations. Consider refactoring.
      Open

              if (state.current.direction === ResizeDirection.Right) {
                  const offset = -clampOffset(state.current.neighbour, -state.current.offsetPercent);
                  // reduce width of the right neighbour
                  this._applyOffsetFor(state.current.neighbour, -offset);
                  // add the stolen width to the actively resized column
      projects/angular/components/ui-grid/src/managers/resize/strategies/aggresive-neighbour-push-resizer.ts on lines 110..116

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 105.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

          private _markSelected = (value: T) => {
              if (!this.isSelected(value)) {
                  this._selection.set(value.id, cloneDeep(value));
      
                  if (this._emitChanges) {
      projects/angular/components/ui-grid/src/managers/selection-manager.ts on lines 173..181

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 84.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Similar blocks of code found in 2 locations. Consider refactoring.
      Open

          private _markIndeterminate = (value: T) => {
              if (!this.isIndeterminate(value)) {
                  this._indeterminate.set(value.id, cloneDeep(value));
      
                  if (this._emitChanges) {
      projects/angular/components/ui-grid/src/managers/selection-manager.ts on lines 152..160

      Duplicated Code

      Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

      Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

      When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

      Tuning

      This issue has a mass of 84.

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Function constructor has 86 lines of code (exceeds 50 allowed). Consider refactoring.
      Open

          constructor(
              @Optional()
              public intl: UiGridIntl,
              protected _ref: ElementRef,
              protected _cd: ChangeDetectorRef,
      Severity: Major
      Found in projects/angular/components/ui-grid/src/ui-grid.component.ts - About 2 hrs to fix

        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());
            }
        
        
        Severity: Minor
        Found in projects/angular/components/ui-grid/src/managers/selection-manager.ts - About 2 hrs to fix

          UiTreeSelectComponent has 21 functions (exceeds 20 allowed). Consider refactoring.
          Open

          @Component({
              standalone: true,
              imports: [
                  CommonModule,
                  MatListModule,

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                set visible(visible: boolean) {
                    if (visible === this._visible) { return; }
                    this._visible = !!visible;
            
                    this.change$.next({
            projects/angular/components/ui-grid/src/body/ui-grid-column.directive.ts on lines 178..185

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 75.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                set primary(primary: boolean) {
                    if (primary === this._primary) { return; }
                    this._primary = !!primary;
            
                    this.change$.next({
            projects/angular/components/ui-grid/src/body/ui-grid-column.directive.ts on lines 207..214

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 75.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            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

            Identical blocks of code found in 2 locations. Consider refactoring.
            Open

                @Input() set accept(value: string | undefined) {
                    if (value) {
                        this._accept = value.split(',')
                            .map(v => v.trim().toLowerCase())
                            .filter(v => !!v);
            projects/angular/directives/ui-file-drop-zone/src/ui-file-drop-zone.directive.ts on lines 36..42

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 72.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Identical blocks of code found in 2 locations. Consider refactoring.
            Open

                @Input() set accept(value: string | undefined) {
                    if (value) {
                        this._accept = value.split(',')
                            .map(v => v.trim().toLowerCase())
                            .filter(v => !!v);
            projects/angular/components/ui-file-picker/src/ui-input-file-drop-zone/ui-input-file-drop-zone.component.ts on lines 41..47

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 72.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            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

              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');
                      }
              
              

              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

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

              export class UiGridExpandedRowDirective {
                  /**
                   * @internal
                   * @ignore
                   */
              projects/angular/components/ui-grid/src/body/ui-grid-row-action.directive.ts on lines 14..22

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 55.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                  every = (callbackfn: (value: T, index: number, array: T[]) => boolean) =>
                      this.data$.value.every(callbackfn);
              projects/angular/components/ui-grid/src/managers/data-manager.ts on lines 75..76

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 55.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                  some = (callbackfn: (value: T, index: number, array: T[]) => boolean) =>
                      this.data$.value.some(callbackfn);
              projects/angular/components/ui-grid/src/managers/data-manager.ts on lines 78..79

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 55.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

              export class UiGridRowActionDirective {
                  /**
                   * @ignore
                   */
                  @ContentChild(TemplateRef, {
              projects/angular/components/ui-grid/src/body/ui-grid-expanded-row.directive.ts on lines 15..24

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 55.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              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 {

              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

              Severity
              Category
              Status
              Source
              Language