michielbdejong/solid-ui

View on GitHub
src/widgets/peoplePicker.js

Summary

Maintainability
D
2 days
Test Coverage

File peoplePicker.js has 456 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 *
 * People Picker Pane
 *
 * This pane offers a mechanism for selecting a set of individuals, groups, or
Severity: Minor
Found in src/widgets/peoplePicker.js - About 6 hrs to fix

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

      render () {
        const container = document.createElement('div')
        container.style.maxWidth = '350px'
        container.style.minHeight = '200px'
        container.style.outline = '1px solid black'
    Severity: Major
    Found in src/widgets/peoplePicker.js - About 2 hrs to fix

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

        render () {
          const dropContainer = document.createElement('div')
          dropContainer.style.maxWidth = '350px'
          dropContainer.style.minHeight = '200px'
          dropContainer.style.outline = '1px solid black'
      Severity: Major
      Found in src/widgets/peoplePicker.js - About 2 hrs 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 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 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 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

                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

                  There are no issues that match your filters.

                  Category
                  Status