michielbdejong/solid-ui

View on GitHub

Showing 337 of 337 total issues

Function onload has 48 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    reader.onload = (function (theFile) {
      return function (e) {
        var data = e.target.result
        var suffix = ''
        console.log(' File read byteLength : ' + data.byteLength)
Severity: Minor
Found in src/widgets/dragAndDrop.js - About 1 hr to fix

    Function clearOldCells has 48 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      var clearOldCells = function () {
        var row, cell
        var colsUsed = []
        var rowsUsed = []
    
    
    Severity: Minor
    Found in src/matrix.js - About 1 hr to fix

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

      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 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

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

        buttons.refreshTree = function refreshTree (root) {
          if (root.refresh) {
            root.refresh()
            return
          }
        Severity: Major
        Found in src/widgets/buttons.js and 1 other location - About 1 hr to fix
        src/pad.js on lines 811..819

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 72.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

          var refreshTree = function (root) {
            if (root.refresh) {
              root.refresh()
              return
            }
        Severity: Major
        Found in src/pad.js and 1 other location - About 1 hr to fix
        src/widgets/buttons.js on lines 582..590

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 72.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        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

                          Similar blocks of code found in 2 locations. Consider refactoring.
                          Open

                                () => this.addAgent(ns.acl('AuthenticatedAgent').uri)
                                  .then(() => this.groupList.controller.renderTemporaryStatus('Adding anyone logged in to those who can read. Drag the ID icon to a different level to give them more access.'))
                                  .then(() => this.renderCleanup()))
                          Severity: Major
                          Found in src/acl/add-agent-buttons.ts and 1 other location - About 1 hr to fix
                          src/acl/add-agent-buttons.ts on lines 104..106

                          Duplicated Code

                          Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                          Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                          When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                          Tuning

                          This issue has a mass of 69.

                          We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                          The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                          If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                          See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                          Refactorings

                          Further Reading

                          Severity
                          Category
                          Status
                          Source
                          Language