michielbdejong/solid-ui

View on GitHub

Showing 270 of 337 total issues

Function syncTableToArrayReOrdered has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function syncTableToArrayReOrdered (table, things, createNewRow) {
  const elementMap = {}

  for (let i = 0; i < table.children.length; i++) {
    const row = table.children[i]
Severity: Minor
Found in src/utils.js - About 1 hr to fix

    Function propertyTriage has 30 lines of code (exceeds 25 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 1 hr to fix

      Function setACL has 30 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export function setACL (
        docURI: $rdf.NamedNode,
        aclText: string,
        callbackFunction: (ok: boolean, message: string) => void
      ): void {
      Severity: Minor
      Found in src/acl/acl.ts - About 1 hr to fix

        Function save has 30 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          public save (): Promise<void> {
            const newAClGraph = graph()
            if (!this.isContainer) {
              makeACLGraphbyCombo(newAClGraph, this.targetDoc, this.mainCombo.byCombo, this.targetACLDoc, true)
            } else if (this.defaultsCombo && this.defaultsDiffer) {
        Severity: Minor
        Found in src/acl/access-controller.ts - About 1 hr to fix

          Function fixIndividualACL has 30 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export function fixIndividualACL (item: $rdf.NamedNode, subjects: Array<$rdf.NamedNode>, log: Function, callbackFunction: Function): void {
            log = log || console.log
            const doc = item.doc()
            getACLorDefault(doc, function (
              ok,
          Severity: Minor
          Found in src/acl/acl.ts - About 1 hr to fix

            Function inferColumnsFromFormula has 29 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              function inferColumnsFromFormula (columns, formula) {
                UI.log.debug('>> processing formula')
            
                for (let i = 0; i < formula.statements.length; ++i) {
                  var statement = formula.statements[i]
            Severity: Minor
            Found in src/table.js - About 1 hr to fix

              Function generateColumnAddDropdown has 29 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                function generateColumnAddDropdown (type) {
                  var resultDiv = doc.createElement('div')
              
                  var unusedColumns = type.getUnusedColumns()
              
              
              Severity: Minor
              Found in src/table.js - About 1 hr to fix

                Function onResult has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    var onResult = function (values) {
                      if (!query.running) {
                        return
                      }
                
                
                Severity: Minor
                Found in src/table.js - About 1 hr to fix

                  Function preventBrowserDropEvents has 29 lines of code (exceeds 25 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 1 hr to fix

                    Function selectorPanel has 9 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                      dom,
                      kb,
                      type,
                      predicate,
                      inverse,
                    Severity: Major
                    Found in src/widgets/buttons.js - About 1 hr to fix

                      Function setPartStyle has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        var setPartStyle = function (part, colors, pending) {
                          var chunk = part.subject
                          colors = colors || ''
                          var baseStyle =
                            'font-size: 100%; font-family: monospace; width: 100%; border: none; white-space: pre-wrap;'
                      Severity: Minor
                      Found in src/pad.js - About 1 hr to fix

                        Function firstLeaf has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                        Open

                          async firstLeaf (backwards) {
                            // backwards -> last leafObject
                            var folderStore = $rdf.graph()
                            var folderFetcher = new $rdf.Fetcher(folderStore)
                            async function earliestSubfolder (parent) {
                        Severity: Minor
                        Found in src/chat/dateFolder.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 render has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                        Open

                          public render (): HTMLElement {
                            this.rootElement.innerHTML = ''
                            if (this.isUsingDefaults) {
                              this.renderStatus(`The sharing for this ${this.noun} is the default for folder `)
                              if (this.defaultHolder) {
                        Severity: Minor
                        Found in src/acl/access-controller.ts - 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 removeAgentFromCombos has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                        Open

                          private removeAgentFromCombos (uri: string): void {
                            for (let k = 0; k < 16; k++) {
                              const combos = this.byCombo[kToCombo(k)]
                              if (combos) {
                                for (let i = 0; i < combos.length; i++) {
                        Severity: Minor
                        Found in src/acl/access-groups.ts - 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 createIfNotExists has 27 lines of code (exceeds 25 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 1 hr to fix

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

                                async function (_event) {
                                  if (action) {
                                    await deleteThingThen(action)
                                    action = null
                                    setColor()
                          Severity: Minor
                          Found in src/chat/messageTools.js - About 1 hr to fix

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

                            export function setACLUserPublic (
                              docURI: $rdf.NamedNode,
                              me: $rdf.NamedNode,
                              options: {
                                defaultForNew?: boolean,
                            Severity: Minor
                            Found in src/authn/authn.ts - About 1 hr to fix

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

                                private renderAppsButton (): HTMLElement {
                                  return widgets.button(
                                    this.groupList.controller.dom,
                                    `${icons.iconBase}noun_15177.svg`,
                                    'A Web App (origin)',
                              Severity: Minor
                              Found in src/acl/add-agent-buttons.ts - About 1 hr to fix

                                Function personTR has 27 lines of code (exceeds 25 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 1 hr to fix

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

                                      const patchPromises = [group.doc(), groupIndex].map(doc => {
                                        const typeStatement = rdf.st(
                                          group,
                                          ns.rdf('type'),
                                          ns.vcard('Group'),
                                  Severity: Minor
                                  Found in src/widgets/peoplePicker.js - About 1 hr to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language