swimlane/ngx-ui

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

Summary

Maintainability
C
1 day
Test Coverage

File time-display.component.spec.ts has 462 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { waitForAsync, ComponentFixture, TestBed } from '@angular/core/testing';
import { NO_ERRORS_SCHEMA } from '@angular/core';
import { ClipboardModule } from '@angular/cdk/clipboard';

import { NgxTimeDisplayComponent as TestComponent } from './time-display.component';

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

        for (const key in component.timeValues) {
          expect(component.timeValues[key]).toBeTruthy();
          expect(component.timeValues[key]).not.toContain('Coordinated Universal Time');
        }
    projects/swimlane/ngx-ui/src/lib/components/time-display/time-display.component.spec.ts on lines 444..447
    projects/swimlane/ngx-ui/src/lib/components/time-display/time-display.component.spec.ts on lines 465..468

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

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

          for (const key in component.timeValues) {
            expect(component.timeValues[key]).toBeTruthy();
            expect(component.timeValues[key]).not.toContain('Coordinated Universal Time');
          }
    projects/swimlane/ngx-ui/src/lib/components/time-display/time-display.component.spec.ts on lines 409..412
    projects/swimlane/ngx-ui/src/lib/components/time-display/time-display.component.spec.ts on lines 444..447

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

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

          for (const key in component.timeValues) {
            expect(component.timeValues[key]).toBeTruthy();
            expect(component.timeValues[key]).not.toContain('Coordinated Universal Time');
          }
    projects/swimlane/ngx-ui/src/lib/components/time-display/time-display.component.spec.ts on lines 409..412
    projects/swimlane/ngx-ui/src/lib/components/time-display/time-display.component.spec.ts on lines 465..468

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

    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(TestComponent);
        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/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

    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