michielbdejong/solid-ui

View on GitHub

Showing 270 of 337 total issues

Function makeSelectForCategory has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

forms.makeSelectForCategory = function (
  dom,
  kb,
  subject,
  category,
Severity: Minor
Found in src/widgets/forms.js - 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

Function preventBrowserDropEvents has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

export function preventBrowserDropEvents (document: HTMLDocument): void {
  console.log('preventBrowserDropEvents called.')
  const global: any = window
  if (typeof global !== 'undefined') {
    if (global.preventBrowserDropEventsDone) return
Severity: Minor
Found in src/acl/acl-control.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

Consider simplifying this complex logical expression.
Open

      if (
        (y > ele.dataValueNT && options && options.yDecreasing) ||
        (y < ele.dataValueNT && !(options && options.yDecreasing))
      ) {
        return matrix.insertBefore(tr, ele) // return the tr
Severity: Major
Found in src/matrix.js - About 40 mins to fix

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

    module.exports = function (dom, kb, subject, messageStore, options) {
    Severity: Minor
    Found in src/chat/thread.js - About 35 mins to fix

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

      UI.pad.notepad = function (dom, padDoc, subject, me, options) {
      Severity: Minor
      Found in src/pad.js - About 35 mins to fix

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

          messageTable,
          bindings,
          fresh,
          options,
          userContext
        Severity: Minor
        Found in src/chat/message.js - About 35 mins to fix

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

          function uploadFiles (fetcher, files, fileBase, imageBase, successHandler) {
          Severity: Minor
          Found in src/widgets/dragAndDrop.js - About 35 mins to fix

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

            module.exports = function (dom, kb, subject, messageStore, options) {
            Severity: Minor
            Found in src/messageArea.js - About 35 mins to fix

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

                dom,
                container,
                form,
                store,
                callbackFunction
              Severity: Minor
              Found in src/widgets/forms.js - About 35 mins to fix

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

                  kb: $rdf.IndexedFormula,
                  x: $rdf.NamedNode,
                  byCombo: ComboList,
                  aclDoc: $rdf.NamedNode,
                  callbackFunction: (ok: boolean, message?: string) => void
                Severity: Minor
                Found in src/acl/acl.ts - About 35 mins to fix

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

                    kb: $rdf.IndexedFormula,
                    x: $rdf.NamedNode,
                    ac: AgentMapMap,
                    aclDoc: $rdf.NamedNode,
                    callbackFunction
                  Severity: Minor
                  Found in src/acl/acl.ts - About 35 mins to fix

                    Function createIfNotExists has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                    async function createIfNotExists (doc, contentType = 'text/turtle', data = '') {
                      const fetcher = UI.store.fetcher
                      try {
                        var response = await fetcher.load(doc)
                      } catch (err) {
                    Severity: Minor
                    Found in src/chat/infinite.js - About 35 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

                    Function participationObject has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                    UI.pad.participationObject = function (subject, padDoc, me) {
                      return new Promise(function (resolve, reject) {
                        if (!me) {
                          throw new Error('Not user id')
                        }
                    Severity: Minor
                    Found in src/pad.js - About 35 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

                    Function stackString has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                    function stackString (e) {
                      let str = '' + e + '\n'
                      let i
                      if (!e.stack) {
                        return str + 'No stack available.\n'
                    Severity: Minor
                    Found in src/utils.js - About 35 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

                    Function faviconOrDefault has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                    var faviconOrDefault = function (dom, x) {
                      var image = dom.createElement('img')
                      image.style = UI.style.iconStyle
                      var isOrigin = function (x) {
                        if (!x.uri) return false
                    Severity: Minor
                    Found in src/widgets/buttons.js - About 35 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

                    Function propertyTriage has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                    buttons.propertyTriage = function (kb) {
                      var possibleProperties = {}
                      // if (possibleProperties === undefined) possibleProperties = {}
                      // var kb = UI.store
                      var dp = {}
                    Severity: Minor
                    Found in src/widgets/buttons.js - About 35 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

                    Function offlineTestID has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                    export function offlineTestID (): $rdf.NamedNode | null {
                      const { $SolidTestEnvironment }: any = window
                      if (
                        typeof $SolidTestEnvironment !== 'undefined' &&
                        $SolidTestEnvironment.username
                    Severity: Minor
                    Found in src/authn/authn.ts - About 35 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 too many return statements within this function.
                    Open

                          return term.uri + '!?' // strange should have a nice part
                    Severity: Major
                    Found in src/utils.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                        return term.value
                      Severity: Major
                      Found in src/preferences.js - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                          if (hash >= 0) return cleanUp(s.slice(hash + 1))
                        Severity: Major
                        Found in src/utils.js - About 30 mins to fix
                          Severity
                          Category
                          Status
                          Source
                          Language