michielbdejong/solid-panes

View on GitHub

Showing 243 of 327 total issues

Function saveQuery has 35 lines of code (exceeds 25 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

    Function appendToPredicate has 35 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        appendToPredicate: function appendToPredicate (predicateTd) {
          var isEnd = false
          var trIterator
          try {
            for (
    Severity: Minor
    Found in src/outline/userInput.js - About 1 hr to fix

      Function displayTheMatrix has 35 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

            var displayTheMatrix = function () {
              var matrix = div.appendChild(
                UI.matrix.matrixForQuery(
                  dom,
                  query,
      Severity: Minor
      Found in src/schedule/schedulePane.js - About 1 hr to fix

        Function render has 34 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        async function render (dom, main, statusArea): Promise<void> {
          const authContext = await authn.logInLoadProfile({ dom: dom, div: main, statusArea: statusArea, me: null })
          const subject = authContext.me as NamedNode
        
          const profile = subject.doc()
        Severity: Minor
        Found in src/trustedApplications/trustedApplications.view.ts - About 1 hr to fix

          Function mbconfirmFollow has 34 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  var mbconfirmFollow = function (uri, success, _msg) {
                    if (success === true) {
                      if (!that.Ifollow) {
                        // prevent duplicate entries from being added to kb (because that was happening)
                        if (
          Severity: Minor
          Found in src/microblogPane/microblogPane.js - About 1 hr to fix

            Function showDashboard has 33 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              async function showDashboard (options = {}) {
                const dashboardContainer = getDashboardContainer()
                const outlineContainer = getOutlineContainer()
                // reuse dashboard if already children already is inserted
                if (dashboardContainer.childNodes.length > 0 && options.pane) {
            Severity: Minor
            Found in src/outline/manager.js - About 1 hr to fix

              Function render has 33 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                render: function (subject, context) {
                  const dom = context.dom
                  var showContent = async function () {
                    var homePaneContext = { div: div, dom: dom, statusArea: div, me: me }
                    /*
              Severity: Minor
              Found in src/home/homePane.ts - About 1 hr to fix

                Function createApplicationTable has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export function createApplicationTable (subject: NamedNode) {
                  const applicationsTable = createElement('table', {
                    class: 'results'
                  })
                
                
                Severity: Minor
                Found in src/trustedApplications/trustedApplications.dom.ts - About 1 hr to fix

                  Function setSelectedParent has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    function setSelectedParent (node, inc) {
                      var onIcon = outlineIcons.termWidgets.optOn
                      var offIcon = outlineIcons.termWidgets.optOff
                      for (var n = node; n.parentNode; n = n.parentNode) {
                        while (true) {
                  Severity: Minor
                  Found in src/outline/manager.js - About 1 hr to fix

                    Function headerButtons has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        var headerButtons = function (dom, labels, intial, callback) {
                          var head = dom.createElement('table')
                          var current = intial
                          head.setAttribute(
                            'style',
                    Severity: Minor
                    Found in src/attach/attachPane.js - About 1 hr to fix

                      Function generateRequest has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          generateRequest: function generateRequest (
                            tipText,
                            trNew,
                            isPredicate,
                            notShow
                      Severity: Minor
                      Found in src/outline/userInput.js - About 1 hr to fix

                        Function getStatementsToDelete has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export function getStatementsToDelete (
                          origin: NamedNode,
                          person: NamedNode,
                          kb: IndexedFormula,
                          ns: Namespaces
                        Severity: Minor
                        Found in src/trustedApplications/trustedApplications.utils.ts - About 1 hr to fix

                          Function onDragEnter has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                          Open

                            onDragEnter: function (e, _dragSession) {
                              // enter or exit something
                              try {
                                var selection = UI.utils.ancestor(
                                  UI.utils.ancestor(e.originalTarget, 'TABLE').parentNode,
                          Severity: Minor
                          Found in src/outline/dragDrop.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 renderPane has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                          var renderPane = function (pane) {
                                            var paneDiv
                                            UI.log.info('outline: Rendering pane (2): ' + pane.name)
                                            if (UI.no_catch_pane_errors) {
                                              // for debugging
                          Severity: Minor
                          Found in src/outline/manager.js - About 1 hr to fix

                            Function TabulatorMousedown has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              function TabulatorMousedown (e) {
                                UI.log.info('@TabulatorMousedown, dom.location is now ' + dom.location)
                                var target = thisOutline.targetOf(e)
                                if (!target) return
                                var tname = target.tagName
                            Severity: Minor
                            Found in src/outline/manager.js - About 1 hr to fix

                              Function isVideo has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  function isVideo (src, _index) {
                                    if (!src) {
                                      return {
                                        html5: true
                                      }
                              Severity: Minor
                              Found in src/playlist/playlistPane.js - About 1 hr to fix

                                Function cellFunction has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                        options.cellFunction = function (cell, x, y, value) {
                                          if (value !== null) {
                                            kb.fetcher.nowOrWhenFetched(
                                              value.uri.split('#')[0],
                                              undefined,
                                Severity: Minor
                                Found in src/schedule/schedulePane.js - About 1 hr to fix

                                  Function streamView has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      Pane.prototype.streamView = function (s, doc) {
                                        var postContainer = doc.createElement('div')
                                        postContainer.id = 'postContainer'
                                        postContainer.className = 'post-container view-container active'
                                        var mbPosts = []
                                  Severity: Minor
                                  Found in src/microblogPane/microblogPane.js - About 1 hr to fix

                                    Function calculations has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                          var calculations = function () {
                                            var total = {}
                                            var trans = kb.each(undefined, TRIP('trip'), subject)
                                            // complain("@@ Number of transactions in this trip: " + trans.length);
                                            trans.map(function (t) {
                                    Severity: Minor
                                    Found in src/trip/tripPane.js - About 1 hr to fix

                                      Function setAttachment has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                          var setAttachment = function (x, y, value, refresh) {
                                            if (kb.holds(x, predicate, y) === value) return
                                            var verb = value ? 'attach' : 'detach'
                                            // complain("Info: starting to "+verb+" " + y.uri + " to "+x.uri+ ":\n")
                                            var linkDone3 = function (uri, ok, body) {
                                      Severity: Minor
                                      Found in src/attach/attachPane.js - About 1 hr to fix
                                        Severity
                                        Category
                                        Status
                                        Source
                                        Language