michielbdejong/solid-ui

View on GitHub

Showing 270 of 337 total issues

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

function renderPreferencesForm (subject, klass, preferencesForm, context) {
  var prefContainer = context.dom.createElement('div')
  pad.participationObject(subject, subject.doc(), context.me).then(
    participation => {
      const dom = context.dom
Severity: Major
Found in src/preferences.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 syncTableToArray has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
      Open

      function syncTableToArray (table, things, createNewRow) {
        let foundOne
        let row
        let i
      
      
      Severity: Minor
      Found in src/utils.js - About 2 hrs 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 renderLiteralSelector has 56 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        function renderLiteralSelector (rows, columns, column) {
          var result = doc.createElement('div')
      
          var textBox = doc.createElement('input')
          textBox.setAttribute('type', 'text')
      Severity: Major
      Found in src/table.js - About 2 hrs to fix

        AddAgentButtons has 21 functions (exceeds 20 allowed). Consider refactoring.
        Open

        export class AddAgentButtons {
          private readonly rootElement: HTMLElement
          private readonly barElement: HTMLElement
          private isExpanded: boolean = false
        
        
        Severity: Minor
        Found in src/acl/add-agent-buttons.ts - About 2 hrs to fix

          Function loadPrevious has 53 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            async loadPrevious (date, backwards) {
              const thisDateFolder = this
              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
          Severity: Major
          Found in src/chat/dateFolder.js - About 2 hrs to fix

            Function tryParent has 53 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                const tryParent = function (uri) {
                  if (uri.slice(-1) === '/') {
                    uri = uri.slice(0, -1)
                  }
                  const right = uri.lastIndexOf('/')
            Severity: Major
            Found in src/acl/acl.ts - About 2 hrs to fix

              Function sentimentButton has 52 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                function sentimentButton (
                  context,
                  target,
                  icon,
                  actionClass,
              Severity: Major
              Found in src/chat/messageTools.js - About 2 hrs to fix

                Function refreshItem has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  var refreshItem = function (box, x) {
                    // Scope to hold item and x
                    var item, image
                
                    var setStyle = function () {
                Severity: Major
                Found in src/widgets/buttons.js - About 2 hrs to fix

                  Function consistencyCheck has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    var consistencyCheck = function () {
                      var found = []
                      var failed = 0
                      function complain2 (msg) {
                        complain(msg)
                  Severity: Major
                  Found in src/pad.js - About 2 hrs to fix

                    Function dropListener has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      var dropListener = function (e) {
                        if (e.preventDefault) e.preventDefault() // stops the browser from redirecting off to the text.
                        console.log('Drop event. dropEffect: ' + e.dataTransfer.dropEffect)
                        console.log(
                          'Drop event. types: ' +
                    Severity: Minor
                    Found in src/widgets/dragAndDrop.js - About 2 hrs to fix

                      Function firstLeaf has 50 lines of code (exceeds 25 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 2 hrs to fix

                        Function sync has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          var sync = function () {
                            // var first = kb.the(subject, PAD('next'))
                            if (kb.each(subject, PAD('next')).length !== 1) {
                              var msg =
                                'Pad: Inconsistent data - NEXT pointers: ' +
                        Severity: Minor
                        Found in src/pad.js - About 2 hrs to fix

                          Function signInOrSignUpBox has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          function signInOrSignUpBox (
                            dom: HTMLDocument,
                            setUserCallback: (user: string) => void,
                            options: {
                              buttonStyle?: string
                          Severity: Minor
                          Found in src/authn/authn.ts - About 2 hrs to fix

                            Function boxHandler has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              var boxHandler = function (_e) {
                                tx.style = 'color: #bbb;' // grey -- not saved yet
                                var toDelete = input.state === true ? ins : input.state === false ? del : []
                                input.newState =
                                  input.state === null
                            Severity: Minor
                            Found in src/widgets/forms.js - About 2 hrs to fix

                              Function orderedSync has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                var orderedSync = function () {
                                  var items = getItems()
                                  if (!vertical) {
                                    // mainElement.setAttribute('colspan', items.length + (onClose ? 1 : 0))
                                  }
                              Severity: Minor
                              Found in src/tabs.js - About 1 hr to fix

                                Function deleteFolder has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                module.exports.deleteFolder = function (folder, store, dom) {
                                  store = store || UI.store
                                  if (typeof docuent !== 'undefined') {
                                    dom = dom || document
                                  }
                                Severity: Minor
                                Found in src/folders.js - About 1 hr to fix

                                  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

                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language