mrgodhani/raven-reader

View on GitHub
src/store/modules/Setting.js

Summary

Maintainability
D
1 day
Test Coverage

actions has 27 functions (exceeds 20 allowed). Consider refactoring.
Open

const actions = {
  loadSettings ({ commit }) {
    commit('LOAD_SETTINGS')
  },
  setKeepRead ({ commit }, data) {
Severity: Minor
Found in src/store/modules/Setting.js - About 3 hrs to fix

    mutations has 27 functions (exceeds 20 allowed). Consider refactoring.
    Open

    const mutations = {
      LOAD_SETTINGS (state) {
        const settings = JSON.parse(JSON.stringify(electronstore.getSettings()))
        if (settings.fever_creds) {
          settings.fever = JSON.parse(settings.fever)
    Severity: Minor
    Found in src/store/modules/Setting.js - About 3 hrs to fix

      File Setting.js has 290 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      const state = {
        pocket_connected: false,
        pocket: null,
        inoreader: null,
        instapaper_connected: false,
      Severity: Minor
      Found in src/store/modules/Setting.js - About 2 hrs to fix

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

          UNSET_FEVER (state) {
            state.fever_connected = false
            state.fever = {
              endpoint: null,
              username: null,
        Severity: Minor
        Found in src/store/modules/Setting.js and 1 other location - About 50 mins to fix
        src/store/modules/Setting.js on lines 147..155

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

        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

          UNSET_SELFHOST (state) {
            state.selfhost_connected = false
            state.selfhost = {
              endpoint: null,
              username: null,
        Severity: Minor
        Found in src/store/modules/Setting.js and 1 other location - About 50 mins to fix
        src/store/modules/Setting.js on lines 138..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 52.

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

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

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

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

        Refactorings

        Further Reading

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

          setContentPreviewPreference ({ commit }, data) {
            electronstore.storeSetSettingItem('set', 'settings.contentPreviewPreference', data === 'on')
            commit('SET_CONTENT_PREVIEW_PREFERENCE', data === 'on')
          },
        Severity: Major
        Found in src/store/modules/Setting.js and 4 other locations - About 30 mins to fix
        src/store/modules/Setting.js on lines 249..252
        src/store/modules/Setting.js on lines 257..260
        src/store/modules/Setting.js on lines 261..264
        src/store/modules/Setting.js on lines 265..268

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

          setRecentlyReadPreference ({ commit }, data) {
            electronstore.storeSetSettingItem('set', 'settings.recentlyReadPreference', data === 'on')
            commit('SET_RECENTLY_READ_PREFERENCE', data === 'on')
          },
        Severity: Major
        Found in src/store/modules/Setting.js and 4 other locations - About 30 mins to fix
        src/store/modules/Setting.js on lines 253..256
        src/store/modules/Setting.js on lines 257..260
        src/store/modules/Setting.js on lines 261..264
        src/store/modules/Setting.js on lines 265..268

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

          async setImagePreference ({ commit }, data) {
            electronstore.storeSetSettingItem('set', 'settings.imagePreference', data === 'on')
            commit('SET_IMAGE_PREFERENCE', data === 'on')
          },
        Severity: Major
        Found in src/store/modules/Setting.js and 4 other locations - About 30 mins to fix
        src/store/modules/Setting.js on lines 249..252
        src/store/modules/Setting.js on lines 253..256
        src/store/modules/Setting.js on lines 257..260
        src/store/modules/Setting.js on lines 261..264

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

          setViewOriginalPreference ({ commit }, data) {
            electronstore.storeSetSettingItem('set', 'settings.viewOriginalPreference', data === 'on')
            commit('SET_VIEW_ORIGINAL_PREFERENCE', data === 'on')
          },
        Severity: Major
        Found in src/store/modules/Setting.js and 4 other locations - About 30 mins to fix
        src/store/modules/Setting.js on lines 249..252
        src/store/modules/Setting.js on lines 253..256
        src/store/modules/Setting.js on lines 257..260
        src/store/modules/Setting.js on lines 265..268

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

          setFullArticlePreference ({ commit }, data) {
            electronstore.storeSetSettingItem('set', 'settings.fullArticlePreference', data === 'on')
            commit('SET_FULL_ARTICLE_PREFERENCE', data === 'on')
          },
        Severity: Major
        Found in src/store/modules/Setting.js and 4 other locations - About 30 mins to fix
        src/store/modules/Setting.js on lines 249..252
        src/store/modules/Setting.js on lines 253..256
        src/store/modules/Setting.js on lines 261..264
        src/store/modules/Setting.js on lines 265..268

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 45.

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

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

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

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

        Refactorings

        Further Reading

        There are no issues that match your filters.

        Category
        Status