Showing 243 of 327 total issues
Function saveQuery
has 35 lines of code (exceeds 25 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
Function appendToPredicate
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
appendToPredicate: function appendToPredicate (predicateTd) {
var isEnd = false
var trIterator
try {
for (
Function displayTheMatrix
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var displayTheMatrix = function () {
var matrix = div.appendChild(
UI.matrix.matrixForQuery(
dom,
query,
Function render
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function render (dom, main, statusArea): Promise<void> {
const authContext = await authn.logInLoadProfile({ dom: dom, div: main, statusArea: statusArea, me: null })
const subject = authContext.me as NamedNode
const profile = subject.doc()
Function mbconfirmFollow
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var mbconfirmFollow = function (uri, success, _msg) {
if (success === true) {
if (!that.Ifollow) {
// prevent duplicate entries from being added to kb (because that was happening)
if (
Function showDashboard
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function showDashboard (options = {}) {
const dashboardContainer = getDashboardContainer()
const outlineContainer = getOutlineContainer()
// reuse dashboard if already children already is inserted
if (dashboardContainer.childNodes.length > 0 && options.pane) {
Function render
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render: function (subject, context) {
const dom = context.dom
var showContent = async function () {
var homePaneContext = { div: div, dom: dom, statusArea: div, me: me }
/*
Function createApplicationTable
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function createApplicationTable (subject: NamedNode) {
const applicationsTable = createElement('table', {
class: 'results'
})
Function setSelectedParent
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function setSelectedParent (node, inc) {
var onIcon = outlineIcons.termWidgets.optOn
var offIcon = outlineIcons.termWidgets.optOff
for (var n = node; n.parentNode; n = n.parentNode) {
while (true) {
Function headerButtons
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var headerButtons = function (dom, labels, intial, callback) {
var head = dom.createElement('table')
var current = intial
head.setAttribute(
'style',
Function generateRequest
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
generateRequest: function generateRequest (
tipText,
trNew,
isPredicate,
notShow
Function getStatementsToDelete
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function getStatementsToDelete (
origin: NamedNode,
person: NamedNode,
kb: IndexedFormula,
ns: Namespaces
Function onDragEnter
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
Open
onDragEnter: function (e, _dragSession) {
// enter or exit something
try {
var selection = UI.utils.ancestor(
UI.utils.ancestor(e.originalTarget, 'TABLE').parentNode,
- 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 renderPane
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var renderPane = function (pane) {
var paneDiv
UI.log.info('outline: Rendering pane (2): ' + pane.name)
if (UI.no_catch_pane_errors) {
// for debugging
Function TabulatorMousedown
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function TabulatorMousedown (e) {
UI.log.info('@TabulatorMousedown, dom.location is now ' + dom.location)
var target = thisOutline.targetOf(e)
if (!target) return
var tname = target.tagName
Function isVideo
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function isVideo (src, _index) {
if (!src) {
return {
html5: true
}
Function cellFunction
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
options.cellFunction = function (cell, x, y, value) {
if (value !== null) {
kb.fetcher.nowOrWhenFetched(
value.uri.split('#')[0],
undefined,
Function streamView
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Pane.prototype.streamView = function (s, doc) {
var postContainer = doc.createElement('div')
postContainer.id = 'postContainer'
postContainer.className = 'post-container view-container active'
var mbPosts = []
Function calculations
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var calculations = function () {
var total = {}
var trans = kb.each(undefined, TRIP('trip'), subject)
// complain("@@ Number of transactions in this trip: " + trans.length);
trans.map(function (t) {
Function setAttachment
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var setAttachment = function (x, y, value, refresh) {
if (kb.holds(x, predicate, y) === value) return
var verb = value ? 'attach' : 'detach'
// complain("Info: starting to "+verb+" " + y.uri + " to "+x.uri+ ":\n")
var linkDone3 = function (uri, ok, body) {