Showing 270 of 337 total issues
Function registrationControl
has 78 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function registrationControl (
context: AuthenticationContext,
instance,
klass
): Promise<AuthenticationContext | void> {
Function sameACL
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
Open
export function sameACL (a: AgentMapMap, b: AgentMapMap): boolean {
const contains = function (a, b) {
for (const pred in {
agent: true,
agentClass: 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 label
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function label (x, initialCap) {
// x is an object
function doCap (s) {
// s = s.toString()
if (initialCap) return s.slice(0, 1).toUpperCase() + s.slice(1)
Function renderMessage
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var renderMessage = function (bindings, fresh) {
var creator = bindings['?creator']
var message = bindings['?msg']
var date = bindings['?date']
var content = bindings['?content']
Function renderMessage
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var renderMessage = function (bindings, fresh) {
var creator = bindings['?creator']
var message = bindings['?msg']
var date = bindings['?date']
var content = bindings['?content']
Function logInLoadPreferences
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function logInLoadPreferences (context: AuthenticationContext): Promise<AuthenticationContext> {
if (context.preferencesFile) return Promise.resolve(context) // already done
const statusArea = context.statusArea || context.div || null
let progressDisplay
Function updateStore
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var updateStore = function (part) {
var chunk = part.subject
setPartStyle(part, undefined, true)
var old = kb.any(chunk, ns.sioc('content')).value
var del = [$rdf.st(chunk, ns.sioc('content'), old, padDoc)]
Function callbackWS
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function callbackWS (ws, newBase) {
UI.authn.logInLoadProfile(createContext).then(
_context => {
var newPaneOptions = {
newBase: newBase,
Function attachmentList
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
buttons.attachmentList = function (dom, subject, div, options) {
options = options || {}
var doc = options.doc || subject.doc()
if (options.modify === undefined) options.modify = true
var modify = options.modify
Function runQuery
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function runQuery (query, rows, columns, table) {
query.running = true
var startTime = Date.now()
var progressMessage = doc.createElement('tr')
Function render
has 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render () {
const container = document.createElement('div')
container.style.maxWidth = '350px'
container.style.minHeight = '200px'
container.style.outline = '1px solid black'
Function recordPersonalDefaults
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function recordPersonalDefaults (klass, context) {
return new Promise(function (resolve, reject) {
authn.logInLoadPreferences(context).then(
context => {
if (!context.preferencesFile) {
Function newChunk
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var newChunk = function (ele, before) {
// element of chunk being split
var kb = UI.store
var indent = 0
var queueProperty = null
Function uploadFiles
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function uploadFiles (fetcher, files, fileBase, imageBase, successHandler) {
for (var i = 0; files[i]; i++) {
const f = files[i]
console.log(
' dropped: Filename: ' +
Function promptForNew
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
forms.promptForNew = function (
dom,
kb,
subject,
predicate,
Function selectorPanelRefresh
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
buttons.selectorPanelRefresh = function (
list,
dom,
kb,
type,
Function sendMessage
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function sendMessage (text) {
var now = new Date()
await addNewTableIfNewDay(now)
if (!text) {
Function ensureOneTypeIndex
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function ensureOneTypeIndex (context: AuthenticationContext, isPublic: boolean): Promise<AuthenticationContext | void> {
async function makeIndexIfNecessary (context, isPublic) {
const relevant = isPublic ? context.publicProfile : context.preferencesFile
const visibility = isPublic ? 'public' : 'private'
Function wrapper
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
Open
var wrapper = function () {
var logger = {}
// /////////////////////// Logging
//
- 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 turnOnInput
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function turnOnInput () {
if (options.menuHandler && menuButton) {
const menuOptions = {
me,
dom,