Showing 270 of 337 total issues
Function renderPreferencesForm
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function renderPreferencesForm (subject, klass, preferencesForm, context) {
var prefContainer = context.dom.createElement('div')
pad.participationObject(subject, subject.doc(), context.me).then(
participation => {
const dom = context.dom
Function render
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render () {
const dropContainer = document.createElement('div')
dropContainer.style.maxWidth = '350px'
dropContainer.style.minHeight = '200px'
dropContainer.style.outline = '1px solid black'
Function syncTableToArray
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
Open
function syncTableToArray (table, things, createNewRow) {
let foundOne
let row
let 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 renderLiteralSelector
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function renderLiteralSelector (rows, columns, column) {
var result = doc.createElement('div')
var textBox = doc.createElement('input')
textBox.setAttribute('type', 'text')
AddAgentButtons
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
Open
export class AddAgentButtons {
private readonly rootElement: HTMLElement
private readonly barElement: HTMLElement
private isExpanded: boolean = false
Function loadPrevious
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async loadPrevious (date, backwards) {
const thisDateFolder = this
async function previousPeriod (file, level) {
function younger (x) {
if (backwards ? x.uri >= file.uri : x.uri <= file.uri) return false // later than we want or same -- looking for different
Function tryParent
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const tryParent = function (uri) {
if (uri.slice(-1) === '/') {
uri = uri.slice(0, -1)
}
const right = uri.lastIndexOf('/')
Function sentimentButton
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function sentimentButton (
context,
target,
icon,
actionClass,
Function refreshItem
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var refreshItem = function (box, x) {
// Scope to hold item and x
var item, image
var setStyle = function () {
Function consistencyCheck
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var consistencyCheck = function () {
var found = []
var failed = 0
function complain2 (msg) {
complain(msg)
Function dropListener
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var dropListener = function (e) {
if (e.preventDefault) e.preventDefault() // stops the browser from redirecting off to the text.
console.log('Drop event. dropEffect: ' + e.dataTransfer.dropEffect)
console.log(
'Drop event. types: ' +
Function firstLeaf
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async firstLeaf (backwards) {
// backwards -> last leafObject
var folderStore = $rdf.graph()
var folderFetcher = new $rdf.Fetcher(folderStore)
async function earliestSubfolder (parent) {
Function sync
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var sync = function () {
// var first = kb.the(subject, PAD('next'))
if (kb.each(subject, PAD('next')).length !== 1) {
var msg =
'Pad: Inconsistent data - NEXT pointers: ' +
Function signInOrSignUpBox
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function signInOrSignUpBox (
dom: HTMLDocument,
setUserCallback: (user: string) => void,
options: {
buttonStyle?: string
Function boxHandler
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var boxHandler = function (_e) {
tx.style = 'color: #bbb;' // grey -- not saved yet
var toDelete = input.state === true ? ins : input.state === false ? del : []
input.newState =
input.state === null
Function orderedSync
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var orderedSync = function () {
var items = getItems()
if (!vertical) {
// mainElement.setAttribute('colspan', items.length + (onClose ? 1 : 0))
}
Function deleteFolder
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports.deleteFolder = function (folder, store, dom) {
store = store || UI.store
if (typeof docuent !== 'undefined') {
dom = dom || document
}
Function onload
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
reader.onload = (function (theFile) {
return function (e) {
var data = e.target.result
var suffix = ''
console.log(' File read byteLength : ' + data.byteLength)
Function clearOldCells
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var clearOldCells = function () {
var row, cell
var colsUsed = []
var rowsUsed = []
Function syncTableToArrayReOrdered
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
Open
function syncTableToArrayReOrdered (table, things, createNewRow) {
const elementMap = {}
for (let i = 0; i < table.children.length; i++) {
const row = table.children[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"