michielbdejong/solid-ui

View on GitHub

Showing 270 of 337 total issues

Avoid too many return statements within this function.
Open

    return { pred: 'agentClass', obj: obj }
Severity: Major
Found in src/acl/access-groups.ts - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

        return { pred: 'origin', obj: obj }
    Severity: Major
    Found in src/acl/access-groups.ts - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

        return null
      Severity: Major
      Found in src/acl/access-groups.ts - About 30 mins to fix

        Function _trySetImage has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

        buttons._trySetImage = function _trySetImage (element, thing, iconForClassMap) {
          const kb = UI.store
        
          const explitImage = buttons.findImage(thing)
          if (explitImage) {
        Severity: Minor
        Found in src/widgets/buttons.js - About 25 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 getEyeFocus has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

        function getEyeFocus (element, instantly, isBottom, myWindow) {
          if (!myWindow) myWindow = window
          var elementPosY = findPos(element)[1]
          var totalScroll = elementPosY - 52 - myWindow.scrollY // magic number 52 for web-based version
          if (instantly) {
        Severity: Minor
        Found in src/utils.js - About 25 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 personTR has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

        buttons.personTR = function (dom, pred, obj, options) {
          var tr = dom.createElement('tr')
          options = options || {}
          // tr.predObj = [pred.uri, obj.uri]   moved to acl-control
          var td1 = tr.appendChild(dom.createElement('td'))
        Severity: Minor
        Found in src/widgets/buttons.js - About 25 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 toJS has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

        function toJS (term) {
          if (!term.datatype) return term // Objects remain objects
          if (term.datatype.equals(ns.xsd('boolean'))) {
            return term.value === '1'
          }
        Severity: Minor
        Found in src/preferences.js - About 25 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 defaultAnnotationStore has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

        buttons.defaultAnnotationStore = function (subject) {
          if (subject.uri === undefined) return undefined
          var s = subject.uri
          if (s.slice(0, 7) !== 'http://') return undefined
          s = s.slice(7) // Remove
        Severity: Minor
        Found in src/widgets/buttons.js - About 25 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 makeSelectForNestedCategory has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

        forms.makeSelectForNestedCategory = function (
          dom,
          kb,
          subject,
          category,
        Severity: Minor
        Found in src/widgets/forms.js - About 25 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 booleanField has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

        function booleanField (
          dom,
          container,
          already,
          subject,
        Severity: Minor
        Found in src/widgets/forms.js - About 25 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

        Severity
        Category
        Status
        Source
        Language