Showing 270 of 337 total issues
Function ontologyLabel
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
function ontologyLabel (term) {
if (term.uri === undefined) return '??'
var s = term.uri
var namespaces = []
var i = s.lastIndexOf('#')
Function rowFor
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
var rowFor = function (y1) {
var y = y1.toNT()
if (rows[y]) return rows[y]
var tr = dom.createElement('tr')
var header = tr.appendChild(dom.createElement('td'))
Function findBookmarkDocument
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
export async function findBookmarkDocument (userContext) {
const klass = BOOK('Bookmark')
const fileTail = 'bookmarks.ttl'
const isPublic = true
Function msg
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
logger.msg = function (str, type, typestr) {
if (!type) {
type = TMESG
typestr = 'mesg'
}
Function recordParticipation
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
UI.pad.recordParticipation = function (subject, padDoc, refreshable) {
var me = UI.authn.currentUser()
if (!me) return // Not logged in
var parps = kb.each(subject, ns.wf('participation')).filter(function (pn) {
Function logInLoadProfile
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function logInLoadProfile (context: AuthenticationContext): Promise<AuthenticationContext> {
if (context.publicProfile) {
return Promise.resolve(context)
} // already done
const fetcher = kb.fetcher
Function shortName
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
function shortName (uri) {
let p = uri
if ('#/'.indexOf(p[p.length - 1]) >= 0) p = p.slice(0, -1)
const namespaces = []
for (const ns in this.prefixes) {
Function selectorPanelRefresh
has 10 arguments (exceeds 4 allowed). Consider refactoring. Open
list,
dom,
kb,
type,
predicate,
Function findBookmarkDocument
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export async function findBookmarkDocument (userContext) {
const klass = BOOK('Bookmark')
const fileTail = 'bookmarks.ttl'
const isPublic = true
- 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 getTerm
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function getTerm (target) {
var statementTr = target.parentNode
var st = statementTr ? statementTr.AJAR_statement : undefined
var className = st ? target.className : '' // if no st then it's necessary to use getAbout
- 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 findImageFromURI
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
buttons.findImageFromURI = function findImageFromURI (x) {
const iconDir = UI.icons.iconBase
// Special cases from URI scheme:
if (x.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 loadIndex
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
async function loadIndex (
context: AuthenticationContext,
predicate: $rdf.NamedNode,
isPublic: boolean
): Promise<AuthenticationContext> {
- 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 makeACLGraphbyCombo
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export function makeACLGraphbyCombo (
kb: $rdf.IndexedFormula,
x: $rdf.NamedNode,
byCombo: ComboList,
aclDoc: $rdf.NamedNode,
- 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 makeDescription
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
forms.makeDescription = 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 addNewTableIfNewDay
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
async function addNewTableIfNewDay (now) {
// let now = new Date()
// @@ Remove listener from previous table as it is now static
const newChatDocument = dateFolder.leafDocumentFromDate(now)
if (!newChatDocument.sameTerm(latest.messageTable.chatDocument)) {
Function makeDraggable
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
function makeDraggable (tr, obj) {
tr.setAttribute('draggable', 'true') // Stop the image being dragged instead - just the TR
tr.addEventListener(
'dragstart',
Function add
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
add (webId) {
return new Promise((resolve, reject) => {
kb.fetcher.nowOrWhenFetched(webId, (ok, err) => {
if (!ok) {
this.onGroupChanged(err)
Function shortDate
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
buttons.shortDate = function (str, noTime) {
if (!str) return '???'
var month = [
'Jan',
'Feb',
Function fileUploadButtonDiv
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
buttons.fileUploadButtonDiv = function fileUploadButtonDiv (
dom,
droppedFileHandler
) {
const div = dom.createElement('div')
Function findAddressBook
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
findAddressBook (typeIndex) {
return new Promise((resolve, reject) => {
kb.fetcher.nowOrWhenFetched(typeIndex, (ok, err) => {
if (!ok) {
return reject(err)