michielbdejong/solid-ui

View on GitHub

Showing 270 of 337 total issues

Function ontologyLabel has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

function ontologyLabel (term) {
  if (term.uri === undefined) return '??'
  var s = term.uri
  var namespaces = []
  var i = s.lastIndexOf('#')
Severity: Minor
Found in src/utils.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 newThingUI has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

function newThingUI (createContext, dataBrowserContext, thePanes) {
  if (!thePanes) throw new Error('@@ newThingUI: update API') // phase out
  const dom = createContext.dom
  const div = createContext.div
  if (createContext.me && !createContext.me.uri) {
Severity: Minor
Found in src/create.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 basicField has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

function basicField (
  dom,
  container,
  already,
  subject,
Severity: Minor
Found in src/widgets/forms.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 promptForNew has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
Open

forms.promptForNew = function (
  dom,
  kb,
  subject,
  predicate,
Severity: Minor
Found in src/widgets/forms.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 renderEnumSelector has 47 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  function renderEnumSelector (rows, columns, column, list) {
    var doMultiple = true
    var result = doc.createElement('div')
    var dropdown = doc.createElement('select')

Severity: Minor
Found in src/table.js - About 1 hr to fix

    Function makeIndexIfNecessary has 46 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      async function makeIndexIfNecessary (context, isPublic) {
        const relevant = isPublic ? context.publicProfile : context.preferencesFile
        const visibility = isPublic ? 'public' : 'private'
    
        async function putIndex (newIndex) {
    Severity: Minor
    Found in src/authn/authn.ts - About 1 hr to fix

      Function sendMessage has 45 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          var sendMessage = function () {
            // titlefield.setAttribute('class','pendingedit')
            // titlefield.disabled = true
            field.setAttribute('class', 'pendingedit')
            field.disabled = true
      Severity: Minor
      Found in src/messageArea.js - About 1 hr to fix

        Function sendMessage has 45 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            var sendMessage = function () {
              // titlefield.setAttribute('class','pendingedit')
              // titlefield.disabled = true
              field.setAttribute('class', 'pendingedit')
              field.disabled = true
        Severity: Minor
        Found in src/chat/thread.js - About 1 hr to fix

          Function findAgent has 45 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function findAgent (uri, kb): PartialAgentTriple | null {
            const obj = sym(uri)
            const types = kb.findTypeURIs(obj)
            for (const ty in types) {
              console.log('    drop object type includes: ' + ty)
          Severity: Minor
          Found in src/acl/access-groups.ts - About 1 hr to fix

            Function createNewGroup has 44 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              createNewGroup (book) {
                const { groupIndex, groupContainer } = indexes(book)
                const group = rdf.sym(
                  `${groupContainer.uri}${uuid.v4().slice(0, 8)}.ttl#this`
                )
            Severity: Minor
            Found in src/widgets/peoplePicker.js - About 1 hr to fix

              Function previousPeriod has 43 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  async function previousPeriod (file, level) {
                    function younger (x) {
                      if (backwards ? x.uri >= file.uri : x.uri <= file.uri) return false // later than we want or same -- looking for different
                      return true
                    }
              Severity: Minor
              Found in src/chat/dateFolder.js - About 1 hr to fix

                Function renderTableRowInto has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  function renderTableRowInto (tr, row, columns, _downstream) {
                    /* Link column, for linking to this subject. */
                
                    var linkTd = doc.createElement('td')
                
                
                Severity: Minor
                Found in src/table.js - About 1 hr to fix

                  Function deleteButtonWithCheck has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  buttons.deleteButtonWithCheck = function (
                    dom,
                    container,
                    noun,
                    deleteFunction
                  Severity: Minor
                  Found in src/widgets/buttons.js - About 1 hr to fix

                    Function findAppInstances has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export async function findAppInstances (
                      context: AuthenticationContext,
                      klass: $rdf.NamedNode,
                      isPublic: boolean
                    ): Promise<AuthenticationContext> {
                    Severity: Minor
                    Found in src/authn/authn.ts - About 1 hr to fix

                      Function columnNumberFor has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        var columnNumberFor = function (x1) {
                          var xNT = x1.toNT() // xNT is a NT string
                          var col = null
                          // These are data columns (not headings)
                          for (var i = 0; i < columns.length; i++) {
                      Severity: Minor
                      Found in src/matrix.js - About 1 hr to fix

                        Function registrationList has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export function registrationList (context: AuthenticationContext, options: {
                          private?: boolean
                          public?: boolean
                        }): Promise<AuthenticationContext> {
                          const dom = context.dom as HTMLDocument
                        Severity: Minor
                        Found in src/authn/authn.ts - About 1 hr to fix

                          Function makeSelectForCategory has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          forms.makeSelectForCategory = function (
                            dom,
                            kb,
                            subject,
                            category,
                          Severity: Minor
                          Found in src/widgets/forms.js - About 1 hr to fix

                            Function loadMoreWhereNeeded has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              async function loadMoreWhereNeeded (event, fixScroll) {
                                if (lock) return
                                lock = true
                                const freeze = !fixScroll
                                const magicZone = 150
                            Severity: Minor
                            Found in src/chat/infinite.js - About 1 hr to fix

                              Function makeSelectForNestedCategory has 40 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              forms.makeSelectForNestedCategory = function (
                                dom,
                                kb,
                                subject,
                                category,
                              Severity: Minor
                              Found in src/widgets/forms.js - About 1 hr to fix

                                Function selectorPanelRefresh has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                                Open

                                buttons.selectorPanelRefresh = function (
                                  list,
                                  dom,
                                  kb,
                                  type,
                                Severity: Minor
                                Found in src/widgets/buttons.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

                                Severity
                                Category
                                Status
                                Source
                                Language