michielbdejong/solid-panes

View on GitHub

Showing 327 of 327 total issues

Function showBootstrap has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    var showBootstrap = function showBootstrap (
      thisInstance: any,
      container: HTMLElement,
      noun: string
    ) {
Severity: Minor
Found in src/pad/padPane.ts - About 1 hr to fix

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

            new UI.rdf.Statement(
              kb.sym(host + '#' + id),
              SIOC('creator_of'),
              kb.sym(host + '#fav'),
              kb.sym(host)
    Severity: Major
    Found in src/microblogPane/microblogPane.js and 2 other locations - About 1 hr to fix
    src/microblogPane/microblogPane.js on lines 353..358
    src/microblogPane/microblogPane.js on lines 359..364

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

    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 4 locations. Consider refactoring.
    Open

            new UI.rdf.Statement(
              kb.sym(host + '#mb'),
              SIOC('has_creator'),
              kb.sym(host + '#' + id),
              kb.sym(host)
    Severity: Major
    Found in src/microblogPane/microblogPane.js and 3 other locations - About 1 hr to fix
    src/microblogPane/microblogPane.js on lines 415..420
    src/microblogPane/microblogPane.js on lines 421..426
    src/microblogPane/microblogPane.js on lines 434..439

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

    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 3 locations. Consider refactoring.
    Open

            new UI.rdf.Statement(
              kb.sym(host + '#' + id),
              SIOC('creator_of'),
              kb.sym(host + '#mb'),
              kb.sym(host)
    Severity: Major
    Found in src/microblogPane/microblogPane.js and 2 other locations - About 1 hr to fix
    src/microblogPane/microblogPane.js on lines 359..364
    src/microblogPane/microblogPane.js on lines 365..370

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

    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 4 locations. Consider refactoring.
    Open

            new UI.rdf.Statement(
              kb.sym(host + '#mbn'),
              SIOC('topic'),
              kb.sym(host + '#' + id),
              kb.sym(host)
    Severity: Major
    Found in src/microblogPane/microblogPane.js and 3 other locations - About 1 hr to fix
    src/microblogPane/microblogPane.js on lines 402..407
    src/microblogPane/microblogPane.js on lines 421..426
    src/microblogPane/microblogPane.js on lines 434..439

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

    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 3 locations. Consider refactoring.
    Open

            new UI.rdf.Statement(
              kb.sym(host + '#' + id),
              SIOC('creator_of'),
              kb.sym(host + '#mbn'),
              kb.sym(host)
    Severity: Major
    Found in src/microblogPane/microblogPane.js and 2 other locations - About 1 hr to fix
    src/microblogPane/microblogPane.js on lines 353..358
    src/microblogPane/microblogPane.js on lines 365..370

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

    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 4 locations. Consider refactoring.
    Open

            new UI.rdf.Statement(
              kb.sym(host + '#mbn'),
              SIOC('has_creator'),
              kb.sym(host + '#' + id),
              kb.sym(host)
    Severity: Major
    Found in src/microblogPane/microblogPane.js and 3 other locations - About 1 hr to fix
    src/microblogPane/microblogPane.js on lines 402..407
    src/microblogPane/microblogPane.js on lines 415..420
    src/microblogPane/microblogPane.js on lines 434..439

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

    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 4 locations. Consider refactoring.
    Open

            new UI.rdf.Statement(
              kb.sym(host + '#fav'),
              SIOC('has_creator'),
              kb.sym(host + '#' + id),
              kb.sym(host)
    Severity: Major
    Found in src/microblogPane/microblogPane.js and 3 other locations - About 1 hr to fix
    src/microblogPane/microblogPane.js on lines 402..407
    src/microblogPane/microblogPane.js on lines 415..420
    src/microblogPane/microblogPane.js on lines 421..426

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

    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 showFiltered has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        var showFiltered = function (mode) {
          var filtered = mode === 0 ? objects : getFiltered()
          // eslint-enable
          UI.widgets.selectorPanelRefresh(
            objectList,
    Severity: Minor
    Found in src/attach/attachPane.js - About 1 hr to fix

      Function showContent has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          var showContent = async function () {
            var homePaneContext = { div: div, dom: dom, statusArea: div, me: me }
            /*
                  div.appendChild(dom.createElement('h4')).textContent = 'Login status'
                  var loginStatusDiv = div.appendChild(context.dom.createElement('div'))
      Severity: Minor
      Found in src/home/homePane.ts - About 1 hr to fix

        Function doRender has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            async function doRender () {
              const renderContext = await authn.logInLoadPreferences({
                dom,
                div: container
              })
        Severity: Minor
        Found in src/dashboard/basicPreferences.ts - About 1 hr to fix

          Consider simplifying this complex logical expression.
          Open

              if (
                obj.termType === 'NamedNode' ||
                obj.termType === 'BlankNode' ||
                (obj.termType === 'Literal' &&
                  obj.value.slice &&
          Severity: Major
          Found in src/outline/manager.js - About 1 hr to fix

            Consider simplifying this complex logical expression.
            Open

                if (
                  (subject.termType === 'NamedNode' &&
                    kb.updater.editable(UI.rdf.Util.uri.docpart(subject.uri), kb)) ||
                  (subject.termType === 'BlankNode' &&
                    kb.anyStatementMatching(subject) &&
            Severity: Major
            Found in src/defaultPane.js - About 1 hr to fix

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

                            if (ok) {
                              clearElement(naviMain)
                              showResults(false)
                            } else {
                              complainIfBad(
              Severity: Major
              Found in src/pad/padPane.ts and 1 other location - About 1 hr to fix
              src/pad/padPane.ts on lines 352..368

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

              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 (ok) {
                            agenda.shift()!()
                          } else {
                            complainIfBad(
                              ok,
              Severity: Major
              Found in src/pad/padPane.ts and 1 other location - About 1 hr to fix
              src/pad/padPane.ts on lines 452..469

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

              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

                      for (let j = 0; j < outgoing.length; j++) {
                        if (outgoing[j].sameTerm(friend)) {
                          found = true
                          break
                        }
              Severity: Minor
              Found in src/socialPane.js and 1 other location - About 55 mins to fix
              src/socialPane.js on lines 386..391

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

              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

                      for (let j = 0; j < incoming.length; j++) {
                        if (incoming[j].sameTerm(friend)) {
                          found = true
                          break
                        }
              Severity: Minor
              Found in src/socialPane.js and 1 other location - About 55 mins to fix
              src/socialPane.js on lines 400..405

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

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

              function createApplicationEntry (
                subject: NamedNode,
                origin: NamedNode | null,
                appModes: NamedNode[],
                updateTable: () => void
              Severity: Minor
              Found in src/trustedApplications/trustedApplications.dom.ts - About 55 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 (enterEvent.keyCode === 37) {
                                  setHighlightItem(menu.lastHighlight.previousSibling)
                                } else {
                                  setHighlightItem(menu.lastHighlight.nextSibling)
                                }
              Severity: Major
              Found in src/outline/userInput.js - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                        if (d.paneButton) {
                                          d.paneButton.setAttribute('class', 'paneHidden')
                                          d.paneButton.style = paneHiddenStyle
                                        }
                Severity: Major
                Found in src/outline/manager.js - About 45 mins to fix
                  Severity
                  Category
                  Status
                  Source
                  Language