Showing 327 of 327 total issues
Similar blocks of code found in 2 locations. Consider refactoring. Open
if (s.indexOf('.') >= 0) {
return s.split('.')[0] + '.' + (s.split('.')[1] + '00').slice(0, 2)
}
- 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 67.
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 registerPanes
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function registerPanes (register) {
/* Note that the earliest panes have priority. So the most specific ones are first.
**
*/
// Developer designed:
Function propertyTable
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
var propertyTable = (this.propertyTable = function propertyTable (
subject,
table,
pane,
options
Function label
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
label: function (subject, context) {
var kb = context.session.store
var ns = UI.ns
var allowed = [
// 'text/plain',
Function Event
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
dragAndDrop.util.Event = (function () {
var listeners = []
return {
on: function (el, sType, fn, obj, fnId /* ,override */) {
var wrappedFn = function (e) {
Function GotoSubject
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
this.GotoSubject = function (subject, expand, pane, solo, referrer, table) {
table = table || dom.getElementById('outline') // if does not exist just add one? nowhere to out it
if (solo) {
UI.utils.emptyNode(table)
table.style.width = '100%'
Function selectableTDClickListener
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
function selectableTDClickListener (e) {
// Is we are in editing mode already
if (thisOutline.UserInput._tabulatorMode) {
return thisOutline.UserInput.Click(e)
}
Function deleteRecursive
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
function deleteRecursive (kb: IndexedFormula, folder: NamedNode) {
const fetcher = (kb as any).fetcher
if (!fetcher) {
console.error('No fetcher available')
return
Similar blocks of code found in 2 locations. Consider refactoring. Open
agenda.push(function () {
setACL2(newResultsDoc.uri, true, function (ok, body) {
complainIfBad(
ok,
'Failed to set Read-Write ACL on results file: ' + body
- 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 65.
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
agenda.push(function () {
setACL2(newDetailsDoc.uri, false, function (ok, body) {
complainIfBad(
ok,
'Failed to set read ACL on configuration file: ' + body
- 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 65.
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 renderFormsFor
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
var renderFormsFor = function (store, subject) {
kb.fetcher.nowOrWhenFetched(store.uri, subject, function (ok, body) {
if (!ok) return complain('Cannot load store ' + store.uri + ': ' + body)
// Render the forms
Function copyItem
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
var fun = function copyItem (item: any) {
agenda.push(function () {
var newURI = newBase + item.local
console.log('Copying ' + base + item.local + ' to ' + newURI)
Function copyItem
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
var fun = function copyItem (item) {
agenda.push(function () {
var newURI = newBase + item.local
console.log('Copying ' + base + item.local + ' to ' + newURI)
Function transactionRow
has 37 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 createNewPadDataFile
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
agenda.push(function createNewPadDataFile () {
store.add(newInstance, ns.rdf('type'), PAD('Notepad'), newPadDoc)
// TODO @@ Remove casting of add
;(store.add as any)(
Function getPost
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Microblog.prototype.getPost = function (uri) {
var Post = {}
// date ----------
var postLink = new Date(kb.anyValue(uri, terms('created')))
var h = postLink.getHours()
Similar blocks of code found in 2 locations. Consider refactoring. Open
if (mb.getMyURI() !== themaker.uri) {
var xreplyButton = doc.createElement('input')
xreplyButton.type = 'button'
xreplyButton.value = 'reply'
xreplyButton.className = 'reply'
- 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 64.
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
} else {
var xdeleteButton = doc.createElement('input')
xdeleteButton.type = 'button'
xdeleteButton.value = 'Delete'
xdeleteButton.className = 'reply'
- 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 64.
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 getResults
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
var getResults = function () {
fetcher.nowOrWhenFetched(resultsDoc.uri, (ok, body, response) => {
if (!ok) {
if (response.status === 404) {
// / Check explicitly for 404 error
Function mintNew
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
mintNew: function (context, newPaneOptions: any) {
const store = context.session.store
const updater = store.updater as UpdateManager
if (newPaneOptions.me && !newPaneOptions.me.uri) {
throw new Error('notepad mintNew: Invalid userid')