mrgodhani/raven-reader

View on GitHub

Showing 59 of 218 total issues

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_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

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

          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 getUnreadIds has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

              async getUnreadIds (credsData) {
                const ids = []
                let continuation = null
                let apiUrl
                try {
            Severity: Minor
            Found in src/services/inoreader.js - About 55 mins 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 getStarredIds has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

              async getStarredIds (credsData) {
                const ids = []
                let continuation = null
                let apiUrl
                try {
            Severity: Minor
            Found in src/services/inoreader.js - About 55 mins 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 getUnreadIds has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

              async getUnreadIds (credsData) {
                const ids = []
                let continuation = null
                let apiUrl
                try {
            Severity: Minor
            Found in src/services/greader.js - About 55 mins 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 getStarredIds has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

              async getStarredIds (credsData) {
                const ids = []
                let continuation = null
                let apiUrl
                try {
            Severity: Minor
            Found in src/services/greader.js - About 55 mins 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 a Cognitive Complexity of 8 (exceeds 5 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 45 mins 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 decodeFetchResponse has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

            async function decodeFetchResponse (response, isHTML = false) {
              const CHARSET_RE = /charset=([^()<>@,;:\\"/[\]?.=\s]*)/i
              const buffer = await response.arrayBuffer()
              let ctype = response.headers.has('content-type') && response.headers.get('content-type')
              let charset = (ctype && CHARSET_RE.test(ctype)) ? CHARSET_RE.exec(ctype)[1] : undefined
            Severity: Minor
            Found in src/parsers/article.js - About 45 mins 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 supportExternalLinks has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

            const supportExternalLinks = event => {
              let href
              let isExternal = false
            
              const checkDomElement = element => {
            Severity: Minor
            Found in src/external_links.js - About 45 mins 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_UNREAD has a Cognitive Complexity of 8 (exceeds 5 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 45 mins 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 syncArticles has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

              async syncArticles (credsData) {
                if (this.checkToken(credsData)) {
                  credsData = await refreshToken(credsData)
                }
                let subscriptions = await this.getSubscriptions(credsData)
            Severity: Minor
            Found in src/services/inoreader.js - About 35 mins 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 filteredArticles has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

              filteredArticles: (state, getters, rootState) => {
                const sortPref = rootState.Setting.oldestArticles === 'off' ? 'desc' : 'asc'
                const orderedArticles = state.articles.concat().sort(sortBy('publishUnix', sortPref))
                if (state.type !== 'feed' && state.type !== 'search') {
                  return filters[state.type](orderedArticles)
            Severity: Minor
            Found in src/store/modules/Article.js - About 35 mins 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 syncItems has a Cognitive Complexity of 7 (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, ...starredList])
            Severity: Minor
            Found in src/services/greader.js - About 35 mins 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

            Avoid too many return statements within this function.
            Open

                return filters[state.type](orderedArticles, state.feed)
            Severity: Major
            Found in src/store/modules/Article.js - About 30 mins to fix

              Function getEntries has a Cognitive Complexity of 6 (exceeds 5 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 25 mins 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

              Severity
              Category
              Status
              Source
              Language