Takumon/mean-blog

View on GitHub

Showing 240 of 340 total issues

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

    return Article
    .findOne({ _id: req.params.articleId,  deleted: { $eq: null}})
    .exec()
    .then(target => {

Severity: Minor
Found in server/helpers/validate-helper.ts and 2 other locations - About 35 mins to fix
server/helpers/validate-helper.ts on lines 147..164
server/routes/authenticate.ts on lines 162..170

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

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

  const condition = {
    _id: new mongoose.Types.ObjectId(req.params._id),
    deleted: { $eq: null}  // 削除記事は除外
  };
Severity: Minor
Found in server/routes/reply.ts and 1 other location - About 35 mins to fix
server/routes/draft.ts on lines 62..65

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

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

  return User
  .findOne({ _id: req.body._id, deleted: { $eq: null}})
  .exec()
  .then(user => {
    if (user && PasswordManager.compare(password, user.password)) {
Severity: Minor
Found in server/routes/authenticate.ts and 2 other locations - About 35 mins to fix
server/helpers/validate-helper.ts on lines 125..142
server/helpers/validate-helper.ts on lines 147..164

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

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

    return Article
    .findOne({ _id: req.params._id, deleted: { $eq: null}})
    .exec()
    .then(target => {

Severity: Minor
Found in server/helpers/validate-helper.ts and 2 other locations - About 35 mins to fix
server/helpers/validate-helper.ts on lines 125..142
server/routes/authenticate.ts on lines 162..170

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

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

  login() {
    this.router.navigate(['/login'], { queryParams: { returnUrl: this.router.url }});
  }
Severity: Minor
Found in src/app/app.component.ts and 1 other location - About 35 mins to fix
src/app/app.component.ts on lines 102..104

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

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 LoadArticleFail implements Action {
  readonly type = ArticleActionTypes.LoadArticleFail;

  constructor(public payload?: { error: any }) {}
}
Severity: Major
Found in src/app/state/article.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/drafts/state/draft.actions.ts on lines 135..139
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

    if (voters instanceof Array) {
      condition.vote = {
        $in: voters.map(id =>  new mongoose.Types.ObjectId(id))
      };
    } else {
Severity: Minor
Found in server/routes/article.ts and 1 other location - About 30 mins to fix
server/routes/article.ts on lines 163..169

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

    if (searchCondition.dateFrom) {
      searchCondition.dateFrom = moment(searchCondition.dateFrom).startOf('date').toString();
    }
Severity: Minor
Found in src/app/articles/search-condition/search-condition.dialog.ts and 1 other location - About 30 mins to fix
src/app/articles/search-condition/search-condition.dialog.ts on lines 232..234

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 AddArticleFail implements Action {
  readonly type = ArticleActionTypes.AddArticleFail;

  constructor(public payload: { error: any }) {}
}
Severity: Major
Found in src/app/state/article.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/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 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 UpdateArticleFail implements Action {
  readonly type = ArticleActionTypes.UpdateArticleFail;

  constructor(public payload: { error: any }) {}
}
Severity: Major
Found in src/app/state/article.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/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 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

    if (searchCondition.dateTo) {
      searchCondition.dateTo = moment(searchCondition.dateTo).endOf('date').toString();
    }
Severity: Minor
Found in src/app/articles/search-condition/search-condition.dialog.ts and 1 other location - About 30 mins to fix
src/app/articles/search-condition/search-condition.dialog.ts on lines 229..231

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 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 DeleteVoteFail implements Action {
  readonly type = ArticleActionTypes.DeleteVoteFail;

  constructor(public payload: {error: any}) {}
}
Severity: Major
Found in src/app/state/article.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/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

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

    if (_ids instanceof Array) {
      condition.author = {
        $in: _ids.map(id =>  new mongoose.Types.ObjectId(id))
      };
    } else {
Severity: Minor
Found in server/routes/article.ts and 1 other location - About 30 mins to fix
server/routes/article.ts on lines 187..195

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

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

export class SetTitle implements Action {
  readonly type = AppActionTypes.SetTitle;

  constructor(public payload: {
    title: string
Severity: Minor
Found in src/app/state/app.actions.ts and 1 other location - About 30 mins to fix
src/app/drafts/state/draft.actions.ts on lines 123..127

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 LoadArticlesFail implements Action {
  readonly type = ArticleActionTypes.LoadArticlesFail;

  constructor(public payload?: { error: any }) {}
}
Severity: Major
Found in src/app/state/article.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/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 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

Severity
Category
Status
Source
Language