michielbdejong/solid-ui

View on GitHub

Showing 270 of 337 total issues

Function registrationControl has 78 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function registrationControl (
  context: AuthenticationContext,
  instance,
  klass
): Promise<AuthenticationContext | void> {
Severity: Major
Found in src/authn/authn.ts - About 3 hrs to fix

    Function sameACL has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
    Open

    export function sameACL (a: AgentMapMap, b: AgentMapMap): boolean {
      const contains = function (a, b) {
        for (const pred in {
          agent: true,
          agentClass: true,
    Severity: Minor
    Found in src/acl/acl.ts - About 3 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 label has 77 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function label (x, initialCap) {
      // x is an object
      function doCap (s) {
        // s = s.toString()
        if (initialCap) return s.slice(0, 1).toUpperCase() + s.slice(1)
    Severity: Major
    Found in src/utils.js - About 3 hrs to fix

      Function renderMessage has 75 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        var renderMessage = function (bindings, fresh) {
          var creator = bindings['?creator']
          var message = bindings['?msg']
          var date = bindings['?date']
          var content = bindings['?content']
      Severity: Major
      Found in src/chat/thread.js - About 3 hrs to fix

        Function renderMessage has 75 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          var renderMessage = function (bindings, fresh) {
            var creator = bindings['?creator']
            var message = bindings['?msg']
            var date = bindings['?date']
            var content = bindings['?content']
        Severity: Major
        Found in src/messageArea.js - About 3 hrs to fix

          Function logInLoadPreferences has 73 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export function logInLoadPreferences (context: AuthenticationContext): Promise<AuthenticationContext> {
            if (context.preferencesFile) return Promise.resolve(context) // already done
          
            const statusArea = context.statusArea || context.div || null
            let progressDisplay
          Severity: Major
          Found in src/authn/authn.ts - About 2 hrs to fix

            Function updateStore has 71 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                var updateStore = function (part) {
                  var chunk = part.subject
                  setPartStyle(part, undefined, true)
                  var old = kb.any(chunk, ns.sioc('content')).value
                  var del = [$rdf.st(chunk, ns.sioc('content'), old, padDoc)]
            Severity: Major
            Found in src/pad.js - About 2 hrs to fix

              Function callbackWS has 71 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                    function callbackWS (ws, newBase) {
                      UI.authn.logInLoadProfile(createContext).then(
                        _context => {
                          var newPaneOptions = {
                            newBase: newBase,
              Severity: Major
              Found in src/create.js - About 2 hrs to fix

                Function attachmentList has 69 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                buttons.attachmentList = function (dom, subject, div, options) {
                  options = options || {}
                  var doc = options.doc || subject.doc()
                  if (options.modify === undefined) options.modify = true
                  var modify = options.modify
                Severity: Major
                Found in src/widgets/buttons.js - About 2 hrs to fix

                  Function runQuery has 68 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    function runQuery (query, rows, columns, table) {
                      query.running = true
                      var startTime = Date.now()
                  
                      var progressMessage = doc.createElement('tr')
                  Severity: Major
                  Found in src/table.js - About 2 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 recordPersonalDefaults has 66 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      function recordPersonalDefaults (klass, context) {
                        return new Promise(function (resolve, reject) {
                          authn.logInLoadPreferences(context).then(
                            context => {
                              if (!context.preferencesFile) {
                      Severity: Major
                      Found in src/preferences.js - About 2 hrs to fix

                        Function newChunk has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          var newChunk = function (ele, before) {
                            // element of chunk being split
                            var kb = UI.store
                            var indent = 0
                            var queueProperty = null
                        Severity: Major
                        Found in src/pad.js - About 2 hrs to fix

                          Function uploadFiles has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          function uploadFiles (fetcher, files, fileBase, imageBase, successHandler) {
                            for (var i = 0; files[i]; i++) {
                              const f = files[i]
                              console.log(
                                ' dropped: Filename: ' +
                          Severity: Major
                          Found in src/widgets/dragAndDrop.js - About 2 hrs to fix

                            Function promptForNew has 65 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            forms.promptForNew = function (
                              dom,
                              kb,
                              subject,
                              predicate,
                            Severity: Major
                            Found in src/widgets/forms.js - About 2 hrs to fix

                              Function selectorPanelRefresh has 64 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              buttons.selectorPanelRefresh = function (
                                list,
                                dom,
                                kb,
                                type,
                              Severity: Major
                              Found in src/widgets/buttons.js - About 2 hrs to fix

                                Function sendMessage has 63 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    async function sendMessage (text) {
                                      var now = new Date()
                                      await addNewTableIfNewDay(now)
                                
                                      if (!text) {
                                Severity: Major
                                Found in src/chat/infinite.js - About 2 hrs to fix

                                  Function ensureOneTypeIndex has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  async function ensureOneTypeIndex (context: AuthenticationContext, isPublic: boolean): Promise<AuthenticationContext | void> {
                                    async function makeIndexIfNecessary (context, isPublic) {
                                      const relevant = isPublic ? context.publicProfile : context.preferencesFile
                                      const visibility = isPublic ? 'public' : 'private'
                                  
                                  
                                  Severity: Major
                                  Found in src/authn/authn.ts - About 2 hrs to fix

                                    Function wrapper has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                    var wrapper = function () {
                                      var logger = {}
                                    
                                      // ///////////////////////  Logging
                                      //
                                    Severity: Minor
                                    Found in src/log.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 turnOnInput has 59 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                        function turnOnInput () {
                                          if (options.menuHandler && menuButton) {
                                            const menuOptions = {
                                              me,
                                              dom,
                                    Severity: Major
                                    Found in src/chat/infinite.js - About 2 hrs to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language