Takumon/mean-blog

View on GitHub
src/app/drafts/state/draft.actions.ts

Summary

Maintainability
C
1 day
Test Coverage

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

export class UpdateDraftSuccess implements Action {
  readonly type = DraftActionTypes.UpdateDraftSuccess;

  constructor(public payload: { draft: Update<DraftModel> }) {}
}
Severity: Major
Found in src/app/drafts/state/draft.actions.ts and 3 other locations - About 55 mins to fix
src/app/drafts/state/draft.actions.ts on lines 98..102
src/app/state/article.actions.ts on lines 146..150
src/app/state/article.actions.ts on lines 152..156

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

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

export class UpdateDraft implements Action {
  readonly type = DraftActionTypes.UpdateDraft;

  constructor(public payload: { draft: Update<DraftModel> }) {}
}
Severity: Major
Found in src/app/drafts/state/draft.actions.ts and 3 other locations - About 55 mins to fix
src/app/drafts/state/draft.actions.ts on lines 104..108
src/app/state/article.actions.ts on lines 146..150
src/app/state/article.actions.ts on lines 152..156

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

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

export class LoadDraftsSuccess implements Action {
  readonly type = DraftActionTypes.LoadDraftsSuccess;

  constructor(public payload: { drafts: DraftModel[] }) {}
}
Severity: Major
Found in src/app/drafts/state/draft.actions.ts and 4 other locations - About 40 mins to fix
src/app/drafts/state/draft.actions.ts on lines 86..90
src/app/drafts/state/draft.actions.ts on lines 92..96
src/app/state/article.actions.ts on lines 288..294
src/app/state/article.actions.ts on lines 313..319

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

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

export class AddDrafts implements Action {
  readonly type = DraftActionTypes.AddDrafts;

  constructor(public payload: { drafts: DraftModel[] }) {}
}
Severity: Major
Found in src/app/drafts/state/draft.actions.ts and 4 other locations - About 40 mins to fix
src/app/drafts/state/draft.actions.ts on lines 48..52
src/app/drafts/state/draft.actions.ts on lines 92..96
src/app/state/article.actions.ts on lines 288..294
src/app/state/article.actions.ts on lines 313..319

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

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

export class UpsertDrafts implements Action {
  readonly type = DraftActionTypes.UpsertDrafts;

  constructor(public payload: { drafts: DraftModel[] }) {}
}
Severity: Major
Found in src/app/drafts/state/draft.actions.ts and 4 other locations - About 40 mins to fix
src/app/drafts/state/draft.actions.ts on lines 48..52
src/app/drafts/state/draft.actions.ts on lines 86..90
src/app/state/article.actions.ts on lines 288..294
src/app/state/article.actions.ts on lines 313..319

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

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

export class AddDraftSuccess implements Action {
  readonly type = DraftActionTypes.AddDraftSuccess;

  constructor(public payload: { draft: DraftModel }) {}
}
Severity: Major
Found in src/app/drafts/state/draft.actions.ts and 7 other locations - About 35 mins to fix
src/app/drafts/state/draft.actions.ts on lines 61..65
src/app/drafts/state/draft.actions.ts on lines 80..84
src/app/drafts/state/draft.actions.ts on lines 129..133
src/app/state/article.actions.ts on lines 68..74
src/app/state/article.actions.ts on lines 110..114
src/app/state/article.actions.ts on lines 116..120
src/app/state/article.actions.ts on lines 265..269

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

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

export class AddDraft implements Action {
  readonly type = DraftActionTypes.AddDraft;

  constructor(public payload: { draft: DraftModel }) {}
}
Severity: Major
Found in src/app/drafts/state/draft.actions.ts and 7 other locations - About 35 mins to fix
src/app/drafts/state/draft.actions.ts on lines 67..71
src/app/drafts/state/draft.actions.ts on lines 80..84
src/app/drafts/state/draft.actions.ts on lines 129..133
src/app/state/article.actions.ts on lines 68..74
src/app/state/article.actions.ts on lines 110..114
src/app/state/article.actions.ts on lines 116..120
src/app/state/article.actions.ts on lines 265..269

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

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

export class UpsertDraft implements Action {
  readonly type = DraftActionTypes.UpsertDraft;

  constructor(public payload: { draft: DraftModel }) {}
}
Severity: Major
Found in src/app/drafts/state/draft.actions.ts and 7 other locations - About 35 mins to fix
src/app/drafts/state/draft.actions.ts on lines 61..65
src/app/drafts/state/draft.actions.ts on lines 67..71
src/app/drafts/state/draft.actions.ts on lines 129..133
src/app/state/article.actions.ts on lines 68..74
src/app/state/article.actions.ts on lines 110..114
src/app/state/article.actions.ts on lines 116..120
src/app/state/article.actions.ts on lines 265..269

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

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

export class DeleteDraftSuccess implements Action {
  readonly type = DraftActionTypes.DeleteDraftSuccess;

  constructor(public payload: { draft: DraftModel }) {}
}
Severity: Major
Found in src/app/drafts/state/draft.actions.ts and 7 other locations - About 35 mins to fix
src/app/drafts/state/draft.actions.ts on lines 61..65
src/app/drafts/state/draft.actions.ts on lines 67..71
src/app/drafts/state/draft.actions.ts on lines 80..84
src/app/state/article.actions.ts on lines 68..74
src/app/state/article.actions.ts on lines 110..114
src/app/state/article.actions.ts on lines 116..120
src/app/state/article.actions.ts on lines 265..269

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

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

export class DeleteDrafts implements Action {
  readonly type = DraftActionTypes.DeleteDrafts;

  constructor(public payload: { ids: string[] }) {}
}
Severity: Minor
Found in src/app/drafts/state/draft.actions.ts and 1 other location - About 35 mins to fix
src/app/state/article.actions.ts on lines 174..178

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

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

export class UpdateDraftFail implements Action {
  readonly type = DraftActionTypes.UpdateDraftFail;

  constructor(public payload?: { error: any }) {}
}
Severity: Major
Found in src/app/drafts/state/draft.actions.ts and 8 other locations - About 30 mins to fix
src/app/drafts/state/draft.actions.ts on lines 55..59
src/app/drafts/state/draft.actions.ts on lines 73..77
src/app/drafts/state/draft.actions.ts on lines 135..139
src/app/state/article.actions.ts on lines 76..80
src/app/state/article.actions.ts on lines 104..108
src/app/state/article.actions.ts on lines 122..126
src/app/state/article.actions.ts on lines 158..162
src/app/state/article.actions.ts on lines 321..325

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

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

export class DeleteDraftFail implements Action {
  readonly type = DraftActionTypes.DeleteDraftFail;

  constructor(public payload?: { error: any }) {}
}
Severity: Major
Found in src/app/drafts/state/draft.actions.ts and 8 other locations - About 30 mins to fix
src/app/drafts/state/draft.actions.ts on lines 55..59
src/app/drafts/state/draft.actions.ts on lines 73..77
src/app/drafts/state/draft.actions.ts on lines 110..114
src/app/state/article.actions.ts on lines 76..80
src/app/state/article.actions.ts on lines 104..108
src/app/state/article.actions.ts on lines 122..126
src/app/state/article.actions.ts on lines 158..162
src/app/state/article.actions.ts on lines 321..325

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

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

export class LoadDraftsFail implements Action {
  readonly type = DraftActionTypes.LoadDraftsFail;

  constructor(public payload?: { error: any }) {}
}
Severity: Major
Found in src/app/drafts/state/draft.actions.ts and 8 other locations - About 30 mins to fix
src/app/drafts/state/draft.actions.ts on lines 73..77
src/app/drafts/state/draft.actions.ts on lines 110..114
src/app/drafts/state/draft.actions.ts on lines 135..139
src/app/state/article.actions.ts on lines 76..80
src/app/state/article.actions.ts on lines 104..108
src/app/state/article.actions.ts on lines 122..126
src/app/state/article.actions.ts on lines 158..162
src/app/state/article.actions.ts on lines 321..325

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

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 class DeleteDraft implements Action {
  readonly type = DraftActionTypes.DeleteDraft;

  constructor(public payload: { id: string }) {}
}
Severity: Minor
Found in src/app/drafts/state/draft.actions.ts and 1 other location - About 30 mins to fix
src/app/state/app.actions.ts on lines 21..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 45.

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

export class AddDraftFail implements Action {
  readonly type = DraftActionTypes.AddDraftFail;

  constructor(public payload?: { error: any }) {}
}
Severity: Major
Found in src/app/drafts/state/draft.actions.ts and 8 other locations - About 30 mins to fix
src/app/drafts/state/draft.actions.ts on lines 55..59
src/app/drafts/state/draft.actions.ts on lines 110..114
src/app/drafts/state/draft.actions.ts on lines 135..139
src/app/state/article.actions.ts on lines 76..80
src/app/state/article.actions.ts on lines 104..108
src/app/state/article.actions.ts on lines 122..126
src/app/state/article.actions.ts on lines 158..162
src/app/state/article.actions.ts on lines 321..325

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

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