michielbdejong/solid-panes

View on GitHub

Showing 327 of 327 total issues

Function showMenu has 361 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    showMenu: function showMenu (
      e,
      menuType,
      inputQuery,
      extraInformation,
Severity: Major
Found in src/outline/userInput.js - About 1 day to fix

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

      render: function (subject, context) {
        const dom = context.dom
        var kb = context.session.store
        var fetcher = kb.fetcher
        var Q = $rdf.Namespace('http://www.w3.org/2000/10/swap/pim/qif#')
    Severity: Minor
    Found in src/transaction/pane.js - About 1 day 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 header has 335 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        Pane.prototype.header = function (s, doc) {
          var that = this
          function lsFollowUser () {
            var myUser = kb.sym(mb.getMyURI())
            // var Ifollow = that.Ifollow
    Severity: Major
    Found in src/microblogPane/microblogPane.js - About 1 day to fix

      Identical blocks of code found in 2 locations. Consider refactoring.
      Open

          var expandAfterRow = function (dom, row, subject, paneName, solo) {
            var siblings = row.parentNode.children
            if (solo) {
              for (var j = siblings.length - 1; j >= 0; j--) {
                if (siblings[j].expanded) {
      Severity: Major
      Found in src/transaction/pane.js and 1 other location - About 1 day to fix
      src/transaction/period.js on lines 135..160

      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 286.

      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

      Identical blocks of code found in 2 locations. Consider refactoring.
      Open

            var expandAfterRow = function (dom, row, subject, paneName, solo) {
              var siblings = row.parentNode.children
              if (solo) {
                for (var j = siblings.length - 1; j >= 0; j--) {
                  if (siblings[j].expanded) {
      Severity: Major
      Found in src/transaction/period.js and 1 other location - About 1 day to fix
      src/transaction/pane.js on lines 136..161

      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 286.

      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 render has a Cognitive Complexity of 74 (exceeds 5 allowed). Consider refactoring.
      Open

        render: function (subject, context) {
          const dom = context.dom
          var kb = context.session.store
          var ns = UI.ns
          var invitation = subject
      Severity: Minor
      Found in src/schedule/schedulePane.js - About 1 day 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 274 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        render: function (subject, context) {
          const dom = context.dom
          var kb = context.session.store
          var ns = UI.ns
      
      
      Severity: Major
      Found in src/transaction/period.js - About 1 day to fix

        Function generatePost has 253 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            Pane.prototype.generatePost = function (post, _me) {
              /*
              generatePost - Creates and formats microblog posts
                  post - symbol of the uri the post in question
          */
        Severity: Major
        Found in src/microblogPane/microblogPane.js - About 1 day to fix

          Function renderPeriod has 245 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              var renderPeriod = function () {
                var dtstart = kb.any(subject, ns.cal('dtstart'))
                if (dtstart === undefined) {
                  complain(
                    '(Error: There is no start date known for this period <' +
          Severity: Major
          Found in src/transaction/period.js - About 1 day to fix

            Function clearInputAndSave has 242 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                clearInputAndSave: function clearInputAndSave (e) {
                  if (!this.lastModified) return
                  if (!this.lastModified.isNew) {
                    try {
                      var obj = this.getStatementAbout(this.lastModified).object
            Severity: Major
            Found in src/outline/userInput.js - About 1 day to fix

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

                render: function (subject, context, paneOptions: any) {
                  const dom = context.dom
                  const store = context.session.store
                  // Utility functions
                  var complainIfBad = function (ok: boolean, message: string) {
              Severity: Minor
              Found in src/pad/padPane.ts - About 1 day 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 mintNew has 227 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                mintNew: function (context, options) {
                  return new Promise(function (resolve, reject) {
                    var ns = UI.ns
                    var kb = context.session.store
                    var newBase = options.newBase
              Severity: Major
              Found in src/schedule/schedulePane.js - About 1 day to fix

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                  render: function (subject, context) {
                    const myDocument = context.dom
                    var kb = context.session.store
                    var div = myDocument.createElement('div')
                    div.setAttribute('class', 'RDFXMLPane')
                Severity: Major
                Found in src/RDFXMLPane.js and 1 other location - About 1 day to fix
                src/n3Pane.js on lines 31..55

                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 206.

                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

                  render: function (subject, context) {
                    var myDocument = context.dom
                    var kb = context.session.store
                    var div = myDocument.createElement('div')
                    div.setAttribute('class', 'n3Pane')
                Severity: Major
                Found in src/n3Pane.js and 1 other location - About 1 day to fix
                src/RDFXMLPane.js on lines 33..57

                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 206.

                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 render has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring.
                Open

                  render: function (subject, context) {
                    const kb = context.session.store
                    const dom = context.dom
                
                    var mention = function complain (message, style) {
                Severity: Minor
                Found in src/form/pane.js - About 7 hrs 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 showResults has 192 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    var showResults = function () {
                      //       Now the form for responsing to the poll
                      //
                
                      // div.appendChild(dom.createElement('hr'))
                Severity: Major
                Found in src/schedule/schedulePane.js - About 7 hrs to fix

                  Function getAutoCompleteHandler has 191 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      getAutoCompleteHandler: function getAutoCompleteHandler (mode) {
                        qp('\n\n***** In getAutoCompleteHandler ****** mode = ' + mode)
                        if (mode === 'PredicateAutoComplete') {
                          mode = 'predicate'
                        } else if (mode !== 'JournalTAC') {
                  Severity: Major
                  Found in src/outline/userInput.js - About 7 hrs to fix

                    File pane.js has 485 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    /*   Financial Transaction Pane
                     **
                     **  This outline pane allows a user to interact with a transaction
                     **  downloaded from a bank statement, annotting it with classes and comments,
                     ** trips, etc
                    Severity: Minor
                    Found in src/transaction/pane.js - About 7 hrs to fix

                      Function appendPropertyTRs has 178 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        function appendPropertyTRs (parent, plist, inverse, predicateFilter) {
                          // UI.log.info('@appendPropertyTRs, 'this' is %s, dom is %s, '+ // Gives 'can't access dead object'
                          //                   'thisOutline.document is %s', this, dom.location, thisOutline.document.location);
                          // UI.log.info('@appendPropertyTRs, dom is now ' + this.document.location);
                          // UI.log.info('@appendPropertyTRs, dom is now ' + thisOutline.document.location);
                      Severity: Major
                      Found in src/outline/manager.js - About 7 hrs to fix

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

                          render: function (subject, context) {
                            const dom = context.dom
                            const store = context.session.store
                            const canonizedSubject = store.canon(subject)
                            const types = store.findTypeURIs(canonizedSubject)
                        Severity: Major
                        Found in src/internal/internalPane.ts - About 7 hrs to fix
                          Severity
                          Category
                          Status
                          Source
                          Language