mrgodhani/raven-reader

View on GitHub
src/services/db.js

Summary

Maintainability
F
1 wk
Test Coverage

`` has 40 functions (exceeds 20 allowed). Consider refactoring.
Open

export default {
  fetchFeeds () {
    return db.database.select().from(db.feedTable).exec()
  },
  fetchServicesFeeds (service) {
Severity: Minor
Found in src/services/db.js - About 5 hrs to fix

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

      markAllunread (uuids) {
        // Non-podcast
        return db.database.update(db.articleTable)
          .set(db.articleTable.read, false)
          .set(db.articleTable.keep_read, dayjs().add(store.state.Setting.keepRead, 'week').valueOf())
    Severity: Major
    Found in src/services/db.js and 1 other location - About 4 hrs to fix
    src/services/db.js on lines 164..171

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

    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

      markAllRead (uuids) {
        // Non-podcast
        return db.database.update(db.articleTable)
          .set(db.articleTable.read, true)
          .set(db.articleTable.keep_read, dayjs().add(store.state.Setting.keepRead, 'week').valueOf())
    Severity: Major
    Found in src/services/db.js and 1 other location - About 4 hrs to fix
    src/services/db.js on lines 156..163

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

    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

      fetchServicesArticles (service) {
        return db.database
          .select()
          .from(db.articleTable)
          .innerJoin(db.feedTable, db.feedTable.uuid.eq(db.articleTable.feed_uuid))
    Severity: Major
    Found in src/services/db.js and 1 other location - About 3 hrs to fix
    src/services/db.js on lines 79..85

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

    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

      fetchArticle (uuid) {
        return db.database.select()
          .from(db.articleTable)
          .innerJoin(db.feedTable, db.feedTable.uuid.eq(db.articleTable.feed_uuid))
          .where(db.articleTable.uuid.eq(uuid))
    Severity: Major
    Found in src/services/db.js and 1 other location - About 3 hrs to fix
    src/services/db.js on lines 13..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 103.

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

      updateCategory (id, category) {
        return db.database.update(db.categoryTable)
          .set(db.categoryTable.title, category)
          .where(db.categoryTable.id.eq(id))
          .exec()
    Severity: Major
    Found in src/services/db.js and 6 other locations - About 2 hrs to fix
    src/services/db.js on lines 61..66
    src/services/db.js on lines 86..91
    src/services/db.js on lines 92..97
    src/services/db.js on lines 98..103
    src/services/db.js on lines 128..133
    src/services/db.js on lines 184..189

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

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

      updateArticleCategory (uuids, category) {
        return db.database.update(db.articleTable)
          .set(db.articleTable.category, category)
          .where(db.articleTable.uuid.in(uuids))
          .exec()
    Severity: Major
    Found in src/services/db.js and 6 other locations - About 2 hrs to fix
    src/services/db.js on lines 61..66
    src/services/db.js on lines 86..91
    src/services/db.js on lines 92..97
    src/services/db.js on lines 113..118
    src/services/db.js on lines 128..133
    src/services/db.js on lines 184..189

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

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

      updateArticleCategoryFeedMulti (feedids, category) {
        return db.database.update(db.articleTable)
          .set(db.articleTable.category, category)
          .where(db.articleTable.feed_uuid.in(feedids))
          .exec()
    Severity: Major
    Found in src/services/db.js and 6 other locations - About 2 hrs to fix
    src/services/db.js on lines 61..66
    src/services/db.js on lines 86..91
    src/services/db.js on lines 98..103
    src/services/db.js on lines 113..118
    src/services/db.js on lines 128..133
    src/services/db.js on lines 184..189

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

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

      markOffline (uuid, verdict) {
        return db.database.update(db.articleTable)
          .set(db.articleTable.offline, verdict)
          .where(db.articleTable.uuid.eq(uuid))
          .exec()
    Severity: Major
    Found in src/services/db.js and 6 other locations - About 2 hrs to fix
    src/services/db.js on lines 61..66
    src/services/db.js on lines 86..91
    src/services/db.js on lines 92..97
    src/services/db.js on lines 98..103
    src/services/db.js on lines 113..118
    src/services/db.js on lines 184..189

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

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

      updateArticleCategoryFeed (feedid, category) {
        return db.database.update(db.articleTable)
          .set(db.articleTable.category, category)
          .where(db.articleTable.feed_uuid.eq(feedid))
          .exec()
    Severity: Major
    Found in src/services/db.js and 6 other locations - About 2 hrs to fix
    src/services/db.js on lines 61..66
    src/services/db.js on lines 92..97
    src/services/db.js on lines 98..103
    src/services/db.js on lines 113..118
    src/services/db.js on lines 128..133
    src/services/db.js on lines 184..189

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

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

      updateFeedCategory (ids, category) {
        return db.database.update(db.feedTable)
          .set(db.feedTable.category, category)
          .where(db.feedTable.uuid.in(ids))
          .exec()
    Severity: Major
    Found in src/services/db.js and 6 other locations - About 2 hrs to fix
    src/services/db.js on lines 86..91
    src/services/db.js on lines 92..97
    src/services/db.js on lines 98..103
    src/services/db.js on lines 113..118
    src/services/db.js on lines 128..133
    src/services/db.js on lines 184..189

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

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

      markFavourite (uuid, verdict) {
        return db.database.update(db.articleTable)
          .set(db.articleTable.favourite, verdict)
          .where(db.articleTable.uuid.eq(uuid))
          .exec()
    Severity: Major
    Found in src/services/db.js and 6 other locations - About 2 hrs to fix
    src/services/db.js on lines 61..66
    src/services/db.js on lines 86..91
    src/services/db.js on lines 92..97
    src/services/db.js on lines 98..103
    src/services/db.js on lines 113..118
    src/services/db.js on lines 128..133

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

    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

      markBulkFavourite (uuids) {
        return db.database.update(db.articleTable)
          .set(db.articleTable.favourite, true)
          .where(db.articleTable.uuid.in(uuids))
          .exec()
    Severity: Major
    Found in src/services/db.js and 1 other location - About 2 hrs to fix
    src/services/db.js on lines 178..183

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

    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

      unassignCategoriesArticles (uuids) {
        return db.database.update(db.articleTable)
          .set(db.articleTable.category, null)
          .where(db.articleTable.uuid.in(uuids))
          .exec()
    Severity: Major
    Found in src/services/db.js and 1 other location - About 2 hrs to fix
    src/services/db.js on lines 218..223

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

    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

      markBulkUnFavourite (uuids) {
        return db.database.update(db.articleTable)
          .set(db.articleTable.favourite, false)
          .where(db.articleTable.uuid.in(uuids))
          .exec()
    Severity: Major
    Found in src/services/db.js and 1 other location - About 2 hrs to fix
    src/services/db.js on lines 172..177

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

    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

      unassignFeeds (uuids) {
        return db.database.update(db.feedTable)
          .set(db.feedTable.category, null)
          .where(db.feedTable.uuid.in(uuids))
          .exec()
    Severity: Major
    Found in src/services/db.js and 1 other location - About 2 hrs to fix
    src/services/db.js on lines 224..229

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

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

      fetchArticlesByFeedMulti (feedIds) {
        return db.database
          .select()
          .from(db.articleTable)
          .where(db.articleTable.feed_uuid.in(feedIds))
    Severity: Major
    Found in src/services/db.js and 12 other locations - About 1 hr to fix
    src/services/db.js on lines 10..12
    src/services/db.js on lines 28..34
    src/services/db.js on lines 45..47
    src/services/db.js on lines 48..50
    src/services/db.js on lines 51..53
    src/services/db.js on lines 70..72
    src/services/db.js on lines 73..75
    src/services/db.js on lines 76..78
    src/services/db.js on lines 110..112
    src/services/db.js on lines 119..121
    src/services/db.js on lines 122..124
    src/services/db.js on lines 125..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 66.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

      deleteArticlesSyncAccount (subscription) {
        return db.database.delete().from(db.articleTable).where(db.articleTable.source.eq(subscription)).exec()
      },
    Severity: Major
    Found in src/services/db.js and 12 other locations - About 1 hr to fix
    src/services/db.js on lines 10..12
    src/services/db.js on lines 28..34
    src/services/db.js on lines 35..41
    src/services/db.js on lines 45..47
    src/services/db.js on lines 48..50
    src/services/db.js on lines 51..53
    src/services/db.js on lines 70..72
    src/services/db.js on lines 76..78
    src/services/db.js on lines 110..112
    src/services/db.js on lines 119..121
    src/services/db.js on lines 122..124
    src/services/db.js on lines 125..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 66.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

      deleteAllSyncAccountSubscriptions (subscription) {
        return db.database.delete().from(db.feedTable).where(db.feedTable.source.eq(subscription)).exec()
      },
    Severity: Major
    Found in src/services/db.js and 12 other locations - About 1 hr to fix
    src/services/db.js on lines 10..12
    src/services/db.js on lines 28..34
    src/services/db.js on lines 35..41
    src/services/db.js on lines 45..47
    src/services/db.js on lines 51..53
    src/services/db.js on lines 70..72
    src/services/db.js on lines 73..75
    src/services/db.js on lines 76..78
    src/services/db.js on lines 110..112
    src/services/db.js on lines 119..121
    src/services/db.js on lines 122..124
    src/services/db.js on lines 125..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 66.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

      fetchCategoriesBySource (source) {
        return db.database.select().from(db.categoryTable).where(db.categoryTable.source.eq(source)).exec()
      },
    Severity: Major
    Found in src/services/db.js and 12 other locations - About 1 hr to fix
    src/services/db.js on lines 10..12
    src/services/db.js on lines 28..34
    src/services/db.js on lines 35..41
    src/services/db.js on lines 45..47
    src/services/db.js on lines 48..50
    src/services/db.js on lines 51..53
    src/services/db.js on lines 70..72
    src/services/db.js on lines 73..75
    src/services/db.js on lines 76..78
    src/services/db.js on lines 119..121
    src/services/db.js on lines 122..124
    src/services/db.js on lines 125..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 66.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

      fetchArticlesByFeed (feedId) {
        return db.database
          .select()
          .from(db.articleTable)
          .where(db.articleTable.feed_uuid.eq(feedId))
    Severity: Major
    Found in src/services/db.js and 12 other locations - About 1 hr to fix
    src/services/db.js on lines 10..12
    src/services/db.js on lines 35..41
    src/services/db.js on lines 45..47
    src/services/db.js on lines 48..50
    src/services/db.js on lines 51..53
    src/services/db.js on lines 70..72
    src/services/db.js on lines 73..75
    src/services/db.js on lines 76..78
    src/services/db.js on lines 110..112
    src/services/db.js on lines 119..121
    src/services/db.js on lines 122..124
    src/services/db.js on lines 125..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 66.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

      deleteArticlesMulti (articles) {
        return db.database.delete().from(db.articleTable).where(db.articleTable.uuid.in(articles)).exec()
      },
    Severity: Major
    Found in src/services/db.js and 12 other locations - About 1 hr to fix
    src/services/db.js on lines 10..12
    src/services/db.js on lines 28..34
    src/services/db.js on lines 35..41
    src/services/db.js on lines 45..47
    src/services/db.js on lines 48..50
    src/services/db.js on lines 51..53
    src/services/db.js on lines 70..72
    src/services/db.js on lines 73..75
    src/services/db.js on lines 110..112
    src/services/db.js on lines 119..121
    src/services/db.js on lines 122..124
    src/services/db.js on lines 125..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 66.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

      fetchServicesFeeds (service) {
        return db.database.select().from(db.feedTable).where(db.feedTable.source.eq(service)).exec()
      },
    Severity: Major
    Found in src/services/db.js and 12 other locations - About 1 hr to fix
    src/services/db.js on lines 28..34
    src/services/db.js on lines 35..41
    src/services/db.js on lines 45..47
    src/services/db.js on lines 48..50
    src/services/db.js on lines 51..53
    src/services/db.js on lines 70..72
    src/services/db.js on lines 73..75
    src/services/db.js on lines 76..78
    src/services/db.js on lines 110..112
    src/services/db.js on lines 119..121
    src/services/db.js on lines 122..124
    src/services/db.js on lines 125..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 66.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

      deleteArticles (feedId) {
        return db.database.delete().from(db.articleTable).where(db.articleTable.feed_uuid.eq(feedId)).exec()
      },
    Severity: Major
    Found in src/services/db.js and 12 other locations - About 1 hr to fix
    src/services/db.js on lines 10..12
    src/services/db.js on lines 28..34
    src/services/db.js on lines 35..41
    src/services/db.js on lines 45..47
    src/services/db.js on lines 48..50
    src/services/db.js on lines 51..53
    src/services/db.js on lines 73..75
    src/services/db.js on lines 76..78
    src/services/db.js on lines 110..112
    src/services/db.js on lines 119..121
    src/services/db.js on lines 122..124
    src/services/db.js on lines 125..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 66.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

      deleteFeed (feedId) {
        return db.database.delete().from(db.feedTable).where(db.feedTable.uuid.eq(feedId)).exec()
      },
    Severity: Major
    Found in src/services/db.js and 12 other locations - About 1 hr to fix
    src/services/db.js on lines 10..12
    src/services/db.js on lines 28..34
    src/services/db.js on lines 35..41
    src/services/db.js on lines 48..50
    src/services/db.js on lines 51..53
    src/services/db.js on lines 70..72
    src/services/db.js on lines 73..75
    src/services/db.js on lines 76..78
    src/services/db.js on lines 110..112
    src/services/db.js on lines 119..121
    src/services/db.js on lines 122..124
    src/services/db.js on lines 125..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 66.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

      deleteCategoryMulti (titles) {
        return db.database.delete().from(db.categoryTable).where(db.categoryTable.title.in(titles)).exec()
      },
    Severity: Major
    Found in src/services/db.js and 12 other locations - About 1 hr to fix
    src/services/db.js on lines 10..12
    src/services/db.js on lines 28..34
    src/services/db.js on lines 35..41
    src/services/db.js on lines 45..47
    src/services/db.js on lines 48..50
    src/services/db.js on lines 51..53
    src/services/db.js on lines 70..72
    src/services/db.js on lines 73..75
    src/services/db.js on lines 76..78
    src/services/db.js on lines 110..112
    src/services/db.js on lines 119..121
    src/services/db.js on lines 122..124

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 66.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

      deleteFeedMulti (feedIds) {
        return db.database.delete().from(db.feedTable).where(db.feedTable.uuid.in(feedIds)).exec()
      },
    Severity: Major
    Found in src/services/db.js and 12 other locations - About 1 hr to fix
    src/services/db.js on lines 10..12
    src/services/db.js on lines 28..34
    src/services/db.js on lines 35..41
    src/services/db.js on lines 45..47
    src/services/db.js on lines 48..50
    src/services/db.js on lines 70..72
    src/services/db.js on lines 73..75
    src/services/db.js on lines 76..78
    src/services/db.js on lines 110..112
    src/services/db.js on lines 119..121
    src/services/db.js on lines 122..124
    src/services/db.js on lines 125..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 66.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

      deleteCategory (title) {
        return db.database.delete().from(db.categoryTable).where(db.categoryTable.title.eq(title)).exec()
      },
    Severity: Major
    Found in src/services/db.js and 12 other locations - About 1 hr to fix
    src/services/db.js on lines 10..12
    src/services/db.js on lines 28..34
    src/services/db.js on lines 35..41
    src/services/db.js on lines 45..47
    src/services/db.js on lines 48..50
    src/services/db.js on lines 51..53
    src/services/db.js on lines 70..72
    src/services/db.js on lines 73..75
    src/services/db.js on lines 76..78
    src/services/db.js on lines 110..112
    src/services/db.js on lines 119..121
    src/services/db.js on lines 125..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 66.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

      deleteCategoryBySource (source) {
        return db.database.delete().from(db.categoryTable).where(db.categoryTable.source.eq(source)).exec()
      },
    Severity: Major
    Found in src/services/db.js and 12 other locations - About 1 hr to fix
    src/services/db.js on lines 10..12
    src/services/db.js on lines 28..34
    src/services/db.js on lines 35..41
    src/services/db.js on lines 45..47
    src/services/db.js on lines 48..50
    src/services/db.js on lines 51..53
    src/services/db.js on lines 70..72
    src/services/db.js on lines 73..75
    src/services/db.js on lines 76..78
    src/services/db.js on lines 110..112
    src/services/db.js on lines 122..124
    src/services/db.js on lines 125..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 66.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

          return db.database.update(db.articleTable)
            .set(db.articleTable.read, verdict)
            .set(db.articleTable.played, verdict)
            .set(db.articleTable.keep_read, dayjs().add(store.state.Setting.keepRead, 'week').valueOf())
    Severity: Major
    Found in src/services/db.js and 1 other location - About 1 hr to fix
    src/services/db.js 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 56.

    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

        return db.database.update(db.feedTable)
          .set(db.feedTable.title, title)
          .set(db.feedTable.category, category)
          .where(db.feedTable.uuid.eq(id))
    Severity: Major
    Found in src/services/db.js and 1 other location - About 1 hr to fix
    src/services/db.js on lines 143..146

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

    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

      addCategory (data) {
        return db.database.insertOrReplace().into(db.categoryTable).values(data).exec()
      },
    Severity: Major
    Found in src/services/db.js and 2 other locations - About 45 mins to fix
    src/services/db.js on lines 42..44
    src/services/db.js on lines 67..69

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

    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

      addFeed (data) {
        return db.database.insertOrReplace().into(db.feedTable).values(data).exec()
      },
    Severity: Major
    Found in src/services/db.js and 2 other locations - About 45 mins to fix
    src/services/db.js on lines 67..69
    src/services/db.js on lines 104..106

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

    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

      addArticles (data) {
        return db.database.insertOrReplace().into(db.articleTable).values(data).exec()
      },
    Severity: Major
    Found in src/services/db.js and 2 other locations - About 45 mins to fix
    src/services/db.js on lines 42..44
    src/services/db.js on lines 104..106

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

    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