swimlane/ngx-ui

View on GitHub
projects/swimlane/ngx-ui/src/lib/components/select/select.component.spec.ts

Summary

Maintainability
D
1 day
Test Coverage

File select.component.spec.ts has 327 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { ComponentFixture, TestBed } from '@angular/core/testing';
import { NO_ERRORS_SCHEMA } from '@angular/core';
import { FormsModule } from '@angular/forms';

import { KeyboardKeys } from '../../enums/keyboard-keys.enum';

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

        it('should do nothing if disabled', () => {
          const spy = spyOn(component.select, 'toggleDropdown');
          component.select.disabled = true;
          component.select.onFocus();
          expect(spy).not.toHaveBeenCalled();
    projects/swimlane/ngx-ui/src/lib/components/select/select.component.spec.ts on lines 246..251

    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 76.

    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

        it('should do nothing if disabled', () => {
          const spy = spyOn(component.select, 'toggleDropdown');
          component.select.disabled = true;
          component.select.onToggle();
          expect(spy).not.toHaveBeenCalled();
    projects/swimlane/ngx-ui/src/lib/components/select/select.component.spec.ts on lines 184..189

    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 76.

    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 3 locations. Consider refactoring.
    Open

        beforeEach(() => {
          fixture = TestBed.createComponent(SelectComponentFixture);
          component = fixture.componentInstance;
          component.closeOnBodyClick$.next(true);
          fixture.detectChanges();
    projects/swimlane/ngx-ui/src/lib/components/dropdown/dropdown.component.spec.ts on lines 96..101
    projects/swimlane/ngx-ui/src/lib/components/select/select.component.spec.ts on lines 114..119

    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 63.

    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 3 locations. Consider refactoring.
    Open

          beforeEach(() => {
            fixture = TestBed.createComponent(SelectComponentFixture);
            component = fixture.componentInstance;
            component.tagging$.next(true);
            fixture.detectChanges();
    projects/swimlane/ngx-ui/src/lib/components/dropdown/dropdown.component.spec.ts on lines 96..101
    projects/swimlane/ngx-ui/src/lib/components/select/select.component.spec.ts on lines 261..266

    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 63.

    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

            component.select.options = [
              selectDropdownOptionMock({ value: { value: 'test' } }),
              selectDropdownOptionMock({ value: { value: 'test1' } }),
              selectDropdownOptionMock({ value: { value: 'test2' } })
            ];
    projects/swimlane/ngx-ui/src/lib/components/select/select-input.component.spec.ts on lines 283..287

    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 54.

    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

        beforeEach(() => {
          component.selected = [component.select.options[0].value];
          fixture.detectChanges();
        });
    projects/swimlane/ngx-ui/src/lib/components/select/select.component.spec.ts on lines 200..203

    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 51.

    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

        beforeEach(() => {
          component.selected = [component.select.options[0].value];
          fixture.detectChanges();
        });
    projects/swimlane/ngx-ui/src/lib/components/select/select.component.spec.ts on lines 45..48

    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 51.

    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 15 locations. Consider refactoring.
    Open

      beforeEach(() => {
        fixture = TestBed.createComponent(SelectComponentFixture);
        component = fixture.componentInstance;
        fixture.detectChanges();
      });
    projects/swimlane/ngx-ui/src/lib/components/calendar/calender.component.spec.ts on lines 27..31
    projects/swimlane/ngx-ui/src/lib/components/code-editor/code-editor.component.spec.ts on lines 18..22
    projects/swimlane/ngx-ui/src/lib/components/dialog/dialog.component.spec.ts on lines 20..24
    projects/swimlane/ngx-ui/src/lib/components/hotkeys/hotkeys.component.spec.ts on lines 37..41
    projects/swimlane/ngx-ui/src/lib/components/input/input-autosize.directive.spec.ts on lines 23..27
    projects/swimlane/ngx-ui/src/lib/components/input/input.component.spec.ts on lines 28..32
    projects/swimlane/ngx-ui/src/lib/components/json-editor/json-editor-flat/json-editor-node-flat/node-types/node-info/node-info.component.spec.ts on lines 18..22
    projects/swimlane/ngx-ui/src/lib/components/navbar/navbar.component.spec.ts on lines 22..26
    projects/swimlane/ngx-ui/src/lib/components/notification/notification-container.component.spec.ts on lines 17..21
    projects/swimlane/ngx-ui/src/lib/components/radiobutton/radiobutton-group.component.spec.ts on lines 21..25
    projects/swimlane/ngx-ui/src/lib/components/radiobutton/radiobutton.component.spec.ts on lines 20..24
    projects/swimlane/ngx-ui/src/lib/components/split/split-area.directive.spec.ts on lines 21..25
    projects/swimlane/ngx-ui/src/lib/components/split/split.directive.spec.ts on lines 22..26
    projects/swimlane/ngx-ui/src/lib/components/time-display/time-display.component.spec.ts on lines 375..379

    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 48.

    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

    There are no issues that match your filters.

    Category
    Status