Showing 59 of 218 total issues
Function createMenu
has 266 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function createMenu (mainWindow, i18nextMain) {
// Create the Application's main menu
const template = [{
label: i18nextMain.t('Edit'),
submenu: [{
File background.js
has 565 lines of code (exceeds 250 allowed). Consider refactoring. Open
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'
File menu.js
has 430 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import {
app,
Menu,
MenuItem,
clipboard
`` has 40 functions (exceeds 20 allowed). Consider refactoring. Open
Open
export default {
fetchFeeds () {
return db.database.select().from(db.feedTable).exec()
},
fetchServicesFeeds (service) {
Function syncArticles
has 114 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async syncArticles (credsData) {
if (this.checkToken(credsData)) {
credsData = await refreshToken(credsData)
}
let subscriptions = await this.getSubscriptions(credsData)
Function syncItems
has 113 lines of code (exceeds 25 allowed). Consider refactoring. Open
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])
Function syncItems
has 99 lines of code (exceeds 25 allowed). Consider refactoring. Open
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(',')])
Function execTask
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
Open
function execTask (eventName, instance, args) {
const currentId = instance.$store.state.FeedManager.activeArticleId
switch (eventName) {
case 'Add subscription':
if (instance.$refs.subscribetoolbar) {
- Read upRead up
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
Open
function execTask (eventName, instance, args) {
const currentId = instance.$store.state.FeedManager.activeArticleId
switch (eventName) {
case 'Add subscription':
if (instance.$refs.subscribetoolbar) {
Function syncItems
has 94 lines of code (exceeds 25 allowed). Consider refactoring. Open
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))
Function signInPocketWithPopUp
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function signInPocketWithPopUp () {
return new Promise((resolve, reject) => {
let consumerKey
let code
const authWindow = new BrowserWindow({
File inoreader.js
has 306 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import dayjs from 'dayjs'
import db from './db.js'
import store from '../store'
import uuidstring from 'uuid-by-string'
import truncate from './truncate'
actions
has 27 functions (exceeds 20 allowed). Consider refactoring. Open
Open
const actions = {
loadSettings ({ commit }) {
commit('LOAD_SETTINGS')
},
setKeepRead ({ commit }, data) {
mutations
has 27 functions (exceeds 20 allowed). Consider refactoring. Open
Open
const mutations = {
LOAD_SETTINGS (state) {
const settings = JSON.parse(JSON.stringify(electronstore.getSettings()))
if (settings.fever_creds) {
settings.fever = JSON.parse(settings.fever)
File Setting.js
has 290 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
const state = {
pocket_connected: false,
pocket: null,
inoreader: null,
instapaper_connected: false,
File greader.js
has 285 lines of code (exceeds 250 allowed). Consider refactoring. Open
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'
Function createWindow
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function createWindow () {
// Create the browser window.
win = new BrowserWindow({
minWidth: 1280,
minHeight: 720,
Function ParseFeedPost
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
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)
- Read upRead up
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
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'
Function subscribe
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
subscribe (feeds, category = null, refresh = false, importData = false) {
const items = feeds.map(async (feed) => {
let url
if (!importData) {