Showing 243 of 327 total issues
Function header
has 335 lines of code (exceeds 25 allowed). Consider refactoring. Open
Pane.prototype.header = function (s, doc) {
var that = this
function lsFollowUser () {
var myUser = kb.sym(mb.getMyURI())
// var Ifollow = that.Ifollow
Function render
has a Cognitive Complexity of 74 (exceeds 5 allowed). Consider refactoring. Open
render: function (subject, context) {
const dom = context.dom
var kb = context.session.store
var ns = UI.ns
var invitation = subject
- 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 274 lines of code (exceeds 25 allowed). Consider refactoring. Open
render: function (subject, context) {
const dom = context.dom
var kb = context.session.store
var ns = UI.ns
Function generatePost
has 253 lines of code (exceeds 25 allowed). Consider refactoring. Open
Pane.prototype.generatePost = function (post, _me) {
/*
generatePost - Creates and formats microblog posts
post - symbol of the uri the post in question
*/
Function renderPeriod
has 245 lines of code (exceeds 25 allowed). Consider refactoring. Open
var renderPeriod = function () {
var dtstart = kb.any(subject, ns.cal('dtstart'))
if (dtstart === undefined) {
complain(
'(Error: There is no start date known for this period <' +
Function clearInputAndSave
has 242 lines of code (exceeds 25 allowed). Consider refactoring. Open
clearInputAndSave: function clearInputAndSave (e) {
if (!this.lastModified) return
if (!this.lastModified.isNew) {
try {
var obj = this.getStatementAbout(this.lastModified).object
Function render
has a Cognitive Complexity of 60 (exceeds 5 allowed). Consider refactoring. Open
render: function (subject, context, paneOptions: any) {
const dom = context.dom
const store = context.session.store
// Utility functions
var complainIfBad = function (ok: boolean, message: string) {
- 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 mintNew
has 227 lines of code (exceeds 25 allowed). Consider refactoring. Open
mintNew: function (context, options) {
return new Promise(function (resolve, reject) {
var ns = UI.ns
var kb = context.session.store
var newBase = options.newBase
Function render
has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring. Open
render: function (subject, context) {
const kb = context.session.store
const dom = context.dom
var mention = function complain (message, style) {
- 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 showResults
has 192 lines of code (exceeds 25 allowed). Consider refactoring. Open
var showResults = function () {
// Now the form for responsing to the poll
//
// div.appendChild(dom.createElement('hr'))
Function getAutoCompleteHandler
has 191 lines of code (exceeds 25 allowed). Consider refactoring. Open
getAutoCompleteHandler: function getAutoCompleteHandler (mode) {
qp('\n\n***** In getAutoCompleteHandler ****** mode = ' + mode)
if (mode === 'PredicateAutoComplete') {
mode = 'predicate'
} else if (mode !== 'JournalTAC') {
File pane.js
has 485 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* Financial Transaction Pane
**
** This outline pane allows a user to interact with a transaction
** downloaded from a bank statement, annotting it with classes and comments,
** trips, etc
Function appendPropertyTRs
has 178 lines of code (exceeds 25 allowed). Consider refactoring. Open
function appendPropertyTRs (parent, plist, inverse, predicateFilter) {
// UI.log.info('@appendPropertyTRs, 'this' is %s, dom is %s, '+ // Gives 'can't access dead object'
// 'thisOutline.document is %s', this, dom.location, thisOutline.document.location);
// UI.log.info('@appendPropertyTRs, dom is now ' + this.document.location);
// UI.log.info('@appendPropertyTRs, dom is now ' + thisOutline.document.location);
Function render
has 177 lines of code (exceeds 25 allowed). Consider refactoring. Open
render: function (subject, context) {
const dom = context.dom
const store = context.session.store
const canonizedSubject = store.canon(subject)
const types = store.findTypeURIs(canonizedSubject)
Function showForms
has 172 lines of code (exceeds 25 allowed). Consider refactoring. Open
var showForms = function () {
clearElement(naviCenter) // Remove refresh button if nec
var div = naviMain
var wizard = true
var currentSlide = 0
Function statementsAsTables
has 164 lines of code (exceeds 25 allowed). Consider refactoring. Open
statementsAsTables: function statementsAsTables (sts, context, initialRoots) {
var myDocument = context.dom
// var outliner = context.getOutliner(myDocument)
var rep = myDocument.createElement('table')
var sz = UI.rdf.Serializer(context.session.store)
Function render
has 162 lines of code (exceeds 25 allowed). Consider refactoring. Open
render: function (subject, context) {
var dom = context.dom
var kb = context.session.store
var ns = UI.ns
Function expandedHeaderTR
has 162 lines of code (exceeds 25 allowed). Consider refactoring. Open
async function expandedHeaderTR (subject, requiredPane, options) {
async function renderPaneIconTray (td, options = {}) {
const paneShownStyle =
'width: 24px; border-radius: 0.5em; border-top: solid #222 1px; border-left: solid #222 0.1em; border-bottom: solid #eee 0.1em; border-right: solid #eee 0.1em; margin-left: 1em; padding: 3px; background-color: #ffd;'
const paneHiddenStyle =
Function outlineExpand
has 158 lines of code (exceeds 25 allowed). Consider refactoring. Open
function outlineExpand (p, subject1, options) {
options = options || {}
var pane = options.pane
var already = !!options.already
var immediate = options.immediate
Function fillInRequest
has 156 lines of code (exceeds 25 allowed). Consider refactoring. Open
fillInRequest: function fillInRequest (type, selectedTd, inputTerm) {
var tr = selectedTd.parentNode
var stat
var isInverse
stat = tr.AJAR_statement