michielbdejong/solid-panes

View on GitHub

Showing 243 of 327 total issues

Function licenseOptions has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
Open

module.exports = function licenseOptions () {
  this.options = {}
  this.references = []
  this.checkedLicenses = []

Severity: Minor
Found in src/outline/licenseOptions.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 render has 67 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  render: function (subject, context) {
    var dom = context.dom

    var filter = function (pred, inverse) {
      if (
Severity: Major
Found in src/defaultPane.js - About 2 hrs to fix

    Function DDM has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
    Open

    dragAndDrop.util.DDM = (function DDM () {
      return {
        handleMouseDown: function (e, oDD) {
          // this.currentTarget = dragAndDrop.util.Event.getTarget(e)
    
    
    Severity: Minor
    Found in src/outline/dragDrop.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 render has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
    Open

      render: function (subject, context) {
        const myDocument = context.dom
        function isVideo (src, _index) {
          if (!src) {
            return {
    Severity: Minor
    Found in src/playlist/playlistPane.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 render has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
    Open

      render: function (subject, context) {
        var dom = context.dom
        var outliner = context.getOutliner(dom)
        var kb = context.session.store
        var complain = function complain (message, color) {
    Severity: Minor
    Found in src/classInstancePane.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 boxHandler has 64 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

          var boxHandler = function (_e) {
            tx.className = 'pendingedit'
            // alert('Should be greyed out')
            if (this.checked) {
              // Add link
    Severity: Major
    Found in src/socialPane.js - About 2 hrs to fix

      Function getDashboardItems has 60 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        async function getDashboardItems () {
          const me = UI.authn.currentUser()
          const div = dom.createElement('div')
          const [books, pods] = await Promise.all([getAddressBooks(), getPods()])
          return [
      Severity: Major
      Found in src/outline/manager.js - About 2 hrs to fix

        Function walk has 60 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          this.walk = function walk (directionCode, inputTd) {
            var selectedTd = inputTd || selection[0]
            var newSelTd
            switch (directionCode) {
              case 'down':
        Severity: Major
        Found in src/outline/manager.js - About 2 hrs to fix

          Function lsCreateNewMB has 60 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                var lsCreateNewMB = function (_evt) {
                  // disable the create new microblog button.
                  // then prefills the information.
                  xcreateNewMB.disabled = true
                  var xcmb = doc.createElement('div')
          Severity: Major
          Found in src/microblogPane/microblogPane.js - About 2 hrs to fix

            Function triageFriends has 57 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function triageFriends (s) {
                  outgoing = kb.each(s, foaf('knows'))
                  incoming = kb.each(undefined, foaf('knows'), s) // @@ have to load the friends
                  var confirmed = []
                  var unconfirmed = []
            Severity: Major
            Found in src/socialPane.js - About 2 hrs to fix

              Function DDM has 54 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              dragAndDrop.util.DDM = (function DDM () {
                return {
                  handleMouseDown: function (e, oDD) {
                    // this.currentTarget = dragAndDrop.util.Event.getTarget(e)
              
              
              Severity: Major
              Found in src/outline/dragDrop.js - About 2 hrs to fix

                Function label has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                Open

                  label: function (subject, context) {
                    var kb = context.session.store
                    if (
                      !kb.anyStatementMatching(
                        subject,
                Severity: Minor
                Found in src/imagePane.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 render has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  render: (subject, context) => {
                    const dom = context.dom
                    const store = context.session.store
                
                    function complainIfBad (ok: Boolean, mess: any) {
                Severity: Major
                Found in src/dashboard/basicPreferences.ts - About 2 hrs to fix

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

                    render: function (subject, context) {
                      const store = context.session.store
                  
                      async function doRender (
                        container: HTMLElement,
                  Severity: Major
                  Found in src/profile/profile.view.ts - 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 appendAccessIcon has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        this.appendAccessIcon = function (node, uri) {
                          if (!uri) return ''
                          var docuri = UI.rdf.uri.docpart(uri)
                          if (docuri.slice(0, 5) !== 'http:') return ''
                          var state = sf.getState(docuri)
                      Severity: Major
                      Found in src/outline/manager.js - About 2 hrs to fix

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

                              function lsFollowUser () {
                                var myUser = kb.sym(mb.getMyURI())
                                // var Ifollow = that.Ifollow
                                var username = that.creator.name
                                var mbconfirmFollow = function (uri, success, _msg) {
                        Severity: Major
                        Found in src/microblogPane/microblogPane.js - About 2 hrs to fix

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

                              var renderTrip = function renderTrip (subject, thisDiv) {
                                var query = new $rdf.Query(UI.utils.label(subject))
                                var vars = ['date', 'transaction', 'comment', 'type', 'in_USD']
                                var v = {}
                                vars.map(function (x) {
                          Severity: Minor
                          Found in src/trip/tripPane.js - About 2 hrs to fix

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

                              mintNew: function (context, newPaneOptions) {
                                var kb = context.session.store
                                var newInstance = newPaneOptions.newInstance
                                if (!newInstance) {
                                  let uri = newPaneOptions.newBase
                            Severity: Minor
                            Found in src/dokieli/dokieliPane.js - About 2 hrs to fix

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

                                this.outlinePredicateTD = function outlinePredicateTD (
                                  predicate,
                                  newTr,
                                  inverse,
                                  internal
                              Severity: Minor
                              Found in src/outline/manager.js - About 2 hrs to fix
                                Severity
                                Category
                                Status
                                Source
                                Language