Showing 327 of 327 total issues
Function createDetailsFile
has 36 lines of code (exceeds 25 allowed). Consider refactoring. 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
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
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
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"
Further reading
Function saveQuery
has 35 lines of code (exceeds 25 allowed). Consider refactoring. 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
appendToPredicate: function appendToPredicate (predicateTd) {
var isEnd = false
var trIterator
try {
for (
Function displayTheMatrix
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
var displayTheMatrix = function () {
var matrix = div.appendChild(
UI.matrix.matrixForQuery(
dom,
query,
Similar blocks of code found in 2 locations. Consider refactoring. Open
if (
kb.whether(creators[c], RDF('type'), SIOC('User')) &&
kb.whether(
kb.any(creators[c], SIOC('creator_of')),
RDF('type'),
- 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 63.
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 (
kb.whether(accounts[a], RDF('type'), SIOC('User')) &&
kb.whether(
kb.any(accounts[a], SIOC('creator_of')),
RDF('type'),
- 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 63.
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 render
has 34 lines of code (exceeds 25 allowed). Consider refactoring. 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
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 (
Identical blocks of code found in 2 locations. Consider refactoring. Open
function showURI (about) {
if (about && dom.getElementById('UserURI')) {
dom.getElementById('UserURI').value =
about.termType === 'NamedNode' ? about.uri : '' // blank if no URI
}
- 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 62.
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
this.showURI = function showURI (about) {
if (about && dom.getElementById('UserURI')) {
dom.getElementById('UserURI').value =
about.termType === 'NamedNode' ? about.uri : '' // blank if no URI
}
- 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 62.
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 showDashboard
has 33 lines of code (exceeds 25 allowed). Consider refactoring. 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
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
export function createApplicationTable (subject: NamedNode) {
const applicationsTable = createElement('table', {
class: 'results'
})
Function setSelectedParent
has 32 lines of code (exceeds 25 allowed). Consider refactoring. 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
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
generateRequest: function generateRequest (
tipText,
trNew,
isPredicate,
notShow
Function getStatementsToDelete
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function getStatementsToDelete (
origin: NamedNode,
person: NamedNode,
kb: IndexedFormula,
ns: Namespaces