michielbdejong/solid-panes

View on GitHub

Showing 327 of 327 total issues

Function showForms has 172 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    var showForms = function () {
      clearElement(naviCenter) // Remove refresh button if nec
      var div = naviMain
      var wizard = true
      var currentSlide = 0
Severity: Major
Found in src/schedule/schedulePane.js - About 6 hrs to fix

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

        var oderByDate = function (x, y) {
          const dx = kb.any(x, ns.qu('date'))
          const dy = kb.any(y, ns.qu('date'))
          if (dx !== undefined && dy !== undefined) {
            if (dx.value < dy.value) return -1
    Severity: Major
    Found in src/transaction/pane.js and 1 other location - About 6 hrs to fix
    src/transaction/period.js on lines 97..107

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

    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 oderByDate = function (x, y) {
            const dx = kb.any(x, ns.qu('date'))
            const dy = kb.any(y, ns.qu('date'))
            if (dx !== undefined && dy !== undefined) {
              if (dx.value < dy.value) return -1
    Severity: Major
    Found in src/transaction/period.js and 1 other location - About 6 hrs to fix
    src/transaction/pane.js on lines 117..127

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

    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 statementsAsTables has 164 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      statementsAsTables: function statementsAsTables (sts, context, initialRoots) {
        var myDocument = context.dom
        // var outliner = context.getOutliner(myDocument)
        var rep = myDocument.createElement('table')
        var sz = UI.rdf.Serializer(context.session.store)
    Severity: Major
    Found in src/dataContentPane.js - About 6 hrs to fix

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

        render: function (subject, context) {
          var dom = context.dom
          var kb = context.session.store
          var ns = UI.ns
      
      
      Severity: Major
      Found in src/ui/pane.js - About 6 hrs to fix

        Function expandedHeaderTR has 162 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          async function expandedHeaderTR (subject, requiredPane, options) {
            async function renderPaneIconTray (td, options = {}) {
              const paneShownStyle =
                'width: 24px; border-radius: 0.5em; border-top: solid #222 1px; border-left: solid #222 0.1em; border-bottom: solid #eee 0.1em; border-right: solid #eee 0.1em; margin-left: 1em; padding: 3px; background-color:   #ffd;'
              const paneHiddenStyle =
        Severity: Major
        Found in src/outline/manager.js - About 6 hrs to fix

          Function outlineExpand has 158 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            function outlineExpand (p, subject1, options) {
              options = options || {}
              var pane = options.pane
              var already = !!options.already
              var immediate = options.immediate
          Severity: Major
          Found in src/outline/manager.js - About 6 hrs to fix

            Function fillInRequest has 156 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                fillInRequest: function fillInRequest (type, selectedTd, inputTerm) {
                  var tr = selectedTd.parentNode
                  var stat
                  var isInverse
                  stat = tr.AJAR_statement
            Severity: Major
            Found in src/outline/userInput.js - About 6 hrs to fix

              File socialPane.js has 426 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              /*   Social Pane
               **
               **  This outline pane provides social network functions
               **  Using for example the FOAF ontology.
               **  Goal:  A *distributed* version of facebook, advogato, etc etc
              Severity: Minor
              Found in src/socialPane.js - About 6 hrs to fix

                File padPane.ts has 423 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                import { authn, icons, ns, pad, widgets } from 'solid-ui'
                // @@ TODO: serialize is not part rdflib type definitions
                // Might be fixed in https://github.com/linkeddata/rdflib.js/issues/341
                // @ts-ignore
                import { graph, log, NamedNode, Namespace, sym, serialize, UpdateManager, Fetcher } from 'rdflib'
                Severity: Minor
                Found in src/pad/padPane.ts - About 6 hrs to fix

                  Function statementsAsTables has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
                  Open

                    statementsAsTables: function statementsAsTables (sts, context, initialRoots) {
                      var myDocument = context.dom
                      // var outliner = context.getOutliner(myDocument)
                      var rep = myDocument.createElement('table')
                      var sz = UI.rdf.Serializer(context.session.store)
                  Severity: Minor
                  Found in src/dataContentPane.js - About 6 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 mintNew has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring.
                  Open

                    mintNew: function (context, options) {
                      return new Promise(function (resolve, reject) {
                        var ns = UI.ns
                        var kb = context.session.store
                        var newBase = options.newBase
                  Severity: Minor
                  Found in src/schedule/schedulePane.js - About 6 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 render has 143 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    render: function (subject, context) {
                      const kb = context.session.store
                      const dom = context.dom
                      var options = {
                        autoplay: false,
                  Severity: Major
                  Found in src/audio/audioPane.js - About 5 hrs to fix

                    Function OutlinerKeypressPanel has 136 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      this.OutlinerKeypressPanel = function OutlinerKeypressPanel (e) {
                        UI.log.info('Key ' + e.keyCode + ' pressed')
                    
                        function showURI (about) {
                          if (about && dom.getElementById('UserURI')) {
                    Severity: Major
                    Found in src/outline/manager.js - About 5 hrs to fix

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

                        render: function (subject, context) {
                          const kb = context.session.store
                          const dom = context.dom
                      
                          var mention = function complain (message, style) {
                      Severity: Major
                      Found in src/form/pane.js - About 5 hrs to fix

                        File attachPane.js has 388 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        /*   Attachment Pane
                         **
                         ** - Attach a document to a thing
                         **  - View attachments
                         ** - Look at all unattached Supporting Documents.
                        Severity: Minor
                        Found in src/attach/attachPane.js - About 5 hrs to fix

                          Function generateNewMB has 129 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              Microblog.prototype.generateNewMB = function (id, name, avatar, loc) {
                                var host = loc + '/' + id
                                var rememberMicroblog = function () {
                                  UI.preferences.set('acct', host + '#' + id)
                                }
                          Severity: Major
                          Found in src/microblogPane/microblogPane.js - About 5 hrs to fix

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

                                Favorites.prototype.add = function (post, callback) {
                                  var batch = new UI.rdf.Statement(
                                    this.favoritesURI,
                                    SIOC('container_of'),
                                    kb.sym(post),
                            Severity: Major
                            Found in src/microblogPane/microblogPane.js and 1 other location - About 5 hrs to fix
                            src/microblogPane/microblogPane.js on lines 112..125

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

                            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

                                Favorites.prototype.remove = function (post, callback) {
                                  var batch = new UI.rdf.Statement(
                                    this.favoritesURI,
                                    SIOC('container_of'),
                                    kb.sym(post),
                            Severity: Major
                            Found in src/microblogPane/microblogPane.js and 1 other location - About 5 hrs to fix
                            src/microblogPane/microblogPane.js on lines 98..111

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

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

                              render: function (subject, context) {
                                const kb = context.session.store
                                const dom = context.dom
                                var options = {
                                  autoplay: false,
                            Severity: Minor
                            Found in src/audio/audioPane.js - About 5 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

                            Severity
                            Category
                            Status
                            Source
                            Language