michielbdejong/solid-panes

View on GitHub

Showing 243 of 327 total issues

Avoid deeply nested control flow statements.
Open

                  if (level === 1 || !options.chainAlbums) return resolve(null) // limit of navigating treee
Severity: Major
Found in src/audio/audioPane.js - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                      if (mode === 'JournalTAC') {
                        qp('movedArrow? ' + movedArrow)
                        // Enter only works if arrows have been moved
                        if (movedArrow && menu.lastHighlight) {
                          // Get the title from the DOM
    Severity: Major
    Found in src/outline/userInput.js - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                          if (folder2) {
                            kb.fetcher.load(folder2).then(function (_xhr) {
                              var contents = kb.each(folder2, ns.ldp('contains'))
                              if (contents.length === 0) return resolve(null)
                              contents.sort()
      Severity: Major
      Found in src/audio/audioPane.js - About 45 mins to fix

        Function Event has a Cognitive Complexity of 8 (exceeds 5 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 45 mins 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

        Avoid deeply nested control flow statements.
        Open

                      if (displayed >= show) {
                        trObj.style.display = 'none'
                        showLaterArray.push(trObj)
                      }
        Severity: Major
        Found in src/outline/manager.js - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                if (ok) {
                                  // dom.outlineManager.GotoSubject(newThing@@, true, undefined, true, undefined);
                                  // rerender(box);   // Deleted forms at the moment
                                } else {
                                  complain('Sorry, failed to save your change:\n' + body)
          Severity: Major
          Found in src/ui/pane.js - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                            if (!isInverse) {
                              newStats = kb.statementsMatching(
                                stat.subject,
                                stat.predicate,
                                inputTerm,
            Severity: Major
            Found in src/outline/userInput.js - About 45 mins to fix

              Function GotoSubject has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                this.GotoSubject = function (subject, expand, pane, solo, referrer, table) {
              Severity: Minor
              Found in src/outline/manager.js - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                            if (mutualFriends) {
                              for (let i = 0; i < mutualFriends.length; i++) {
                                tr.appendChild(
                                  dom.createTextNode(',  ' + UI.utils.label(mutualFriends[i]))
                                )
                Severity: Major
                Found in src/socialPane.js - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                              if (l > 0) {
                                var r = uri.indexOf('/', l + 2)
                                var r2 = uri.lastIndexOf('.', r)
                                if (r2 > 0) r = r2
                                hostlabel = uri.slice(l + 2, r)
                  Severity: Major
                  Found in src/socialPane.js - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                            if (
                                              d.pane.requireQueryButton &&
                                              t.parentNode.className /* outer table */ &&
                                              numberOfPanesRequiringQueryButton === 1 &&
                                              dom.getElementById('queryButton')
                    Severity: Major
                    Found in src/outline/manager.js - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                      if (kb.any(undefined, selectedPredicate, textTerm)) {
                                        if (!e) {
                                          // keyboard
                                          var tdNode = this.lastModified.parentNode
                                          e = {}
                      Severity: Major
                      Found in src/outline/userInput.js - About 45 mins to fix

                        Function formUndetStat has 6 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                              trNode,
                              subject,
                              predicate,
                              object,
                              why,
                        Severity: Minor
                        Found in src/outline/userInput.js - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                            if (options.loop) {
                                              return resolve(contents[j])
                                            }
                          Severity: Major
                          Found in src/audio/audioPane.js - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                            if (!newStats.length) {
                                              UI.log.error("userinput.js 1711: Can't find statememt!")
                                            }
                            Severity: Major
                            Found in src/outline/userInput.js - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                              for (i = 0; i < ny; i++) {
                                                z = yearCategoryTotal[years[i]][types[j]]
                                                cell = row.appendChild(numericCell(z, true))
                                              }
                              Severity: Major
                              Found in src/transaction/pane.js - About 45 mins to fix

                                Avoid deeply nested control flow statements.
                                Open

                                                for (i = 0; i < ny; i++) {
                                                  z = yearTotal[years[i]]
                                                  cell = row.appendChild(numericCell(z ? d2(z) : ''))
                                                }
                                Severity: Major
                                Found in src/transaction/pane.js - About 45 mins to fix

                                  Function render has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                                  Open

                                    render: (subject, context) => {
                                      const dom = context.dom
                                      const store = context.session.store
                                  
                                      function complainIfBad (ok: Boolean, mess: any) {
                                  Severity: Minor
                                  Found in src/dashboard/basicPreferences.ts - About 45 mins 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

                                  Avoid deeply nested control flow statements.
                                  Open

                                                  for (var r in recipient[1]) {
                                                    xrecipients.appendChild(recipChoice(recipient[1][r], r))
                                                  }
                                  Severity: Major
                                  Found in src/microblogPane/microblogPane.js - About 45 mins to fix

                                    Avoid deeply nested control flow statements.
                                    Open

                                                    if (
                                                      String(
                                                        kb.any(kb.sym(mb.getMyURI()), SIOC('id'))
                                                      ).toLowerCase() === atUser.toLowerCase()
                                                    ) {
                                    Severity: Major
                                    Found in src/microblogPane/microblogPane.js - About 45 mins to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language