Showing 270 of 337 total issues
Function syncTableToArrayReOrdered
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
function syncTableToArrayReOrdered (table, things, createNewRow) {
const elementMap = {}
for (let i = 0; i < table.children.length; i++) {
const row = table.children[i]
Function propertyTriage
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
buttons.propertyTriage = function (kb) {
var possibleProperties = {}
// if (possibleProperties === undefined) possibleProperties = {}
// var kb = UI.store
var dp = {}
Function setACL
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function setACL (
docURI: $rdf.NamedNode,
aclText: string,
callbackFunction: (ok: boolean, message: string) => void
): void {
Function save
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public save (): Promise<void> {
const newAClGraph = graph()
if (!this.isContainer) {
makeACLGraphbyCombo(newAClGraph, this.targetDoc, this.mainCombo.byCombo, this.targetACLDoc, true)
} else if (this.defaultsCombo && this.defaultsDiffer) {
Function fixIndividualACL
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function fixIndividualACL (item: $rdf.NamedNode, subjects: Array<$rdf.NamedNode>, log: Function, callbackFunction: Function): void {
log = log || console.log
const doc = item.doc()
getACLorDefault(doc, function (
ok,
Function inferColumnsFromFormula
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
function inferColumnsFromFormula (columns, formula) {
UI.log.debug('>> processing formula')
for (let i = 0; i < formula.statements.length; ++i) {
var statement = formula.statements[i]
Function generateColumnAddDropdown
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
function generateColumnAddDropdown (type) {
var resultDiv = doc.createElement('div')
var unusedColumns = type.getUnusedColumns()
Function onResult
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
var onResult = function (values) {
if (!query.running) {
return
}
Function preventBrowserDropEvents
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function preventBrowserDropEvents (document: HTMLDocument): void {
console.log('preventBrowserDropEvents called.')
const global: any = window
if (typeof global !== 'undefined') {
if (global.preventBrowserDropEventsDone) return
Function selectorPanel
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
dom,
kb,
type,
predicate,
inverse,
Function setPartStyle
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
var setPartStyle = function (part, colors, pending) {
var chunk = part.subject
colors = colors || ''
var baseStyle =
'font-size: 100%; font-family: monospace; width: 100%; border: none; white-space: pre-wrap;'
Function firstLeaf
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
async firstLeaf (backwards) {
// backwards -> last leafObject
var folderStore = $rdf.graph()
var folderFetcher = new $rdf.Fetcher(folderStore)
async function earliestSubfolder (parent) {
- 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
public render (): HTMLElement {
this.rootElement.innerHTML = ''
if (this.isUsingDefaults) {
this.renderStatus(`The sharing for this ${this.noun} is the default for folder `)
if (this.defaultHolder) {
- 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 removeAgentFromCombos
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private removeAgentFromCombos (uri: string): void {
for (let k = 0; k < 16; k++) {
const combos = this.byCombo[kToCombo(k)]
if (combos) {
for (let i = 0; i < combos.length; i++) {
- 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 createIfNotExists
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
async function createIfNotExists (doc, contentType = 'text/turtle', data = '') {
const fetcher = UI.store.fetcher
try {
var response = await fetcher.load(doc)
} catch (err) {
Function button
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
async function (_event) {
if (action) {
await deleteThingThen(action)
action = null
setColor()
Function setACLUserPublic
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function setACLUserPublic (
docURI: $rdf.NamedNode,
me: $rdf.NamedNode,
options: {
defaultForNew?: boolean,
Function renderAppsButton
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
private renderAppsButton (): HTMLElement {
return widgets.button(
this.groupList.controller.dom,
`${icons.iconBase}noun_15177.svg`,
'A Web App (origin)',
Function personTR
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
buttons.personTR = function (dom, pred, obj, options) {
var tr = dom.createElement('tr')
options = options || {}
// tr.predObj = [pred.uri, obj.uri] moved to acl-control
var td1 = tr.appendChild(dom.createElement('td'))
Function patchPromises
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
const patchPromises = [group.doc(), groupIndex].map(doc => {
const typeStatement = rdf.st(
group,
ns.rdf('type'),
ns.vcard('Group'),