Showing 270 of 337 total issues
Function SubjectType
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function SubjectType (type) {
this.type = type
this.columns = null
this.allColumns = null
this.useCount = 0
Function renderNumberSelector
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function renderNumberSelector (rows, columns, column) {
var result = doc.createElement('div')
var minSelector = doc.createElement('input')
minSelector.setAttribute('type', 'text')
Function renderValue
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function renderValue (obj, column) {
// hint
var hints = getHints(column)
var cellFormat = hints.cellFormat
if (cellFormat) {
Function adoptACLDefault
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function adoptACLDefault (
doc: $rdf.NamedNode,
aclDoc: $rdf.NamedNode,
defaultResource: $rdf.NamedNode,
defaultACLdoc: $rdf.NamedNode
Function removePart
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var removePart = function (part) {
var chunk = part.subject
if (!chunk) throw new Error('No chunk for line to be deleted!') // just in case
var prev = kb.any(undefined, PAD('next'), chunk)
var next = kb.any(chunk, PAD('next'))
Function loadIndex
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function loadIndex (
context: AuthenticationContext,
predicate: $rdf.NamedNode,
isPublic: boolean
): Promise<AuthenticationContext> {
Function renderPartipants
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
UI.pad.renderPartipants = function (dom, table, padDoc, subject, me, options) {
table.setAttribute('style', 'margin: 0.8em;')
var newRowForParticpation = function (parp) {
var person = kb.any(parp, ns.wf('participant'))
Function getACL
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function getACL (
doc: $rdf.NamedNode,
callbackFunction: (
ok: boolean,
messageOrStatus: number | string,
Function createIfNotExists
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function createIfNotExists (doc) {
return new Promise(function (resolve, reject) {
kb.fetcher.load(doc).then(
response => {
console.log('createIfNotExists doc exists, all good ' + doc)
Function syncMessages
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function syncMessages (about, messageTable) {
var displayed = {}
var ele, ele2
for (ele = messageTable.firstChild; ele; ele = ele.nextSibling) {
if (ele.AJAR_subject) {
Function makeNewSlot
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var makeNewSlot = function (item) {
var ele = dom.createElement(tabElement)
ele.subject = item
var div = ele.appendChild(dom.createElement('div'))
div.setAttribute('style', unselectedStyle)
Function findAgent
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
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
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
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
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
Open
async function go () {
function yank () {
selectedMessageTable.selectedElement.scrollIntoView({ block: 'center' })
}
Function syncTableToArray
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
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
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
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) {