Showing 327 of 327 total issues
Function viewAsBoringDefault
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
function viewAsBoringDefault (obj) {
// UI.log.debug('entered viewAsBoringDefault...');
var rep // representation in html
if (obj.termType === 'Literal') {
Function render
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
render: function (subject, context) {
var dom = context.dom
var outliner = context.getOutliner(dom)
var kb = context.session.store
var complain = function complain (message, color) {
Function objectTree
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
function objectTree (obj) {
var res, anchor
switch (obj.termType) {
case 'NamedNode':
anchor = myDocument.createElement('a')
Similar blocks of code found in 2 locations. Consider refactoring. Open
if (unclassifiedIn.length) {
tab = transactionTable(dom, unclassifiedIn)
count = tab.children.length
div.appendChild(dom.createElement('h3')).textContent =
'Unclassified Income' + (count < 4 ? '' : ' (' + count + ')')
- 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 91.
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
Similar blocks of code found in 2 locations. Consider refactoring. Open
if (unclassifiedOut.length) {
tab = transactionTable(dom, unclassifiedOut)
count = tab.children.length
div.appendChild(dom.createElement('h3')).textContent =
'Unclassified Outgoings' + (count < 4 ? '' : ' (' + count + ')')
- 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 91.
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 licenseOptions
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function licenseOptions () {
this.options = {}
this.references = []
this.checkedLicenses = []
Function licenseOptions
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function licenseOptions () {
this.options = {}
this.references = []
this.checkedLicenses = []
- 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 67 lines of code (exceeds 25 allowed). Consider refactoring. Open
render: function (subject, context) {
var dom = context.dom
var filter = function (pred, inverse) {
if (
Similar blocks of code found in 2 locations. Consider refactoring. Open
var mention = function mention (message, style) {
if (style === undefined) style = 'color: grey'
var pre = dom.createElement('pre')
pre.setAttribute('style', style)
div.appendChild(pre)
- 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 87.
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
Similar blocks of code found in 2 locations. Consider refactoring. Open
var complain = function complain (message, style) {
if (style === undefined) style = 'color: grey'
var pre = myDocument.createElement('pre')
pre.setAttribute('style', style)
div.appendChild(pre)
- 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 87.
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 DDM
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
dragAndDrop.util.DDM = (function DDM () {
return {
handleMouseDown: function (e, oDD) {
// this.currentTarget = dragAndDrop.util.Event.getTarget(e)
- 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 19 (exceeds 5 allowed). Consider refactoring. Open
render: function (subject, context) {
const myDocument = context.dom
function isVideo (src, _index) {
if (!src) {
return {
- 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 19 (exceeds 5 allowed). Consider refactoring. Open
render: function (subject, context) {
var dom = context.dom
var outliner = context.getOutliner(dom)
var kb = context.session.store
var complain = function complain (message, color) {
- 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 boxHandler
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
var boxHandler = function (_e) {
tx.className = 'pendingedit'
// alert('Should be greyed out')
if (this.checked) {
// Add link
Function getDashboardItems
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
async function getDashboardItems () {
const me = UI.authn.currentUser()
const div = dom.createElement('div')
const [books, pods] = await Promise.all([getAddressBooks(), getPods()])
return [
Function walk
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.walk = function walk (directionCode, inputTd) {
var selectedTd = inputTd || selection[0]
var newSelTd
switch (directionCode) {
case 'down':
Function lsCreateNewMB
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
var lsCreateNewMB = function (_evt) {
// disable the create new microblog button.
// then prefills the information.
xcreateNewMB.disabled = true
var xcmb = doc.createElement('div')
Function triageFriends
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
function triageFriends (s) {
outgoing = kb.each(s, foaf('knows'))
incoming = kb.each(undefined, foaf('knows'), s) // @@ have to load the friends
var confirmed = []
var unconfirmed = []
Function DDM
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
dragAndDrop.util.DDM = (function DDM () {
return {
handleMouseDown: function (e, oDD) {
// this.currentTarget = dragAndDrop.util.Event.getTarget(e)
Function label
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
label: function (subject, context) {
var kb = context.session.store
if (
!kb.anyStatementMatching(
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"