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(',')])
- 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 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)
}
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)
}
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)
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')
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
}
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 {
- 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 getStarredIds
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
async getStarredIds (credsData) {
const ids = []
let continuation = null
let apiUrl
try {
- 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 getUnreadIds
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
async getUnreadIds (credsData) {
const ids = []
let continuation = null
let apiUrl
try {
- 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 getStarredIds
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
async getStarredIds (credsData) {
const ids = []
let continuation = null
let apiUrl
try {
- 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 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)
}
- 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 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
- 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 supportExternalLinks
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const supportExternalLinks = event => {
let href
let isExternal = false
const checkDomElement = element => {
- 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 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)
}
- 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 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)
- 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 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)
- 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 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])
- 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
Avoid too many return
statements within this function. Open
return filters[state.type](orderedArticles, state.feed)
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)
- 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"