Showing 327 of 327 total issues
Function render
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
render: function (subject, context) {
var myDocument = context.dom
function alternativeRendering () {
var sz = UI.rdf.Serializer(context.session.store)
- 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 deeply nested control flow statements. Open
Open
switch (menu.lastHighlight.value) {
case 'New...':
qp('subcase New')
outline.UserInput.createNew()
break
Avoid deeply nested control flow statements. Open
Open
if (mode === 'JournalTAC') {
outline.UserInput.clearMenu()
qp('no lastH')
return 'no lastH'
}
Avoid deeply nested control flow statements. Open
Open
if (level === 1 || !options.chainAlbums) return resolve(null) // limit of navigating treee
Avoid deeply nested control flow statements. Open
Open
if (mode === 'JournalTAC') {
qp('movedArrow? ' + movedArrow)
// Enter only works if arrows have been moved
if (movedArrow && menu.lastHighlight) {
// Get the title from the DOM
Avoid deeply nested control flow statements. Open
Open
if (folder2) {
kb.fetcher.load(folder2).then(function (_xhr) {
var contents = kb.each(folder2, ns.ldp('contains'))
if (contents.length === 0) return resolve(null)
contents.sort()
Function Event
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
dragAndDrop.util.Event = (function () {
var listeners = []
return {
on: function (el, sType, fn, obj, fnId /* ,override */) {
var wrappedFn = function (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
Avoid deeply nested control flow statements. Open
Open
if (displayed >= show) {
trObj.style.display = 'none'
showLaterArray.push(trObj)
}
Avoid deeply nested control flow statements. Open
Open
if (ok) {
// dom.outlineManager.GotoSubject(newThing@@, true, undefined, true, undefined);
// rerender(box); // Deleted forms at the moment
} else {
complain('Sorry, failed to save your change:\n' + body)
Avoid deeply nested control flow statements. Open
Open
if (!isInverse) {
newStats = kb.statementsMatching(
stat.subject,
stat.predicate,
inputTerm,
Function GotoSubject
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
this.GotoSubject = function (subject, expand, pane, solo, referrer, table) {
Avoid deeply nested control flow statements. Open
Open
if (mutualFriends) {
for (let i = 0; i < mutualFriends.length; i++) {
tr.appendChild(
dom.createTextNode(', ' + UI.utils.label(mutualFriends[i]))
)
Avoid deeply nested control flow statements. Open
Open
if (l > 0) {
var r = uri.indexOf('/', l + 2)
var r2 = uri.lastIndexOf('.', r)
if (r2 > 0) r = r2
hostlabel = uri.slice(l + 2, r)
Avoid deeply nested control flow statements. Open
Open
if (
d.pane.requireQueryButton &&
t.parentNode.className /* outer table */ &&
numberOfPanesRequiringQueryButton === 1 &&
dom.getElementById('queryButton')
Avoid deeply nested control flow statements. Open
Open
if (kb.any(undefined, selectedPredicate, textTerm)) {
if (!e) {
// keyboard
var tdNode = this.lastModified.parentNode
e = {}
Function formUndetStat
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
trNode,
subject,
predicate,
object,
why,
Avoid deeply nested control flow statements. Open
Open
if (options.loop) {
return resolve(contents[j])
}
Avoid deeply nested control flow statements. Open
Open
if (!newStats.length) {
UI.log.error("userinput.js 1711: Can't find statememt!")
}
Avoid deeply nested control flow statements. Open
Open
for (i = 0; i < ny; i++) {
z = yearCategoryTotal[years[i]][types[j]]
cell = row.appendChild(numericCell(z, true))
}
Avoid deeply nested control flow statements. Open
Open
for (i = 0; i < ny; i++) {
z = yearTotal[years[i]]
cell = row.appendChild(numericCell(z ? d2(z) : ''))
}