michielbdejong/solid-ui

View on GitHub

Showing 337 of 337 total issues

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

module.exports = function (dom, kb, subject, messageStore, options) {
  kb = kb || UI.store
  messageStore = messageStore.doc() // No hash
  var ns = UI.ns
  var WF = $rdf.Namespace('http://www.w3.org/2005/01/wf/flow#')
Severity: Major
Found in src/messageArea.js and 1 other location - About 2 wks to fix
src/chat/thread.js on lines 20..384

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

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

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

module.exports = function (dom, kb, subject, messageStore, options) {
  kb = kb || UI.store
  messageStore = messageStore.doc() // No hash
  var ns = UI.ns
  var WF = $rdf.Namespace('http://www.w3.org/2005/01/wf/flow#')
Severity: Major
Found in src/chat/thread.js and 1 other location - About 2 wks to fix
src/messageArea.js on lines 20..384

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

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

module.exports = function renderTableViewPane (doc, options) {
  var sourceDocument = options.sourceDocument
  var tableClass = options.tableClass
  var givenQuery = options.query

Severity: Minor
Found in src/table.js - About 1 wk 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 renderTableViewPane has 1064 lines of code (exceeds 25 allowed). Consider refactoring.
Open

module.exports = function renderTableViewPane (doc, options) {
  var sourceDocument = options.sourceDocument
  var tableClass = options.tableClass
  var givenQuery = options.query

Severity: Major
Found in src/table.js - About 5 days to fix

    File forms.js has 1645 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /*       F O R M S
     *
     *      A Vanilla Dom implementation of the form language
     */
    
    
    Severity: Major
    Found in src/widgets/forms.js - About 4 days to fix

      Function notepad has a Cognitive Complexity of 184 (exceeds 5 allowed). Consider refactoring.
      Open

      UI.pad.notepad = function (dom, padDoc, subject, me, options) {
        options = options || {}
        var exists = options.exists
        var table = dom.createElement('table')
        var kb = UI.store
      Severity: Minor
      Found in src/pad.js - About 3 days 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 infiniteMessageArea has a Cognitive Complexity of 181 (exceeds 5 allowed). Consider refactoring.
      Open

      export function infiniteMessageArea (dom, kb, chatChannel, options) {
        kb = kb || UI.store
        const ns = UI.ns
        const WF = $rdf.Namespace('http://www.w3.org/2005/01/wf/flow#')
        const DCT = $rdf.Namespace('http://purl.org/dc/terms/')
      Severity: Minor
      Found in src/chat/infinite.js - About 3 days 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 infiniteMessageArea has 584 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export function infiniteMessageArea (dom, kb, chatChannel, options) {
        kb = kb || UI.store
        const ns = UI.ns
        const WF = $rdf.Namespace('http://www.w3.org/2005/01/wf/flow#')
        const DCT = $rdf.Namespace('http://purl.org/dc/terms/')
      Severity: Major
      Found in src/chat/infinite.js - About 2 days to fix

        Function notepad has 580 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        UI.pad.notepad = function (dom, padDoc, subject, me, options) {
          options = options || {}
          var exists = options.exists
          var table = dom.createElement('table')
          var kb = UI.store
        Severity: Major
        Found in src/pad.js - About 2 days to fix

          File table.js has 1075 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          // Table Widget: Format an array of RDF statements as an HTML table.
          //
          // This can operate in one of three modes: when the class of object is given
          // or when the source document from whuch data is taken is given,
          // or if a prepared query object is given.
          Severity: Major
          Found in src/table.js - About 2 days to fix

            File authn.ts has 1031 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            /**
             * signin.js
             *
             * Signing in, signing up, profile and preferences reloading
             * Type index management
            Severity: Major
            Found in src/authn/authn.ts - About 2 days to fix

              File buttons.js has 853 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              /* UI Widgets such as buttons
               */
              /* global alert */
              
              const $rdf = require('rdflib')
              Severity: Major
              Found in src/widgets/buttons.js - About 2 days to fix

                Function matrixForQuery has a Cognitive Complexity of 97 (exceeds 5 allowed). Consider refactoring.
                Open

                module.exports.matrixForQuery = function (
                  dom,
                  query,
                  vx,
                  vy,
                Severity: Minor
                Found in src/matrix.js - About 1 day 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

                File pad.js has 742 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                /** **************
                 *   Notepad Widget
                 */
                
                /** @module UI.pad
                Severity: Major
                Found in src/pad.js - About 1 day to fix

                  Function exports has 307 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  module.exports = function (dom, kb, subject, messageStore, options) {
                    kb = kb || UI.store
                    messageStore = messageStore.doc() // No hash
                    var ns = UI.ns
                    var WF = $rdf.Namespace('http://www.w3.org/2005/01/wf/flow#')
                  Severity: Major
                  Found in src/chat/thread.js - About 1 day to fix

                    Function exports has 307 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    module.exports = function (dom, kb, subject, messageStore, options) {
                      kb = kb || UI.store
                      messageStore = messageStore.doc() // No hash
                      var ns = UI.ns
                      var WF = $rdf.Namespace('http://www.w3.org/2005/01/wf/flow#')
                    Severity: Major
                    Found in src/messageArea.js - About 1 day to fix

                      File infinite.js has 645 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      //  Common code for a discussion are a of messages about something
                      //   This version runs over a series of files for different time periods
                      //
                      //  Parameters for the whole chat like its title are stred on
                      //  index.ttl#this and the chats messages are stored in YYYY/MM/DD/chat.ttl
                      Severity: Major
                      Found in src/chat/infinite.js - About 1 day to fix

                        Function tabWidget has a Cognitive Complexity of 67 (exceeds 5 allowed). Consider refactoring.
                        Open

                        UI.tabs.tabWidget = function (options) {
                          var kb = UI.store
                          var subject = options.subject
                          var dom = options.dom
                          var orientation = parseInt(options.orientation || '0')
                        Severity: Minor
                        Found in src/tabs.js - About 1 day 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 makeSelectForOptions has a Cognitive Complexity of 67 (exceeds 5 allowed). Consider refactoring.
                        Open

                        forms.makeSelectForOptions = function (
                          dom,
                          kb,
                          subject,
                          predicate,
                        Severity: Minor
                        Found in src/widgets/forms.js - About 1 day 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 tabWidget has 234 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        UI.tabs.tabWidget = function (options) {
                          var kb = UI.store
                          var subject = options.subject
                          var dom = options.dom
                          var orientation = parseInt(options.orientation || '0')
                        Severity: Major
                        Found in src/tabs.js - About 1 day to fix
                          Severity
                          Category
                          Status
                          Source
                          Language