michielbdejong/solid-ui

View on GitHub

Showing 270 of 337 total issues

Function SubjectType has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  function SubjectType (type) {
    this.type = type
    this.columns = null
    this.allColumns = null
    this.useCount = 0
Severity: Minor
Found in src/table.js - About 1 hr to fix

    Function renderNumberSelector has 39 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      function renderNumberSelector (rows, columns, column) {
        var result = doc.createElement('div')
    
        var minSelector = doc.createElement('input')
        minSelector.setAttribute('type', 'text')
    Severity: Minor
    Found in src/table.js - About 1 hr to fix

      Function renderValue has 39 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        function renderValue (obj, column) {
          // hint
          var hints = getHints(column)
          var cellFormat = hints.cellFormat
          if (cellFormat) {
      Severity: Minor
      Found in src/table.js - About 1 hr to fix

        Function adoptACLDefault has 39 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export function adoptACLDefault (
          doc: $rdf.NamedNode,
          aclDoc: $rdf.NamedNode,
          defaultResource: $rdf.NamedNode,
          defaultACLdoc: $rdf.NamedNode
        Severity: Minor
        Found in src/acl/acl.ts - About 1 hr to fix

          Function removePart has 38 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            var removePart = function (part) {
              var chunk = part.subject
              if (!chunk) throw new Error('No chunk for line to be deleted!') // just in case
              var prev = kb.any(undefined, PAD('next'), chunk)
              var next = kb.any(chunk, PAD('next'))
          Severity: Minor
          Found in src/pad.js - About 1 hr to fix

            Function loadIndex has 38 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

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

              Function renderPartipants has 37 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              UI.pad.renderPartipants = function (dom, table, padDoc, subject, me, options) {
                table.setAttribute('style', 'margin: 0.8em;')
              
                var newRowForParticpation = function (parp) {
                  var person = kb.any(parp, ns.wf('participant'))
              Severity: Minor
              Found in src/pad.js - About 1 hr to fix

                Function getACL has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export function getACL (
                  doc: $rdf.NamedNode,
                  callbackFunction: (
                    ok: boolean,
                    messageOrStatus: number | string,
                Severity: Minor
                Found in src/acl/acl.ts - About 1 hr to fix

                  Function createIfNotExists has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function createIfNotExists (doc) {
                    return new Promise(function (resolve, reject) {
                      kb.fetcher.load(doc).then(
                        response => {
                          console.log('createIfNotExists doc exists, all good ' + doc)
                  Severity: Minor
                  Found in src/chat/bookmarks.js - About 1 hr to fix

                    Function syncMessages has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      function syncMessages (about, messageTable) {
                        var displayed = {}
                        var ele, ele2
                        for (ele = messageTable.firstChild; ele; ele = ele.nextSibling) {
                          if (ele.AJAR_subject) {
                    Severity: Minor
                    Found in src/chat/infinite.js - About 1 hr to fix

                      Function makeNewSlot has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        var makeNewSlot = function (item) {
                          var ele = dom.createElement(tabElement)
                          ele.subject = item
                          var div = ele.appendChild(dom.createElement('div'))
                          div.setAttribute('style', unselectedStyle)
                      Severity: Minor
                      Found in src/tabs.js - About 1 hr to fix

                        Function findAgent has a Cognitive Complexity of 12 (exceeds 5 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

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

                        export function comboToString (byCombo: ComboList): string {
                          let str = ''
                          for (const combo in byCombo) {
                            const modeURIs = combo.split('\n')
                            const initials = modeURIs
                        Severity: Minor
                        Found in src/acl/acl.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 participationObject has 35 lines of code (exceeds 25 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 1 hr to fix

                          Function reloadAndSync has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            var reloadAndSync = function () {
                              if (reloading) {
                                console.log('   Already reloading - stop')
                                return // once only needed
                              }
                          Severity: Minor
                          Found in src/pad.js - About 1 hr to fix

                            Function go has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              async function go () {
                                function yank () {
                                  selectedMessageTable.selectedElement.scrollIntoView({ block: 'center' })
                                }
                            
                            
                            Severity: Minor
                            Found in src/chat/infinite.js - About 1 hr to fix

                              Function syncTableToArray has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              function syncTableToArray (table, things, createNewRow) {
                                let foundOne
                                let row
                                let i
                              
                              
                              Severity: Minor
                              Found in src/utils.js - About 1 hr to fix

                                Function askName has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                buttons.askName = function (dom, kb, container, predicate, klass, noun) {
                                  // eslint-disable-next-line promise/param-names
                                  return new Promise(function (resolve, _reject) {
                                    var form = dom.createElement('div') // form is broken as HTML behaviour can resurface on js error
                                    // classLabel = utils.label(ns.vcard('Individual'))
                                Severity: Minor
                                Found in src/widgets/buttons.js - About 1 hr to fix

                                  Function render has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    render () {
                                      const container = document.createElement('div')
                                      container.style.display = 'flex'
                                  
                                      // TODO: take a look at UI.widgets.setName
                                  Severity: Minor
                                  Found in src/widgets/peoplePicker.js - About 1 hr to fix

                                    Function getPreferencesForClass has 34 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    function getPreferencesForClass (subject, klass, predicates, context) {
                                      return new Promise(function (resolve, reject) {
                                        recordSharedPreferences(subject, context).then(context => {
                                          var sharedPreferences = context.sharedPreferences
                                          if (context.me) {
                                    Severity: Minor
                                    Found in src/preferences.js - About 1 hr to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language