michielbdejong/solid-panes

View on GitHub

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)
      }
Severity: Major
Found in src/transaction/pane.js and 1 other location - About 1 hr to fix
src/transaction/period.js on lines 87..89

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

Further Reading

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:
Severity: Minor
Found in src/registerPanes.js - About 1 hr to fix

    Function propertyTable has 38 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      var propertyTable = (this.propertyTable = function propertyTable (
        subject,
        table,
        pane,
        options
    Severity: Minor
    Found in src/outline/manager.js - About 1 hr to fix

      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',
      Severity: Minor
      Found in src/dokieli/dokieliPane.js - About 1 hr to fix

        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) {
        Severity: Minor
        Found in src/outline/dragDrop.js - About 1 hr to fix

          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%'
          Severity: Minor
          Found in src/outline/manager.js - About 1 hr to fix

            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)
                }
            Severity: Minor
            Found in src/outline/manager.js - About 1 hr to fix

              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
              Severity: Minor
              Found in src/internal/internalPane.ts - About 1 hr to fix

                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
                Severity: Major
                Found in src/schedule/schedulePane.js and 1 other location - About 1 hr to fix
                src/schedule/schedulePane.js on lines 294..302

                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

                Further Reading

                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
                Severity: Major
                Found in src/schedule/schedulePane.js and 1 other location - About 1 hr to fix
                src/schedule/schedulePane.js on lines 284..292

                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

                Further Reading

                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
                Severity: Minor
                Found in src/form/pane.js - About 1 hr to fix

                  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)
                  
                  
                  Severity: Minor
                  Found in src/pad/padPane.ts - About 1 hr to fix

                    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)
                    
                    
                    Severity: Minor
                    Found in src/schedule/schedulePane.js - About 1 hr to fix

                      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; "
                      Severity: Minor
                      Found in src/transaction/pane.js - About 1 hr to fix

                        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)(
                        Severity: Minor
                        Found in src/pad/padPane.ts - About 1 hr to fix

                          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()
                          Severity: Minor
                          Found in src/microblogPane/microblogPane.js - About 1 hr to fix

                            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'
                            Severity: Major
                            Found in src/microblogPane/microblogPane.js and 1 other location - About 1 hr to fix
                            src/microblogPane/microblogPane.js on lines 1163..1169

                            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

                            Further Reading

                            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'
                            Severity: Major
                            Found in src/microblogPane/microblogPane.js and 1 other location - About 1 hr to fix
                            src/microblogPane/microblogPane.js on lines 1157..1163

                            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

                            Further Reading

                            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
                            Severity: Minor
                            Found in src/schedule/schedulePane.js - About 1 hr to fix

                              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')
                              Severity: Minor
                              Found in src/pad/padPane.ts - About 1 hr to fix
                                Severity
                                Category
                                Status
                                Source
                                Language