Showing 337 of 337 total issues
Function onload
has 48 lines of code (exceeds 25 allowed). Consider refactoring. 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
var clearOldCells = function () {
var row, cell
var colsUsed = []
var rowsUsed = []
Function syncTableToArrayReOrdered
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. 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"
Further reading
Function ontologyLabel
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
function ontologyLabel (term) {
if (term.uri === undefined) return '??'
var s = term.uri
var namespaces = []
var i = s.lastIndexOf('#')
- 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 newThingUI
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
function newThingUI (createContext, dataBrowserContext, thePanes) {
if (!thePanes) throw new Error('@@ newThingUI: update API') // phase out
const dom = createContext.dom
const div = createContext.div
if (createContext.me && !createContext.me.uri) {
- 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 basicField
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
function basicField (
dom,
container,
already,
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 promptForNew
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
forms.promptForNew = function (
dom,
kb,
subject,
predicate,
- 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 renderEnumSelector
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
function renderEnumSelector (rows, columns, column, list) {
var doMultiple = true
var result = doc.createElement('div')
var dropdown = doc.createElement('select')
Identical blocks of code found in 2 locations. Consider refactoring. Open
buttons.refreshTree = function refreshTree (root) {
if (root.refresh) {
root.refresh()
return
}
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 72.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Identical blocks of code found in 2 locations. Consider refactoring. Open
var refreshTree = function (root) {
if (root.refresh) {
root.refresh()
return
}
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 72.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Function makeIndexIfNecessary
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
async function makeIndexIfNecessary (context, isPublic) {
const relevant = isPublic ? context.publicProfile : context.preferencesFile
const visibility = isPublic ? 'public' : 'private'
async function putIndex (newIndex) {
Function sendMessage
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
var sendMessage = function () {
// titlefield.setAttribute('class','pendingedit')
// titlefield.disabled = true
field.setAttribute('class', 'pendingedit')
field.disabled = true
Function sendMessage
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
var sendMessage = function () {
// titlefield.setAttribute('class','pendingedit')
// titlefield.disabled = true
field.setAttribute('class', 'pendingedit')
field.disabled = true
Function findAgent
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
function findAgent (uri, kb): PartialAgentTriple | null {
const obj = sym(uri)
const types = kb.findTypeURIs(obj)
for (const ty in types) {
console.log(' drop object type includes: ' + ty)
Function createNewGroup
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
createNewGroup (book) {
const { groupIndex, groupContainer } = indexes(book)
const group = rdf.sym(
`${groupContainer.uri}${uuid.v4().slice(0, 8)}.ttl#this`
)
Function previousPeriod
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
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
return true
}
Function renderTableRowInto
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
function renderTableRowInto (tr, row, columns, _downstream) {
/* Link column, for linking to this subject. */
var linkTd = doc.createElement('td')
Function deleteButtonWithCheck
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
buttons.deleteButtonWithCheck = function (
dom,
container,
noun,
deleteFunction
Function findAppInstances
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
export async function findAppInstances (
context: AuthenticationContext,
klass: $rdf.NamedNode,
isPublic: boolean
): Promise<AuthenticationContext> {
Similar blocks of code found in 2 locations. Consider refactoring. Open
() => this.addAgent(ns.acl('AuthenticatedAgent').uri)
.then(() => this.groupList.controller.renderTemporaryStatus('Adding anyone logged in to those who can read. Drag the ID icon to a different level to give them more access.'))
.then(() => this.renderCleanup()))
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 69.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76