Showing 327 of 327 total issues
Function render
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
render: (subject, context) => {
const dom = context.dom
const store = context.session.store
function complainIfBad (ok: Boolean, mess: any) {
Function render
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
render: function (subject, context) {
const store = context.session.store
async function doRender (
container: HTMLElement,
Function render
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
render: function (subject, context) {
var myDocument = context.dom
function alternativeRendering () {
var sz = UI.rdf.Serializer(context.session.store)
Function appendAccessIcon
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.appendAccessIcon = function (node, uri) {
if (!uri) return ''
var docuri = UI.rdf.uri.docpart(uri)
if (docuri.slice(0, 5) !== 'http:') return ''
var state = sf.getState(docuri)
Function lsFollowUser
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
function lsFollowUser () {
var myUser = kb.sym(mb.getMyURI())
// var Ifollow = that.Ifollow
var username = that.creator.name
var mbconfirmFollow = function (uri, success, _msg) {
Function renderTrip
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
var renderTrip = function renderTrip (subject, thisDiv) {
var query = new $rdf.Query(UI.utils.label(subject))
var vars = ['date', 'transaction', 'comment', 'type', 'in_USD']
var v = {}
vars.map(function (x) {
Function mintNew
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
mintNew: function (context, newPaneOptions) {
var kb = context.session.store
var newInstance = newPaneOptions.newInstance
if (!newInstance) {
let uri = newPaneOptions.newBase
Function outlinePredicateTD
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.outlinePredicateTD = function outlinePredicateTD (
predicate,
newTr,
inverse,
internal
Function transactionTable
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
var transactionTable = function (dom, list, filter) {
var table = dom.createElement('table')
table.setAttribute(
'style',
'padding-left: 0.5em; padding-right: 0.5em; font-size: 9pt; width: 85%;'
Function render
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
function render () {
subject = kb.canon(subject)
if (!p || !p.parentNode || !p.parentNode.parentNode) return false
var newTable
Function addNewPredicateObject
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
addNewPredicateObject: function addNewPredicateObject (e) {
if (UI.utils.getTarget(e).className !== 'bottom-border-active') return
var This = outline.UserInput
var target = UI.utils.getTarget(e)
Function transactionTable
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
var transactionTable = function (dom, list) {
var table = dom.createElement('table')
table.setAttribute(
'style',
'margin-left: 100; font-size: 9pt; width: 85%;'
Function QuerySource
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
function QuerySource () {
/**
* stores all of the queries currently held by this source,
* indexed by ID number.
*/
Function literalModification
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
literalModification: function literalModification (selectedTd) {
UI.log.debug(
'entering literal Modification with ' +
selectedTd +
selectedTd.textContent
Function setSelected
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
function setSelected (node, newValue) {
// UI.log.info('selection has ' +selection.map(function(item){return item.textContent;}).join(', '));
// UI.log.debug('@outline setSelected, intended to '+(newValue?'select ':'deselect ')+node+node.textContent);
// if (newValue === selected(node)) return; //we might not need this anymore...
if (node.nodeName !== 'TD') {
Identical blocks of code found in 2 locations. Consider refactoring. Open
var expandAfterRowOrCollapse = function (
dom,
row,
subject,
paneName,
- 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 73.
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 expandAfterRowOrCollapse = function (
dom,
row,
subject,
paneName,
- 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 73.
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 displayFormsForRelation
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
var displayFormsForRelation = function displayFormsForRelation (
pred,
allowCreation
) {
var sts = kb.statementsMatching(subject, pred)
Function expand
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
function expand (uri) {
if (arguments[3]) return true // already fetched indicator
var cursubj = kb.canon(subject) // canonical identifier may have changed
UI.log.info(
'@@ expand: relevant subject=' +
Function pasteFromClipboard
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
pasteFromClipboard: function pasteFromClipboard (address, selectedTd) {
function termFrom (fromCode) {
var term = outline.clipboard[fromCode].shift()
if (term === null) {
UI.log.warn('no more element in clipboard!')