Showing 243 of 327 total issues
Function showBootstrap
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
var showBootstrap = function showBootstrap () {
var div = clearElement(naviMain)
div.appendChild(
UI.authn.newAppInstance(
dom,
Function label
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
label: function (subject, context) {
var kb = context.session.store
if (
!kb.anyStatementMatching(
subject,
Function outlineCollapse
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
function outlineCollapse (p, subject) {
var row = UI.utils.ancestor(p, 'TR')
row = UI.utils.ancestor(row.parentNode, 'TR') // two levels up
if (row) var statement = row.AJAR_statement
var level // find level (the enclosing TD)
Function render
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
render: function (subject, context) {
var dom = context.dom
var styleSheet =
'https://leemark.github.io/better-simple-slideshow/css/simple-slideshow-styles.css'
UI.widgets.addStyleSheet(dom, styleSheet)
Function getMembersAndSort
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
var getMembersAndSort = function (subject) {
var sortBy = getSortKey(subject)
var u, x, key
var uriHash = kb.findMemberURIs(subject)
var pairs = []
Function render
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
render: function (subject, context) {
var dom = context.dom
var filter = function (pred, inverse) {
if (
- 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 render
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
render: function (subject, context) {
const store = context.session.store
async function doRender (
container: HTMLElement,
- 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 addNewObject
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
addNewObject: function addNewObject (e) {
var predicateTd = UI.utils.getTarget(e).parentNode.parentNode
// var predicateTerm = UI.utils.getAbout(kb, predicateTd)
var isInverse = predicateTd.parentNode.AJAR_inverse
// var titleTerm=UI.utils.getAbout(kb,UI.utils.ancestor(predicateTd.parentNode,'TD'));
Function showBootstrap
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
var showBootstrap = function showBootstrap (
thisInstance: any,
container: HTMLElement,
noun: string
) {
Function showFiltered
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
var showFiltered = function (mode) {
var filtered = mode === 0 ? objects : getFiltered()
// eslint-enable
UI.widgets.selectorPanelRefresh(
objectList,
Function showContent
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
var showContent = async function () {
var homePaneContext = { div: div, dom: dom, statusArea: div, me: me }
/*
div.appendChild(dom.createElement('h4')).textContent = 'Login status'
var loginStatusDiv = div.appendChild(context.dom.createElement('div'))
Function doRender
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
async function doRender () {
const renderContext = await authn.logInLoadPreferences({
dom,
div: container
})
Consider simplifying this complex logical expression. Open
if (
obj.termType === 'NamedNode' ||
obj.termType === 'BlankNode' ||
(obj.termType === 'Literal' &&
obj.value.slice &&
Consider simplifying this complex logical expression. Open
if (
(subject.termType === 'NamedNode' &&
kb.updater.editable(UI.rdf.Util.uri.docpart(subject.uri), kb)) ||
(subject.termType === 'BlankNode' &&
kb.anyStatementMatching(subject) &&
Function createApplicationEntry
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function createApplicationEntry (
subject: NamedNode,
origin: NamedNode | null,
appModes: NamedNode[],
updateTable: () => void
- 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
if (enterEvent.keyCode === 37) {
setHighlightItem(menu.lastHighlight.previousSibling)
} else {
setHighlightItem(menu.lastHighlight.nextSibling)
}
Avoid deeply nested control flow statements. Open
if (d.paneButton) {
d.paneButton.setAttribute('class', 'paneHidden')
d.paneButton.style = paneHiddenStyle
}
Function render
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. 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
switch (menu.lastHighlight.value) {
case 'New...':
qp('subcase New')
outline.UserInput.createNew()
break
Avoid deeply nested control flow statements. Open
if (mode === 'JournalTAC') {
outline.UserInput.clearMenu()
qp('no lastH')
return 'no lastH'
}