Showing 60 of 142 total issues
Function onImport
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
async onImport(docs) {
// docs contains all link-objects to be imported
docs.forEach((doc) => { this.counterLink(doc); });
// now this.allLinks contains all imported pureUrls/#
assert(this.allLinks.size < 2);
Function render
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
render() {
if (!this.props.selectedTag || this.props.tagHierarchy.size === 0) {
return null;
}
const cachedTagHierarchy = new CachedTagHierarchy(this.props.tagHierarchy);
- 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 getKeyContent
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
const getKeyContent = (content) => {
const currentFeedData = [];
if (!content) {
return 'No content found';
} else if (content['rdf:RDF']) {
- 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 getDisplayContent
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
const getDisplayContent = (content, newIds) => {
const currentFeedData = [];
if (!content) {
return 'No content found';
} else if (content['rdf:RDF']) {
- 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 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
async process() {
try {
const userInput = this.data.q;
// let luceneQuery = '';
// fields.forEach((f) => {
Function mapToNetscapeTree
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
const mapToNetscapeTree = (parentToElementMap, linklist) => {
if (!parentToElementMap.$$PARENT_OF_ROOT$$) {
return {};
}
const addChildren = (targetParent, sourceParent) => {
Function createRecord
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const createRecord = async (rec, userid) => {
const { url, rssUrl, tagsAsString, tagsAsArray, pageTitle, notes } = rec;
const fixedUrl = fixUrl(url);
const fixedRssUrl = fixUrl(rssUrl);
const fixedTags = Object.prototype.hasOwnProperty.call(rec, 'tagsAsString') ? getTags(tagsAsString) : getTagsFromArray(tagsAsArray);
Function process
has 27 lines of code (exceeds 25 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);
Function scrape
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
static async scrape(cachePath, url) {
const filename = CreateArchiveProcessor.getFilename(url);
// we need to store all content-types into the file `SCRAPED_MIME_TYPE_MAP`.
// see server/httpRoutes/archive.js at "FILE `SCRAPED_MIME_TYPE_MAP`"
const urlToContentTypeMap = new Map();
Function validateData
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
validateData() {
const usedNames = {};
const usedIndexs = {};
this.data.tree.forEach((treeElement) => {
if (usedNames[treeElement.name]) {
Function createDisplayElement
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
const createDisplayElement = (e) => {
const ele = {};
if (e.link) {
ele.link = '';
e.link.forEach((link) => {
Function matches
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const matches = (link, searchBarTerm, serverSide) => {
if (serverSide || !searchBarTerm) {
return true;
}
return link.linkUrl.toLowerCase().indexOf(searchBarTerm) > -1
- 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 editLink
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
export function editLink(id, url, tags, rssUrl, pageTitle, notes) {
Function createDisplayElement
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const createDisplayElement = (e) => {
const ele = {};
if (e.link) {
ele.link = '';
e.link.forEach((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 isValid
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
/* final */ isValid() {
const propertiesToValidate = this.propertiesToValidate();
const keysToValidate = Object.keys(propertiesToValidate);
for (let i = 0; i < keysToValidate.length; i += 1) {
const prop = propertiesToValidate[keysToValidate[i]];
- 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 updateLinkPost
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function updateLinkPost(id, linkUrl, tags, rssUrl, pageTitle, notes) {
Function persistLink
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
export function persistLink(linkId, url, tags, rssUrl, pageTitle, notes) {
Function updateUrl
has a Cognitive Complexity of 8 (exceeds 5 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);
- 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 mapToHierarchy
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const mapToHierarchy = (parentToElementMap) => {
const conv = (element) => {
/* eslint-disable no-nested-ternary */
const newElement = {
hierarchyLevelName: element.name,
- 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 reload
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function reload(name, ctx) {
//detect if they did require('require-reload')(require)
if (typeof name === 'function' && typeof name.cache === 'object') {
var func = reloadCtx.bind(null, name);
func.resolve = name.resolve;
- 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"