Showing 60 of 142 total issues
Function processRefresh
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const processRefresh = async (req, res, refreshToken, type) => {
if (properties.server.auth[type].oauth === 1) {
return undefined;
} else if (properties.server.auth[type].oauth === 2) {
if (!properties.server.auth[type].refreshUri) {
- 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 ensureFilesOnCacheAndSecurity
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
async ensureFilesOnCacheAndSecurity() {
if (ensureArchiveDomain(this.req.headers.host)) {
this.res.status(403).send(`Forbidden. Must use ${properties.server.archive.domain}`);
return;
}
- 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 null;
Avoid too many return
statements within this function. Open
return 0;
Avoid too many return
statements within this function. Open
return currentFeedData;
Avoid too many return
statements within this function. Open
return obj.linkUrl;
Avoid too many return
statements within this function. Open
return sortingByColumnOrder * b.linkUrl.localeCompare(a.linkUrl);
Avoid too many return
statements within this function. Open
return 'No valid RSS found';
Avoid too many return
statements within this function. Open
return currentFeedData;
Avoid too many return
statements within this function. Open
return `${daysAgo} days ago`;
Avoid too many return
statements within this function. Open
return 'No valid RSS found';
Function processUrlAndFavicon
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const processUrlAndFavicon = async (rec) => {
let record = rec;
if (!hasTag(record.tags, LOCKED) && !hasTag(record.tags, ARCHIVE)) {
if (!hasTag(record.tags, BROKEN)) {
// nothing ;)
- 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 makeDateHumanreadble
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const makeDateHumanreadble = (date) => {
let d = date;
if (typeof d === 'string') {
d = new Date(d);
}
- 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 process
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
async process() {
try {
const user = await userDao.getByEmail(this.data.email);
if (user == null) {
ResponseUtil.sendErrorResponse(401, 'Wrong user or password!', this.res);
- 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 process
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
async process() {
const asyncWaitId = await this.loadAsyncWaitId();
try {
this.validate();
const $ = cheerio.load(this.data.bookmarks);
- 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 updateTagHierarchy
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export async function updateTagHierarchy(userid, tags, parent = 'root') {
/* eslint-disable no-constant-condition */
while (true) {
try {
/* eslint-disable no-await-in-loop */
- 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 purifyLink
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const purifyLink = (link) => {
const noTrailingSlash = str => (str.endsWith('/') ? str.substr(0, str.length - 1) : str);
const noHttpProtocol = str => (str.startsWith('http://') ? str.substr('http://'.length) : str);
const noHttpsProtocol = str => (str.startsWith('https://') ? str.substr('https://'.length) : str);
const noProtocol = str => noHttpsProtocol(noHttpProtocol(str));
- 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 updateObjectEndDrag
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const updateObjectEndDrag = (state, action) => {
if (!action.target) {
return {
dragInProgress: null,
};
- 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 getNextIndex
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const getNextIndex = (tagHierarchy, parent = 'root') => {
const sortedRootElements = tagHierarchy
.filter(e => e.parent === parent)
.sort((a, b) => (a.index < b.index ? 1 : (a.index === b.index ? 0 : -1)));
// Immutable classes don't have length. We expect a POJO [] here.
- 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 getNextIndex
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const getNextIndex = (state, parentTagName = 'root') => {
const sortedRootElements = state.tagHierarchy
.filter(e => e.parent === parentTagName)
.sort((a, b) => (a.index < b.index ? 1 : (a.index === b.index ? 0 : -1)));
if (sortedRootElements.size > 0) {
- 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"