michielbdejong/solid-ui

View on GitHub

Showing 270 of 337 total issues

Function ontologyLabel has 34 lines of code (exceeds 25 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

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

      var rowFor = function (y1) {
        var y = y1.toNT()
        if (rows[y]) return rows[y]
        var tr = dom.createElement('tr')
        var header = tr.appendChild(dom.createElement('td'))
    Severity: Minor
    Found in src/matrix.js - About 1 hr to fix

      Function findBookmarkDocument has 33 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export async function findBookmarkDocument (userContext) {
        const klass = BOOK('Bookmark')
        const fileTail = 'bookmarks.ttl'
        const isPublic = true
      
      
      Severity: Minor
      Found in src/chat/bookmarks.js - About 1 hr to fix

        Function msg has 33 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          logger.msg = function (str, type, typestr) {
            if (!type) {
              type = TMESG
              typestr = 'mesg'
            }
        Severity: Minor
        Found in src/log.js - About 1 hr to fix

          Function recordParticipation has 33 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          UI.pad.recordParticipation = function (subject, padDoc, refreshable) {
            var me = UI.authn.currentUser()
            if (!me) return // Not logged in
          
            var parps = kb.each(subject, ns.wf('participation')).filter(function (pn) {
          Severity: Minor
          Found in src/pad.js - About 1 hr to fix

            Function logInLoadProfile has 33 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export function logInLoadProfile (context: AuthenticationContext): Promise<AuthenticationContext> {
              if (context.publicProfile) {
                return Promise.resolve(context)
              } // already done
              const fetcher = kb.fetcher
            Severity: Minor
            Found in src/authn/authn.ts - About 1 hr to fix

              Function shortName has 32 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function shortName (uri) {
                let p = uri
                if ('#/'.indexOf(p[p.length - 1]) >= 0) p = p.slice(0, -1)
                const namespaces = []
                for (const ns in this.prefixes) {
              Severity: Minor
              Found in src/utils.js - About 1 hr to fix

                Function selectorPanelRefresh has 10 arguments (exceeds 4 allowed). Consider refactoring.
                Open

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

                  Function findBookmarkDocument has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export async function findBookmarkDocument (userContext) {
                    const klass = BOOK('Bookmark')
                    const fileTail = 'bookmarks.ttl'
                    const isPublic = true
                  
                  
                  Severity: Minor
                  Found in src/chat/bookmarks.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 getTerm has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function getTerm (target) {
                    var statementTr = target.parentNode
                    var st = statementTr ? statementTr.AJAR_statement : undefined
                  
                    var className = st ? target.className : '' // if no st then it's necessary to use getAbout
                  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 findImageFromURI has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                  buttons.findImageFromURI = function findImageFromURI (x) {
                    const iconDir = UI.icons.iconBase
                  
                    // Special cases from URI scheme:
                    if (x.uri) {
                  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

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

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

                  export function makeACLGraphbyCombo (
                    kb: $rdf.IndexedFormula,
                    x: $rdf.NamedNode,
                    byCombo: ComboList,
                    aclDoc: $rdf.NamedNode,
                  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 makeDescription has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                  forms.makeDescription = 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 addNewTableIfNewDay has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    async function addNewTableIfNewDay (now) {
                      // let now = new Date()
                      // @@ Remove listener from previous table as it is now static
                      const newChatDocument = dateFolder.leafDocumentFromDate(now)
                      if (!newChatDocument.sameTerm(latest.messageTable.chatDocument)) {
                  Severity: Minor
                  Found in src/chat/infinite.js - About 1 hr to fix

                    Function makeDraggable has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function makeDraggable (tr, obj) {
                      tr.setAttribute('draggable', 'true') // Stop the image being dragged instead - just the TR
                    
                      tr.addEventListener(
                        'dragstart',
                    Severity: Minor
                    Found in src/widgets/dragAndDrop.js - About 1 hr to fix

                      Function add has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        add (webId) {
                          return new Promise((resolve, reject) => {
                            kb.fetcher.nowOrWhenFetched(webId, (ok, err) => {
                              if (!ok) {
                                this.onGroupChanged(err)
                      Severity: Minor
                      Found in src/widgets/peoplePicker.js - About 1 hr to fix

                        Function shortDate has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        buttons.shortDate = function (str, noTime) {
                          if (!str) return '???'
                          var month = [
                            'Jan',
                            'Feb',
                        Severity: Minor
                        Found in src/widgets/buttons.js - About 1 hr to fix

                          Function fileUploadButtonDiv has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          buttons.fileUploadButtonDiv = function fileUploadButtonDiv (
                            dom,
                            droppedFileHandler
                          ) {
                            const div = dom.createElement('div')
                          Severity: Minor
                          Found in src/widgets/buttons.js - About 1 hr to fix

                            Function findAddressBook has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              findAddressBook (typeIndex) {
                                return new Promise((resolve, reject) => {
                                  kb.fetcher.nowOrWhenFetched(typeIndex, (ok, err) => {
                                    if (!ok) {
                                      return reject(err)
                            Severity: Minor
                            Found in src/widgets/peoplePicker.js - About 1 hr to fix
                              Severity
                              Category
                              Status
                              Source
                              Language