swimlane/ngx-ui

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

Summary

Maintainability
C
1 day
Test Coverage

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

import { ComponentFixture, fakeAsync, TestBed, tick } from '@angular/core/testing';
import { DebugElement, NO_ERRORS_SCHEMA } from '@angular/core';
import { FormsModule, FormControl } from '@angular/forms';
import { By } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';

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

        beforeEach(() => {
          fixture = TestBed.createComponent(InputComponentFixture);
          component = fixture.componentInstance;
          component.type$.next(InputTypes.password);
          fixture.detectChanges();
    projects/swimlane/ngx-ui/src/lib/components/input/input.component.spec.ts on lines 169..174

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

    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

        beforeEach(() => {
          fixture = TestBed.createComponent(InputComponentFixture);
          component = fixture.componentInstance;
          component.type$.next(InputTypes.number);
          fixture.detectChanges();
    projects/swimlane/ngx-ui/src/lib/components/input/input.component.spec.ts on lines 95..100

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

    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 blur', () => {
        const spy = spyOn(component.input.blur, 'emit');
        component.input.onBlur(MOCK_EVENT);
        expect(spy).toHaveBeenCalled();
      });
    projects/swimlane/ngx-ui/src/lib/components/radiobutton/radiobutton.component.spec.ts on lines 47..51

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

    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 be disabled', () => {
        component.disabled$.next(true);
        fixture.detectChanges();
        expect(component.input.disabled).toEqual(true);
      });
    projects/swimlane/ngx-ui/src/lib/components/input/input.component.spec.ts on lines 63..67

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

    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 be readonly', () => {
        component.readonly$.next(true);
        fixture.detectChanges();
        expect(component.input.readonly).toEqual(true);
      });
    projects/swimlane/ngx-ui/src/lib/components/input/input.component.spec.ts on lines 57..61

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

    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(InputComponentFixture);
        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/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/select/select.component.spec.ts on lines 31..35
    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

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

      beforeEach(() => {
        TestBed.configureTestingModule({
          schemas: [NO_ERRORS_SCHEMA],
          declarations: [InputComponentFixture, InputComponent],
          imports: [FormsModule, BrowserAnimationsModule]
    projects/swimlane/ngx-ui/src/lib/components/input/input-autosize.directive.spec.ts on lines 15..21

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

    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