michielbdejong/solid-panes

View on GitHub

Showing 243 of 327 total issues

Function setACL has 40 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    var setACL = function setACL (
      docURI: string,
      allWrite: boolean,
      callbackFunction: Function
    ) {
Severity: Minor
Found in src/pad/padPane.ts - About 1 hr to fix

    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

                  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

                              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

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

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

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

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

                                      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

                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language