michielbdejong/solid-panes

View on GitHub
src/dataContentPane.js

Summary

Maintainability
D
2 days
Test Coverage

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

        function objectTree (obj) {
          var res, anchor
          switch (obj.termType) {
            case 'NamedNode':
              anchor = myDocument.createElement('a')
    Severity: Major
    Found in src/dataContentPane.js - About 2 hrs to fix

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

        render: function (subject, context) {
          var myDocument = context.dom
      
          function alternativeRendering () {
            var sz = UI.rdf.Serializer(context.session.store)
      Severity: Major
      Found in src/dataContentPane.js - About 2 hrs to fix

        Function propertyTree has 44 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            function propertyTree (subject) {
              // print('Proprty tree for '+subject)
              var rep = myDocument.createElement('table')
              var lastPred = null
              var sts = subjects[sz.toStr(subject)] // relevant statements
        Severity: Minor
        Found in src/dataContentPane.js - About 1 hr to fix

          Function render has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
          Open

            render: function (subject, context) {
              var myDocument = context.dom
          
              function alternativeRendering () {
                var sz = UI.rdf.Serializer(context.session.store)
          Severity: Minor
          Found in src/dataContentPane.js - About 45 mins 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

          Avoid too many return statements within this function.
          Open

                    return newTable
          Severity: Major
          Found in src/dataContentPane.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                      return res
            Severity: Major
            Found in src/dataContentPane.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                          return anchor
              Severity: Major
              Found in src/dataContentPane.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                          return res
                Severity: Major
                Found in src/dataContentPane.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                            return res
                  Severity: Major
                  Found in src/dataContentPane.js - About 30 mins to fix

                    There are no issues that match your filters.

                    Category
                    Status