fisenkodv/itinerary

View on GitHub

Showing 21 of 21 total issues

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

  @Action(GetAutocomplete)
  getAutocomplete({ patchState, dispatch }: StateContext<AutocompleteStateModel>, { payload }: GetAutocomplete) {
    patchState({ loading: true });
    return this.service.autocomplete(payload).pipe(map(x => dispatch(new GetAutocompleteSuccess(x))));
  }
Severity: Major
Found in src/app/modules/places/state/autocomplete.state.ts and 1 other location - About 3 hrs to fix
src/app/modules/places/state/autocomplete.state.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 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

  @Action(SelectPlace)
  selectPlace({ patchState, dispatch }: StateContext<AutocompleteStateModel>, { payload }: SelectPlace) {
    patchState({ loading: true });
    return this.service.place(payload).pipe(map(x => dispatch(new SelectPlaceSuccess(x))));
  }
Severity: Major
Found in src/app/modules/places/state/autocomplete.state.ts and 1 other location - About 3 hrs to fix
src/app/modules/places/state/autocomplete.state.ts on lines 43..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 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

export const environment = {
  production: false,
  google: {
    maps: { apiKey: 'AIzaSyBkxFjVilFXxTMLb6JxL2x-AGeCOLIRO1M', libraries: ['places'] },
    places: { apiKey: 'AIzaSyAHtJrpKyxsARFESBwI-a0qaWjsD5ZW-3w' }
Severity: Major
Found in src/environments/environment.ts and 1 other location - About 2 hrs to fix
src/environments/environment.prod.ts on lines 1..15

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

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 const environment = {
  production: true,
  google: {
    maps: { apiKey: 'AIzaSyBkxFjVilFXxTMLb6JxL2x-AGeCOLIRO1M', libraries: ['places'] },
    places: { apiKey: 'AIzaSyAHtJrpKyxsARFESBwI-a0qaWjsD5ZW-3w' }
Severity: Major
Found in src/environments/environment.prod.ts and 1 other location - About 2 hrs to fix
src/environments/environment.ts on lines 6..20

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

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

  it('it should set rating', () => {
    store.dispatch(new SetRating(5));
    store.selectOnce(state => state.filter.rating).subscribe(rating => {
      expect(rating).toBe(5);
    });
Severity: Major
Found in src/app/modules/places/state/filter.state.spec.ts and 2 other locations - About 2 hrs to fix
src/app/modules/places/state/filter.state.spec.ts on lines 23..28
src/app/modules/places/state/filter.state.spec.ts on lines 37..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 80.

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

  it('it should set distance', () => {
    store.dispatch(new SetDistance(100));
    store.selectOnce(state => state.filter.distance).subscribe(distance => {
      expect(distance).toBe(100);
    });
Severity: Major
Found in src/app/modules/places/state/filter.state.spec.ts and 2 other locations - About 2 hrs to fix
src/app/modules/places/state/filter.state.spec.ts on lines 30..35
src/app/modules/places/state/filter.state.spec.ts on lines 37..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 80.

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

  it('it should set reviews', () => {
    store.dispatch(new SetReviews(50));
    store.selectOnce(state => state.filter.reviews).subscribe(reviews => {
      expect(reviews).toBe(50);
    });
Severity: Major
Found in src/app/modules/places/state/filter.state.spec.ts and 2 other locations - About 2 hrs to fix
src/app/modules/places/state/filter.state.spec.ts on lines 23..28
src/app/modules/places/state/filter.state.spec.ts on lines 30..35

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

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('it opens side navigation panel', () => {
    store.dispatch(new OpenSidenav());
    store.selectOnce(state => state.layout.showSidenav).subscribe(showSidenav => {
      expect(showSidenav).toBe(true);
    });
Severity: Major
Found in src/app/modules/core/state/layout.state.spec.ts and 1 other location - About 2 hrs to fix
src/app/modules/core/state/layout.state.spec.ts on lines 22..27

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

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('it closes side navigation panel', () => {
    store.dispatch(new CloseSidenav());
    store.selectOnce(state => state.layout.showSidenav).subscribe(showSidenav => {
      expect(showSidenav).toBe(false);
    });
Severity: Major
Found in src/app/modules/core/state/layout.state.spec.ts and 1 other location - About 2 hrs to fix
src/app/modules/core/state/layout.state.spec.ts on lines 15..20

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

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

  @Action(SetRating)
  setRating({ getState, setState }: StateContext<FilterStateModel>, { payload }: SetRating) {
    setState({ ...getState(), rating: payload });
  }
Severity: Major
Found in src/app/modules/places/state/filter.state.ts and 3 other locations - About 1 hr to fix
src/app/modules/places/state/filter.state.ts on lines 40..43
src/app/modules/places/state/filter.state.ts on lines 45..48
src/app/modules/places/state/filter.state.ts on lines 55..58

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

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

  @Action(SetLocation)
  setLocation({ getState, setState }: StateContext<FilterStateModel>, { payload }: SetLocation) {
    setState({ ...getState(), location: payload });
  }
Severity: Major
Found in src/app/modules/places/state/filter.state.ts and 3 other locations - About 1 hr to fix
src/app/modules/places/state/filter.state.ts on lines 45..48
src/app/modules/places/state/filter.state.ts on lines 50..53
src/app/modules/places/state/filter.state.ts on lines 55..58

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

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

  @Action(SetReviews)
  setRevSetReviews({ getState, setState }: StateContext<FilterStateModel>, { payload }: SetReviews) {
    setState({ ...getState(), reviews: payload });
  }
Severity: Major
Found in src/app/modules/places/state/filter.state.ts and 3 other locations - About 1 hr to fix
src/app/modules/places/state/filter.state.ts on lines 40..43
src/app/modules/places/state/filter.state.ts on lines 45..48
src/app/modules/places/state/filter.state.ts on lines 50..53

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

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

  @Action(SetDistance)
  setDistance({ getState, setState }: StateContext<FilterStateModel>, { payload }: SetDistance) {
    setState({ ...getState(), distance: payload });
  }
Severity: Major
Found in src/app/modules/places/state/filter.state.ts and 3 other locations - About 1 hr to fix
src/app/modules/places/state/filter.state.ts on lines 40..43
src/app/modules/places/state/filter.state.ts on lines 50..53
src/app/modules/places/state/filter.state.ts on lines 55..58

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

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

  @Action(GetAutocompleteSuccess)
  getAutocompleteSuccess(
    { patchState, setState }: StateContext<AutocompleteStateModel>,
    { payload }: GetAutocompleteSuccess
  ) {
Severity: Major
Found in src/app/modules/places/state/autocomplete.state.ts and 1 other location - About 1 hr to fix
src/app/modules/places/state/autocomplete.state.ts on lines 63..66

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

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

  @Action(SelectPlaceSuccess)
  selectPlaceSuccess({ patchState, setState }: StateContext<AutocompleteStateModel>, { payload }: SelectPlaceSuccess) {
    return patchState({ loading: false, selected: payload });
  }
Severity: Major
Found in src/app/modules/places/state/autocomplete.state.ts and 1 other location - About 1 hr to fix
src/app/modules/places/state/autocomplete.state.ts on lines 49..55

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

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(async(() => {
    TestBed.configureTestingModule({ imports: [NgxsModule.forRoot([FilterState])] }).compileComponents();
    store = TestBed.get(Store);
  }));
Severity: Major
Found in src/app/modules/places/state/filter.state.spec.ts and 1 other location - About 1 hr to fix
src/app/modules/core/state/layout.state.spec.ts on lines 10..13

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(async(() => {
    TestBed.configureTestingModule({ imports: [NgxsModule.forRoot([LayoutState])] }).compileComponents();
    store = TestBed.get(Store);
  }));
Severity: Major
Found in src/app/modules/core/state/layout.state.spec.ts and 1 other location - About 1 hr to fix
src/app/modules/places/state/filter.state.spec.ts on lines 10..13

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

  @Action(CloseSidenav)
  closeSidenav({ patchState }: StateContext<LayoutStateModel>) {
    patchState({ showSidenav: false });
  }
Severity: Minor
Found in src/app/modules/core/state/layout.state.ts and 1 other location - About 40 mins to fix
src/app/modules/core/state/layout.state.ts on lines 18..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 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

  @Action(OpenSidenav)
  openSidenav({ patchState }: StateContext<LayoutStateModel>) {
    patchState({ showSidenav: true });
  }
Severity: Minor
Found in src/app/modules/core/state/layout.state.ts and 1 other location - About 40 mins to fix
src/app/modules/core/state/layout.state.ts on lines 23..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

comment must start with a space
Open

    //this.showProgressBar = this.store.select(fromPlaces.getLoading);

Rule: comment-format

Enforces formatting rules for single-line comments.

Rationale

Helps maintain a consistent, readable style in your codebase.

Notes
  • Has Fix

Config

Four arguments may be optionally provided:

  • "check-space" requires that all single-line comments must begin with a space, as in // comment
    • note that for comments starting with multiple slashes, e.g. ///, leading slashes are ignored
    • TypeScript reference comments are ignored completely
  • "check-lowercase" requires that the first non-whitespace character of a comment must be lowercase, if applicable.
  • "check-uppercase" requires that the first non-whitespace character of a comment must be uppercase, if applicable.
  • "allow-trailing-lowercase" allows that only the first comment of a series of comments needs to be uppercase.
    • requires "check-uppercase"
    • comments must start at the same position

Exceptions to "check-lowercase" or "check-uppercase" can be managed with object that may be passed as last argument.

One of two options can be provided in this object:

  • "ignore-words" - array of strings - words that will be ignored at the beginning of the comment.
  • "ignore-pattern" - string - RegExp pattern that will be ignored at the beginning of the comment.
Examples
"comment-format": true,check-space,check-uppercase,allow-trailing-lowercase
"comment-format": true,check-lowercase,[object Object]
"comment-format": true,check-lowercase,[object Object]
Schema
{
  "type": "array",
  "items": {
    "anyOf": [
      {
        "type": "string",
        "enum": [
          "check-space",
          "check-lowercase",
          "check-uppercase",
          "allow-trailing-lowercase"
        ]
      },
      {
        "type": "object",
        "properties": {
          "ignore-words": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "ignore-pattern": {
            "type": "string"
          }
        },
        "minProperties": 1,
        "maxProperties": 1
      }
    ]
  },
  "minLength": 1,
  "maxLength": 5
}

For more information see this page.

Severity
Category
Status
Source
Language