sengirab/ngAutocomplete

View on GitHub

Showing 8 of 16 total issues

NgDropdownDirective has 27 functions (exceeds 20 allowed). Consider refactoring.
Open

@Directive({
    selector: '[ngDropdown]'
})
export class NgDropdownDirective implements OnChanges, OnInit, OnDestroy {
    @Input() public list: any[] = [];
Severity: Minor
Found in projects/ng-auto-complete/src/lib/dropdown/ng-dropdown.directive.ts - About 3 hrs to fix

    File completer.component.ts has 283 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import { debounceTime, distinctUntilChanged, switchMap } from 'rxjs/operators';
    import {
        ChangeDetectionStrategy,
        ChangeDetectorRef,
        Component,
    Severity: Minor
    Found in projects/ng-auto-complete/src/lib/completer/completer.component.ts - About 2 hrs to fix

      File ng-dropdown.directive.ts has 256 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import {
          ChangeDetectorRef,
          Directive,
          ElementRef,
          EventEmitter,
      Severity: Minor
      Found in projects/ng-auto-complete/src/lib/dropdown/ng-dropdown.directive.ts - About 2 hrs to fix

        Function keyDown has 39 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            keyDown(event: KeyboardEvent) {
                event.stopImmediatePropagation();
                event.stopPropagation();
        
                /**
        Severity: Minor
        Found in projects/ng-auto-complete/src/lib/dropdown/ng-dropdown.directive.ts - About 1 hr to fix

          Function exports has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          module.exports = function (config) {
            config.set({
              basePath: '',
              frameworks: ['jasmine', '@angular-devkit/build-angular'],
              plugins: [
          Severity: Minor
          Found in src/karma.conf.js - About 1 hr to fix

            Function exports has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            module.exports = function (config) {
              config.set({
                basePath: '',
                frameworks: ['jasmine', '@angular-devkit/build-angular'],
                plugins: [
            Severity: Minor
            Found in projects/ng-auto-complete/karma.conf.js - About 1 hr to fix

              Function CreateNewAutocompleteGroup has 7 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              export function CreateNewAutocompleteGroup<T>(placeholder: string, key: string, value: { id?: string | number; [value: string]: any }[], keys: { titleKey: string, childrenKey: string | null }, parent: string = '', completion: boolean = true, searchLength: number = 2): AutocompleteGroup {
              Severity: Major
              Found in projects/ng-auto-complete/src/lib/classes/AutocompleteGroup.ts - About 50 mins to fix

                Function keyDown has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                    keyDown(event: KeyboardEvent) {
                        event.stopImmediatePropagation();
                        event.stopPropagation();
                
                        /**
                Severity: Minor
                Found in projects/ng-auto-complete/src/lib/dropdown/ng-dropdown.directive.ts - About 35 mins 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

                Severity
                Category
                Status
                Source
                Language