Showing 243 of 327 total issues
Function setACL
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var setACL = function setACL (
docURI: string,
allWrite: boolean,
callbackFunction: Function
) {
Function registerPanes
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function registerPanes (register) {
/* Note that the earliest panes have priority. So the most specific ones are first.
**
*/
// Developer designed:
Function propertyTable
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var propertyTable = (this.propertyTable = function propertyTable (
subject,
table,
pane,
options
Function label
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
label: function (subject, context) {
var kb = context.session.store
var ns = UI.ns
var allowed = [
// 'text/plain',
Function Event
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
dragAndDrop.util.Event = (function () {
var listeners = []
return {
on: function (el, sType, fn, obj, fnId /* ,override */) {
var wrappedFn = function (e) {
Function GotoSubject
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
this.GotoSubject = function (subject, expand, pane, solo, referrer, table) {
table = table || dom.getElementById('outline') // if does not exist just add one? nowhere to out it
if (solo) {
UI.utils.emptyNode(table)
table.style.width = '100%'
Function selectableTDClickListener
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function selectableTDClickListener (e) {
// Is we are in editing mode already
if (thisOutline.UserInput._tabulatorMode) {
return thisOutline.UserInput.Click(e)
}
Function deleteRecursive
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function deleteRecursive (kb: IndexedFormula, folder: NamedNode) {
const fetcher = (kb as any).fetcher
if (!fetcher) {
console.error('No fetcher available')
return
Function renderFormsFor
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var renderFormsFor = function (store, subject) {
kb.fetcher.nowOrWhenFetched(store.uri, subject, function (ok, body) {
if (!ok) return complain('Cannot load store ' + store.uri + ': ' + body)
// Render the forms
Function copyItem
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var fun = function copyItem (item: any) {
agenda.push(function () {
var newURI = newBase + item.local
console.log('Copying ' + base + item.local + ' to ' + newURI)
Function copyItem
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var fun = function copyItem (item) {
agenda.push(function () {
var newURI = newBase + item.local
console.log('Copying ' + base + item.local + ' to ' + newURI)
Function transactionRow
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var transactionRow = function (dom, x) {
var tr = dom.createElement('tr')
var setTRStyle = function (tr, account) {
// var mystyle = "padding: 0.5em 1.5em 1em 1.5em; "
Function createNewPadDataFile
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
agenda.push(function createNewPadDataFile () {
store.add(newInstance, ns.rdf('type'), PAD('Notepad'), newPadDoc)
// TODO @@ Remove casting of add
;(store.add as any)(
Function getPost
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Microblog.prototype.getPost = function (uri) {
var Post = {}
// date ----------
var postLink = new Date(kb.anyValue(uri, terms('created')))
var h = postLink.getHours()
Function getResults
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var getResults = function () {
fetcher.nowOrWhenFetched(resultsDoc.uri, (ok, body, response) => {
if (!ok) {
if (response.status === 404) {
// / Check explicitly for 404 error
Function mintNew
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
mintNew: function (context, newPaneOptions: any) {
const store = context.session.store
const updater = store.updater as UpdateManager
if (newPaneOptions.me && !newPaneOptions.me.uri) {
throw new Error('notepad mintNew: Invalid userid')
Function createDetailsFile
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
agenda.push(function createDetailsFile () {
kb.add(
newInstance,
ns.rdf('type'),
ns.sched('SchedulableEvent'),
Function transactionRow
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var transactionRow = function (dom, x) {
var tr = dom.createElement('tr')
var setTRStyle = function (tr, account) {
// var mystyle = "padding: 0.5em 1.5em 1em 1.5em; ";
Function saveQuery
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
Open
function saveQuery (selection, qs) {
// var qs = outline.qs // @@
var q = new UI.rdf.Query()
var n = selection.length
var i, sel, st, tr
- 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 12 (exceeds 5 allowed). Consider refactoring. Open
Open
render: function (subject, context) {
var dom = context.dom
var kb = context.session.store
var ns = UI.ns
- 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"