Showing 337 of 337 total issues
Function findAgent
has a Cognitive Complexity of 12 (exceeds 5 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)
- 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 comboToString
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export function comboToString (byCombo: ComboList): string {
let str = ''
for (const combo in byCombo) {
const modeURIs = combo.split('\n')
const initials = modeURIs
- 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 35 lines of code (exceeds 25 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')
}
Function reloadAndSync
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
var reloadAndSync = function () {
if (reloading) {
console.log(' Already reloading - stop')
return // once only needed
}
Function go
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
async function go () {
function yank () {
selectedMessageTable.selectedElement.scrollIntoView({ block: 'center' })
}
Function syncTableToArray
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
function syncTableToArray (table, things, createNewRow) {
let foundOne
let row
let i
Function askName
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
buttons.askName = function (dom, kb, container, predicate, klass, noun) {
// eslint-disable-next-line promise/param-names
return new Promise(function (resolve, _reject) {
var form = dom.createElement('div') // form is broken as HTML behaviour can resurface on js error
// classLabel = utils.label(ns.vcard('Individual'))
Function render
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
render () {
const container = document.createElement('div')
container.style.display = 'flex'
// TODO: take a look at UI.widgets.setName
Function getPreferencesForClass
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getPreferencesForClass (subject, klass, predicates, context) {
return new Promise(function (resolve, reject) {
recordSharedPreferences(subject, context).then(context => {
var sharedPreferences = context.sharedPreferences
if (context.me) {
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"