michielbdejong/solid-panes

View on GitHub

Showing 327 of 327 total issues

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

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

          var selection = UI.utils.ancestor(
            UI.utils.ancestor(e.originalTarget, 'TABLE').parentNode,
            'TABLE'
          ).outline.selection
      Severity: Minor
      Found in src/outline/dragDrop.js and 1 other location - About 40 mins to fix
      src/outline/dragDrop.js on lines 294..297

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

      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 selection = UI.utils.ancestor(
              UI.utils.ancestor(e.originalTarget, 'TABLE').parentNode,
              'TABLE'
            ).outline.selection
      Severity: Minor
      Found in src/outline/dragDrop.js and 1 other location - About 40 mins to fix
      src/outline/dragDrop.js on lines 260..263

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

      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

      Consider simplifying this complex logical expression.
      Open

          if (
            t['http://www.w3.org/ns/pim/trip#Trip'] || // If in any subclass
            subject.uri === 'http://www.w3.org/ns/pim/trip#Trip' ||
            t['http://www.w3.org/2005/01/wf/flow#Task'] ||
            t['http://www.w3.org/2000/10/swap/pim/qif#Transaction'] ||
      Severity: Major
      Found in src/attach/attachPane.js - About 40 mins to fix

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

              options.set_y = options.set_y.map(function (resp) {
                return kb.any(resp, ns.dc('author'))
              })
        Severity: Minor
        Found in src/schedule/schedulePane.js and 1 other location - About 40 mins to fix
        src/schedule/schedulePane.js on lines 967..969

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

        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

              options.set_x = options.set_x.map(function (opt) {
                return kb.any(opt, ns.cal('dtstart'))
              })
        Severity: Minor
        Found in src/schedule/schedulePane.js and 1 other location - About 40 mins to fix
        src/schedule/schedulePane.js on lines 972..974

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

        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 OutlinerIcon has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

        outlineIcons.OutlinerIcon = function (src, width, alt, tooltip, filter) {
        Severity: Minor
        Found in src/outline/outlineIcons.js - About 35 mins to fix

          Function showMenu has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                e,
                menuType,
                inputQuery,
                extraInformation,
                _order
          Severity: Minor
          Found in src/outline/userInput.js - About 35 mins to fix

            Function on has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                on: function (el, sType, fn, obj, fnId /* ,override */) {
            Severity: Minor
            Found in src/outline/dragDrop.js - About 35 mins to fix

              Function getStatementsToAdd has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                origin: NamedNode,
                nodeName: string,
                modes: string[],
                person: NamedNode,
                ns: Namespaces
              Severity: Minor
              Found in src/trustedApplications/trustedApplications.utils.ts - About 35 mins to fix

                Function expandAfterRowOrCollapse has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                        dom,
                        row,
                        subject,
                        paneName,
                        solo
                Severity: Minor
                Found in src/transaction/period.js - About 35 mins to fix

                  Function expandAfterRowOrCollapse has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                        dom,
                        row,
                        subject,
                        paneName,
                        solo
                  Severity: Minor
                  Found in src/transaction/pane.js - About 35 mins to fix

                    Function expandAfterRow has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                          var expandAfterRow = function (dom, row, subject, paneName, solo) {
                    Severity: Minor
                    Found in src/transaction/period.js - About 35 mins to fix

                      Function createContainer has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                        elementName: K,
                        children: HTMLElement[],
                        attributes = {},
                        eventListeners = {},
                        onCreated = null
                      Severity: Minor
                      Found in src/trustedApplications/trustedApplications.dom.ts - About 35 mins to fix

                        Function createText has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                          elementName: K,
                          textContent: string | null,
                          attributes = {},
                          eventListeners = {},
                          onCreated = null
                        Severity: Minor
                        Found in src/trustedApplications/trustedApplications.dom.ts - About 35 mins to fix

                          Function expandAfterRow has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                              var expandAfterRow = function (dom, row, subject, paneName, solo) {
                          Severity: Minor
                          Found in src/transaction/pane.js - About 35 mins to fix

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

                                    for (var i = 0; i < list2.length; i++) {
                                      table.appendChild(transactionRow(dom, list2[i]))
                                    }
                            Severity: Minor
                            Found in src/transaction/period.js and 1 other location - About 35 mins to fix
                            src/transaction/pane.js on lines 235..237

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

                            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

                                  for (var i = 0; i < list2.length; i++) {
                                    table.appendChild(transactionRow(dom, list2[i]))
                                  }
                            Severity: Minor
                            Found in src/transaction/pane.js and 1 other location - About 35 mins to fix
                            src/transaction/period.js on lines 233..235

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

                            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

                            Severity
                            Category
                            Status
                            Source
                            Language