Showing 60 of 142 total issues
Function mainData
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function mainData(state = initialStateMainData, action) {
switch (action.type) {
case RESET:
return initialStateMainData;
case ADD_LINK:
Function render
has 79 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
if (!this.props.selectedTag || this.props.tagHierarchy.size === 0) {
return null;
}
const cachedTagHierarchy = new CachedTagHierarchy(this.props.tagHierarchy);
File links.js
has 273 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { actions } from 'react-redux-form';
import { push } from 'react-router-redux';
import assert from 'assert';
import BlueBirdPromise from 'bluebird';
Function leave
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
static async leave(req, res) {
if (req.cookies.authToken) {
const { target } = req.query;
const { authToken } = req.cookies;
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 process
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
async process() {
try {
const rec = await linkDao.getById(this.data.linkId);
if (!rec || !rec.rssUrl) {
this.res.send('ERROR. No rssUrl for this link.');
- 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 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
async process() {
try {
const file = `${properties.server.favicon.cachePath}/${this.data.linkid}`;
try {
await fs.stat(file);
Function updateAfterPersistLink
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
const updateAfterPersistLink = (responseUpdates, linkList, selectedTag, dispatch, successMsg) => {
if (responseUpdates.message) {
dispatch(setErrorMessage(responseUpdates.message));
} else {
const updateLink = (link) => {
- 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 processRefresh
has 56 lines of code (exceeds 25 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) {
Function resolveUrl
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
const resolveUrl = (url, pageTitle, locked) => new Promise((resolve, reject) => {
const httpGetCall = requestRaw.get({
url,
followAllRedirects: true,
timeout: 500,
Function process
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
async process() {
try {
const rec = await linkDao.getById(this.data.linkId);
if (!rec || !rec.rssUrl) {
this.res.send('ERROR. No rssUrl for this link.');
Function tagHierarchyData
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function tagHierarchyData(state = initialStateTagData, action) {
switch (action.type) {
case RESET:
return initialStateTagData;
case SET_TAG_HIERARCHY:
Function process
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
async process() {
const asyncWaitId = await this.loadAsyncWaitId();
try {
this.validate();
const $ = cheerio.load(this.data.bookmarks);
Function updateUrl
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
const updateUrl = async (rec) => {
const url = rec.linkUrl;
const host = getHostFromUrl(url);
if (excludedDomains.filter((e) => {
const indexOf = host.indexOf(e);
Function leave
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
static async leave(req, res) {
if (req.cookies.authToken) {
const { target } = req.query;
const { authToken } = req.cookies;
try {
Function visitorToken
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
const visitorToken = async (req, res) => {
if (req.cookies.vistorToken) {
const { vistorToken } = req.cookies;
winston.loggers.get('application').debug(`FetchComponentData::vistorToken = ${vistorToken}`);
const vistorRec = await visitorDao.getByVisitorId(vistorToken);
- 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 back
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
const back = async (req, res) => {
const { denied } = req.query;
if (denied) {
winston.loggers.get('application').debug('error: %j', req.query);
res.redirect('/');
Function updateObjectEndDrag
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
const updateObjectEndDrag = (state, action) => {
if (!action.target) {
return {
dragInProgress: null,
};
Function process
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
async process() {
try {
this.validate();
// update links
const rawRows = await linkDao.listByUseridAndTag(this.data.userid, this.data.oldTagName);
Function getKeyContent
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
const getKeyContent = (content) => {
const currentFeedData = [];
if (!content) {
return 'No content found';
} else if (content['rdf:RDF']) {
Function getDisplayContent
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
const getDisplayContent = (content, newIds) => {
const currentFeedData = [];
if (!content) {
return 'No content found';
} else if (content['rdf:RDF']) {