mrgodhani/raven-reader

View on GitHub

Showing 218 of 218 total issues

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

const flattenDeep = arr =>
  Array.isArray(arr)
    ? arr.reduce((a, b) => [...flattenDeep(a), ...flattenDeep(b)], [])
    : [arr]
Severity: Major
Found in src/services/inoreader.js and 1 other location - About 1 hr to fix
src/services/greader.js on lines 13..16

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

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

  menu.append(
    new MenuItem({
      label: i18nextMain.t('Copy feed link'),
      click () {
        clipboard.writeText(feeddata.feed.xmlurl, 'selection')
Severity: Major
Found in src/main/menu.js and 1 other location - About 1 hr to fix
src/main/menu.js on lines 429..434

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

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

  menu.append(new MenuItem({
    label: i18nextMain.t('Copy link'),
    click () {
      clipboard.writeText(article.article.link, 'selection')
    }
Severity: Major
Found in src/main/menu.js and 1 other location - About 1 hr to fix
src/main/menu.js on lines 370..377

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

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

Function syncItems has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

  async syncItems (credsData) {
    let subscriptions = await this.getSubscriptions(credsData)
    const unreadList = await this.getUnreadIds(credsData)
    const starredList = await this.getStarredIds(credsData)
    const entriesId = new Set([...unreadList.split(','), ...starredList.split(',')])
Severity: Minor
Found in src/services/fever.js - About 1 hr to fix

Cognitive Complexity

Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

A method's cognitive complexity is based on a few simple rules:

  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
  • Code is considered more complex for each "break in the linear flow of the code"
  • Code is considered more complex when "flow breaking structures are nested"

Further reading

Function MARK_ALL_READ has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  MARK_ALL_READ (state, rootState) {
    const unreadArticles = state.articles.reduce((arr, item) => {
      if (!item.articles.read) {
        arr.push(item.articles.uuid)
      }
Severity: Minor
Found in src/store/modules/Article.js - About 1 hr to fix

    Function MARK_ALL_UNREAD has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      MARK_ALL_UNREAD (state, rootState) {
        const readArticles = state.articles.reduce((arr, item) => {
          if (item.articles.read) {
            arr.push(item.articles.uuid)
          }
    Severity: Minor
    Found in src/store/modules/Article.js - About 1 hr to fix

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

      const nextArticle = new TouchBarButton({
        icon: right,
        click: () => {
          const currentWindow = BrowserWindow.getFocusedWindow()
          currentWindow.webContents.send('Next item')
      Severity: Major
      Found in src/main/touchbar.js and 2 other locations - About 1 hr to fix
      src/main/touchbar.js on lines 33..39
      src/main/touchbar.js on lines 42..48

      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

        login: async (endpoint, creds) => {
          return await ipcRenderer.invoke('feedbin-login', {
            endpoint: endpoint,
            creds: {
              email: creds.email,
      Severity: Major
      Found in src/bridge/feedbin.js and 1 other location - About 1 hr to fix
      src/bridge/feedbin.js on lines 15..23

      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

        fetch: async (endpoint, creds) => {
          return await ipcRenderer.invoke('feedbin-endpoint-fetch', {
            endpoint: endpoint,
            creds: {
              email: creds.email,
      Severity: Major
      Found in src/bridge/feedbin.js and 1 other location - About 1 hr to fix
      src/bridge/feedbin.js on lines 6..14

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

      const favourite = new TouchBarButton({
        icon: star,
        click: () => {
          const currentWindow = BrowserWindow.getFocusedWindow()
          currentWindow.webContents.send('Toggle favourite')
      Severity: Major
      Found in src/main/touchbar.js and 2 other locations - About 1 hr to fix
      src/main/touchbar.js on lines 42..48
      src/main/touchbar.js on lines 51..57

      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

      const previousArticle = new TouchBarButton({
        icon: left,
        click: () => {
          const currentWindow = BrowserWindow.getFocusedWindow()
          currentWindow.webContents.send('Previous item')
      Severity: Major
      Found in src/main/touchbar.js and 2 other locations - About 1 hr to fix
      src/main/touchbar.js on lines 33..39
      src/main/touchbar.js on lines 51..57

      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

      Function getEntries has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        async getEntries (credsData, ids) {
          const perChunk = 250 // items per chunk
          const entries = []
          const chunks = ids.reduce((resultArray, item, index) => {
            const chunkIndex = Math.floor(index / perChunk)
      Severity: Minor
      Found in src/services/greader.js - About 1 hr to fix

        Function signInPocketWithPopUp has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function signInPocketWithPopUp () {
          if (os.platform() === 'darwin') {
            consumerKey = process.env.VUE_APP_POCKET_MAC_KEY
          }
        
        
        Severity: Minor
        Found in src/background.js - About 1 hr to fix

          Function setTheme has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              setTheme (themeValue) {
                switch (themeValue) {
                  case 'night':
                    this.toggleBodyClass(true, 'app-nightmode')
                    this.toggleBodyClass(false, 'app-sunsetmode')
          Severity: Minor
          Found in src/mixins/setTheme.js - About 1 hr to fix

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

                {
                  label: i18nextMain.t('Save offline'),
                  id: 'save-offline',
                  accelerator: 'CmdOrCtrl+O',
                  enabled: articleSelected,
            Severity: Major
            Found in src/main/menu.js and 3 other locations - About 1 hr to fix
            src/main/menu.js on lines 127..135
            src/main/menu.js on lines 136..144
            src/main/menu.js on lines 165..173

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

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

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

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

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

            Refactorings

            Further Reading

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

                {
                  label: i18nextMain.t('View in browser'),
                  id: 'view-browser',
                  accelerator: 'CmdOrCtrl+B',
                  enabled: articleSelected,
            Severity: Major
            Found in src/main/menu.js and 3 other locations - About 1 hr to fix
            src/main/menu.js on lines 127..135
            src/main/menu.js on lines 136..144
            src/main/menu.js on lines 156..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 55.

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

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

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

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

            Refactorings

            Further Reading

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

                {
                  label: i18nextMain.t('Toggle read'),
                  id: 'toggle-read',
                  accelerator: 'CmdOrCtrl+T',
                  enabled: articleSelected,
            Severity: Major
            Found in src/main/menu.js and 3 other locations - About 1 hr to fix
            src/main/menu.js on lines 136..144
            src/main/menu.js on lines 156..164
            src/main/menu.js on lines 165..173

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

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

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

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

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

            Refactorings

            Further Reading

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

                {
                  label: i18nextMain.t('Toggle favourite'),
                  id: 'toggle-favourite',
                  accelerator: 'CmdOrCtrl+S',
                  enabled: articleSelected,
            Severity: Major
            Found in src/main/menu.js and 3 other locations - About 1 hr to fix
            src/main/menu.js on lines 127..135
            src/main/menu.js on lines 156..164
            src/main/menu.js on lines 165..173

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

            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