michielbdejong/solid-panes

View on GitHub

Showing 327 of 327 total issues

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

      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

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

                    if (
                      kb.whether(creators[c], RDF('type'), SIOC('User')) &&
                      kb.whether(
                        kb.any(creators[c], SIOC('creator_of')),
                        RDF('type'),
            Severity: Major
            Found in src/microblogPane/microblogPane.js and 1 other location - About 1 hr to fix
            src/microblogPane/microblogPane.js on lines 513..523

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

            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

                    if (
                      kb.whether(accounts[a], RDF('type'), SIOC('User')) &&
                      kb.whether(
                        kb.any(accounts[a], SIOC('creator_of')),
                        RDF('type'),
            Severity: Major
            Found in src/microblogPane/microblogPane.js and 1 other location - About 1 hr to fix
            src/microblogPane/microblogPane.js on lines 886..899

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

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

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

                    function showURI (about) {
                      if (about && dom.getElementById('UserURI')) {
                        dom.getElementById('UserURI').value =
                          about.termType === 'NamedNode' ? about.uri : '' // blank if no URI
                      }
                Severity: Major
                Found in src/outline/manager.js and 1 other location - About 1 hr to fix
                src/outline/manager.js on lines 1325..1330

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

                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

                  this.showURI = function showURI (about) {
                    if (about && dom.getElementById('UserURI')) {
                      dom.getElementById('UserURI').value =
                        about.termType === 'NamedNode' ? about.uri : '' // blank if no URI
                    }
                Severity: Major
                Found in src/outline/manager.js and 1 other location - About 1 hr to fix
                src/outline/manager.js on lines 1520..1525

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

                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 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
                              Severity
                              Category
                              Status
                              Source
                              Language