Showing 270 of 337 total issues
Function ontologyLabel
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
function ontologyLabel (term) {
if (term.uri === undefined) return '??'
var s = term.uri
var namespaces = []
var i = s.lastIndexOf('#')
- 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 newThingUI
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
function newThingUI (createContext, dataBrowserContext, thePanes) {
if (!thePanes) throw new Error('@@ newThingUI: update API') // phase out
const dom = createContext.dom
const div = createContext.div
if (createContext.me && !createContext.me.uri) {
- 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 basicField
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
function basicField (
dom,
container,
already,
subject,
- 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 promptForNew
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
forms.promptForNew = function (
dom,
kb,
subject,
predicate,
- 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 renderEnumSelector
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
function renderEnumSelector (rows, columns, column, list) {
var doMultiple = true
var result = doc.createElement('div')
var dropdown = doc.createElement('select')
Function makeIndexIfNecessary
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
async function makeIndexIfNecessary (context, isPublic) {
const relevant = isPublic ? context.publicProfile : context.preferencesFile
const visibility = isPublic ? 'public' : 'private'
async function putIndex (newIndex) {
Function sendMessage
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
var sendMessage = function () {
// titlefield.setAttribute('class','pendingedit')
// titlefield.disabled = true
field.setAttribute('class', 'pendingedit')
field.disabled = true
Function sendMessage
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
var sendMessage = function () {
// titlefield.setAttribute('class','pendingedit')
// titlefield.disabled = true
field.setAttribute('class', 'pendingedit')
field.disabled = true
Function findAgent
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
function findAgent (uri, kb): PartialAgentTriple | null {
const obj = sym(uri)
const types = kb.findTypeURIs(obj)
for (const ty in types) {
console.log(' drop object type includes: ' + ty)
Function createNewGroup
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
createNewGroup (book) {
const { groupIndex, groupContainer } = indexes(book)
const group = rdf.sym(
`${groupContainer.uri}${uuid.v4().slice(0, 8)}.ttl#this`
)
Function previousPeriod
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
async function previousPeriod (file, level) {
function younger (x) {
if (backwards ? x.uri >= file.uri : x.uri <= file.uri) return false // later than we want or same -- looking for different
return true
}
Function renderTableRowInto
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
function renderTableRowInto (tr, row, columns, _downstream) {
/* Link column, for linking to this subject. */
var linkTd = doc.createElement('td')
Function deleteButtonWithCheck
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
buttons.deleteButtonWithCheck = function (
dom,
container,
noun,
deleteFunction
Function findAppInstances
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
export async function findAppInstances (
context: AuthenticationContext,
klass: $rdf.NamedNode,
isPublic: boolean
): Promise<AuthenticationContext> {
Function columnNumberFor
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
var columnNumberFor = function (x1) {
var xNT = x1.toNT() // xNT is a NT string
var col = null
// These are data columns (not headings)
for (var i = 0; i < columns.length; i++) {
Function registrationList
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function registrationList (context: AuthenticationContext, options: {
private?: boolean
public?: boolean
}): Promise<AuthenticationContext> {
const dom = context.dom as HTMLDocument
Function makeSelectForCategory
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
forms.makeSelectForCategory = function (
dom,
kb,
subject,
category,
Function loadMoreWhereNeeded
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
async function loadMoreWhereNeeded (event, fixScroll) {
if (lock) return
lock = true
const freeze = !fixScroll
const magicZone = 150
Function makeSelectForNestedCategory
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
forms.makeSelectForNestedCategory = function (
dom,
kb,
subject,
category,
Function selectorPanelRefresh
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
buttons.selectorPanelRefresh = function (
list,
dom,
kb,
type,
- 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"