mrgodhani/raven-reader

View on GitHub

Showing 59 of 218 total issues

Function createMenu has 266 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function createMenu (mainWindow, i18nextMain) {
  // Create the Application's main menu
  const template = [{
    label: i18nextMain.t('Edit'),
    submenu: [{
Severity: Major
Found in src/main/menu.js - About 1 day to fix

    File background.js has 565 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    'use strict'
    
    import { app, protocol, BrowserWindow, globalShortcut, nativeTheme, ipcMain, dialog, Notification, shell, powerMonitor, session } from 'electron'
    import { createProtocol } from 'vue-cli-plugin-electron-builder/lib'
    import installExtension, { VUEJS_DEVTOOLS } from 'electron-devtools-installer'
    Severity: Major
    Found in src/background.js - About 1 day to fix

      File menu.js has 430 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import {
        app,
        Menu,
        MenuItem,
        clipboard
      Severity: Minor
      Found in src/main/menu.js - About 6 hrs to fix

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

          Function syncArticles has 114 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            async syncArticles (credsData) {
              if (this.checkToken(credsData)) {
                credsData = await refreshToken(credsData)
              }
              let subscriptions = await this.getSubscriptions(credsData)
          Severity: Major
          Found in src/services/inoreader.js - About 4 hrs to fix

            Function syncItems has 113 lines of code (exceeds 25 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: Major
            Found in src/services/greader.js - About 4 hrs to fix

              Function syncItems has 99 lines of code (exceeds 25 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: Major
              Found in src/services/fever.js - About 3 hrs to fix

                Function execTask has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
                Open

                function execTask (eventName, instance, args) {
                  const currentId = instance.$store.state.FeedManager.activeArticleId
                  switch (eventName) {
                    case 'Add subscription':
                      if (instance.$refs.subscribetoolbar) {
                Severity: Minor
                Found in src/services/bridge.js - About 3 hrs 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 execTask has 96 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function execTask (eventName, instance, args) {
                  const currentId = instance.$store.state.FeedManager.activeArticleId
                  switch (eventName) {
                    case 'Add subscription':
                      if (instance.$refs.subscribetoolbar) {
                Severity: Major
                Found in src/services/bridge.js - About 3 hrs to fix

                  Function syncItems has 94 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    async syncItems (feedbinCreds) {
                      let subscriptions = await this.getSubscriptions(feedbinCreds)
                      const unreadList = await this.getUnreadEntries(feedbinCreds)
                      const starredList = await this.getStarredEntries(feedbinCreds)
                      const entries = this.transformEntriesAndFeed(unreadList, starredList, await this.getEntries(feedbinCreds, unreadList))
                  Severity: Major
                  Found in src/services/feedbin.js - About 3 hrs to fix

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

                    export default function signInPocketWithPopUp () {
                      return new Promise((resolve, reject) => {
                        let consumerKey
                        let code
                        const authWindow = new BrowserWindow({
                    Severity: Major
                    Found in src/main/pocket.js - About 3 hrs to fix

                      File inoreader.js has 306 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      import dayjs from 'dayjs'
                      import db from './db.js'
                      import store from '../store'
                      import uuidstring from 'uuid-by-string'
                      import truncate from './truncate'
                      Severity: Minor
                      Found in src/services/inoreader.js - About 3 hrs to fix

                        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

                              File greader.js has 285 lines of code (exceeds 250 allowed). Consider refactoring.
                              Open

                              import dayjs from 'dayjs'
                              import db from './db.js'
                              import uuidstring from 'uuid-by-string'
                              import * as database from '../db'
                              import truncate from './truncate'
                              Severity: Minor
                              Found in src/services/greader.js - About 2 hrs to fix

                                Function createWindow has 69 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                async function createWindow () {
                                  // Create the browser window.
                                  win = new BrowserWindow({
                                    minWidth: 1280,
                                    minHeight: 720,
                                Severity: Major
                                Found in src/background.js - About 2 hrs to fix

                                  Function ParseFeedPost has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                  export function ParseFeedPost (feed) {
                                    const feeditems = JSON.parse(JSON.stringify(feed))
                                    const posts = feeditems.posts.map((item) => {
                                      const podcast = checkIsPodCast(item)
                                      const articleLink = item.link ?? feed.meta.xmlurl ?? Math.random().toString(36).substring(7)
                                  Severity: Minor
                                  Found in src/parsers/feed.js - About 2 hrs 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

                                  File Article.js has 272 lines of code (exceeds 250 allowed). Consider refactoring.
                                  Open

                                  import db from '../../services/db'
                                  import helper from '../../services/helpers'
                                  import dayjs from 'dayjs'
                                  import advanced from 'dayjs/plugin/advancedFormat'
                                  import timezone from 'dayjs/plugin/timezone'
                                  Severity: Minor
                                  Found in src/store/modules/Article.js - About 2 hrs to fix

                                    Function subscribe has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                      subscribe (feeds, category = null, refresh = false, importData = false) {
                                        const items = feeds.map(async (feed) => {
                                          let url
                                    
                                          if (!importData) {
                                    Severity: Major
                                    Found in src/services/helpers.js - About 2 hrs to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language