Showing 270 of 337 total issues
Function makeSelectForCategory
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
forms.makeSelectForCategory = function (
dom,
kb,
subject,
category,
- 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 preventBrowserDropEvents
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export function preventBrowserDropEvents (document: HTMLDocument): void {
console.log('preventBrowserDropEvents called.')
const global: any = window
if (typeof global !== 'undefined') {
if (global.preventBrowserDropEventsDone) 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
Consider simplifying this complex logical expression. Open
if (
(y > ele.dataValueNT && options && options.yDecreasing) ||
(y < ele.dataValueNT && !(options && options.yDecreasing))
) {
return matrix.insertBefore(tr, ele) // return the tr
Function exports
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
module.exports = function (dom, kb, subject, messageStore, options) {
Function notepad
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
UI.pad.notepad = function (dom, padDoc, subject, me, options) {
Function renderMessage
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
messageTable,
bindings,
fresh,
options,
userContext
Function uploadFiles
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function uploadFiles (fetcher, files, fileBase, imageBase, successHandler) {
Function exports
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
module.exports = function (dom, kb, subject, messageStore, options) {
Function editFormButton
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
dom,
container,
form,
store,
callbackFunction
Function putACLbyCombo
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
kb: $rdf.IndexedFormula,
x: $rdf.NamedNode,
byCombo: ComboList,
aclDoc: $rdf.NamedNode,
callbackFunction: (ok: boolean, message?: string) => void
Function putACLObject
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
kb: $rdf.IndexedFormula,
x: $rdf.NamedNode,
ac: AgentMapMap,
aclDoc: $rdf.NamedNode,
callbackFunction
Function createIfNotExists
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
async function createIfNotExists (doc, contentType = 'text/turtle', data = '') {
const fetcher = UI.store.fetcher
try {
var response = await fetcher.load(doc)
} catch (err) {
- 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 participationObject
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
UI.pad.participationObject = function (subject, padDoc, me) {
return new Promise(function (resolve, reject) {
if (!me) {
throw new Error('Not user id')
}
- 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 stackString
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function stackString (e) {
let str = '' + e + '\n'
let i
if (!e.stack) {
return str + 'No stack available.\n'
- 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 faviconOrDefault
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
var faviconOrDefault = function (dom, x) {
var image = dom.createElement('img')
image.style = UI.style.iconStyle
var isOrigin = function (x) {
if (!x.uri) return false
- 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 propertyTriage
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
buttons.propertyTriage = function (kb) {
var possibleProperties = {}
// if (possibleProperties === undefined) possibleProperties = {}
// var kb = UI.store
var dp = {}
- 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 offlineTestID
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function offlineTestID (): $rdf.NamedNode | null {
const { $SolidTestEnvironment }: any = window
if (
typeof $SolidTestEnvironment !== 'undefined' &&
$SolidTestEnvironment.username
- 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 term.uri + '!?' // strange should have a nice part
Avoid too many return
statements within this function. Open
return term.value
Avoid too many return
statements within this function. Open
if (hash >= 0) return cleanUp(s.slice(hash + 1))