michielbdejong/solid-panes

View on GitHub

Showing 327 of 327 total issues

Function exports has a Cognitive Complexity of 699 (exceeds 5 allowed). Consider refactoring.
Open

module.exports = function (context) {
  const dom = context.dom

  this.document = context.dom
  this.outlineIcons = outlineIcons
Severity: Minor
Found in src/outline/manager.js - About 2 wks 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 exports has 1847 lines of code (exceeds 25 allowed). Consider refactoring.
Open

module.exports = function (context) {
  const dom = context.dom

  this.document = context.dom
  this.outlineIcons = outlineIcons
Severity: Major
Found in src/outline/manager.js - About 1 wk to fix

    Function UserInput has a Cognitive Complexity of 444 (exceeds 5 allowed). Consider refactoring.
    Open

    module.exports = function UserInput (outline) {
      var kb = UI.store
    
      var myDocument = outline.document // is this ok?
      // UI.log.warn("myDocument when it's set is "+myDocument.location);
    Severity: Minor
    Found in src/outline/userInput.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 UserInput has 1799 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    module.exports = function UserInput (outline) {
      var kb = UI.store
    
      var myDocument = outline.document // is this ok?
      // UI.log.warn("myDocument when it's set is "+myDocument.location);
    Severity: Major
    Found in src/outline/userInput.js - About 1 wk to fix

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

        render: function (s, doc) {
          //* **********************************************
          // NAMESPACES  SECTION
          //* **********************************************
          var SIOC = UI.rdf.Namespace('http://rdfs.org/sioc/ns#')
      Severity: Minor
      Found in src/microblogPane/microblogPane.js - About 6 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 render has 1198 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        render: function (s, doc) {
          //* **********************************************
          // NAMESPACES  SECTION
          //* **********************************************
          var SIOC = UI.rdf.Namespace('http://rdfs.org/sioc/ns#')
      Severity: Major
      Found in src/microblogPane/microblogPane.js - About 5 days to fix

        File manager.js has 1856 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        /* -*- coding: utf-8-dos -*-
           Outline Mode Manager
        */
        var panes = require('pane-registry')
        const $rdf = require('rdflib')
        Severity: Major
        Found in src/outline/manager.js - About 5 days to fix

          File userInput.js has 1806 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          // Original author: kennyluck
          //
          // Kenny's Notes:
          /* places to generate SPARQL update: clearInputAndSave() pasteFromClipboard()->insertTermTo();
                                            undetermined statement generated formUndetStat()
          Severity: Major
          Found in src/outline/userInput.js - About 4 days to fix

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

              render: function (s, context) {
                var dom = context.dom
                var common = function (x, y) {
                  // Find common members of two lists
                  var both = []
            Severity: Minor
            Found in src/socialPane.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

            File microblogPane.js has 1212 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            /*
             Microblog pane
             Charles McKenzie <charles2@mit.edu>
            */
            /* global alert */
            Severity: Major
            Found in src/microblogPane/microblogPane.js - About 3 days to fix

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

                render: function (subject, context) {
                  const dom = context.dom
                  var kb = context.session.store
                  var ns = UI.ns
                  var invitation = subject
              Severity: Major
              Found in src/schedule/schedulePane.js - About 3 days to fix

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

                  render: function (subject, context) {
                    const dom = context.dom
                    var kb = context.session.store
                    var ns = UI.ns
                
                
                Severity: Minor
                Found in src/transaction/period.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

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

                        var transactionRow = function (dom, x) {
                          var tr = dom.createElement('tr')
                
                          var setTRStyle = function (tr, account) {
                            // var mystyle = "padding: 0.5em 1.5em 1em 1.5em; ";
                Severity: Major
                Found in src/transaction/period.js and 1 other location - About 2 days to fix
                src/transaction/pane.js on lines 184..230

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

                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

                      var transactionRow = function (dom, x) {
                        var tr = dom.createElement('tr')
                
                        var setTRStyle = function (tr, account) {
                          // var mystyle = "padding: 0.5em 1.5em 1em 1.5em; "
                Severity: Major
                Found in src/transaction/pane.js and 1 other location - About 2 days to fix
                src/transaction/period.js on lines 183..228

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

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

                  render: function (subject, context) {
                    const dom = context.dom
                    var kb = context.session.store
                    var fetcher = kb.fetcher
                    var Q = $rdf.Namespace('http://www.w3.org/2000/10/swap/pim/qif#')
                Severity: Major
                Found in src/transaction/pane.js - About 2 days to fix

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

                    render: function (subject, context) {
                      const dom = context.dom
                      var kb = context.session.store
                      var WF = $rdf.Namespace('http://www.w3.org/2005/01/wf/flow#')
                      var QU = $rdf.Namespace('http://www.w3.org/2000/10/swap/pim/qif#')
                  Severity: Minor
                  Found in src/attach/attachPane.js - About 2 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

                  File schedulePane.js has 861 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  /*   Scheduler Pane
                   **
                   **
                   */
                  /* global alert */
                  Severity: Major
                  Found in src/schedule/schedulePane.js - About 2 days to fix

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

                      render: function (s, context) {
                        var dom = context.dom
                        var common = function (x, y) {
                          // Find common members of two lists
                          var both = []
                    Severity: Major
                    Found in src/socialPane.js - About 2 days to fix

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

                        render: function (subject, context, paneOptions: any) {
                          const dom = context.dom
                          const store = context.session.store
                          // Utility functions
                          var complainIfBad = function (ok: boolean, message: string) {
                      Severity: Major
                      Found in src/pad/padPane.ts - About 1 day to fix

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

                          render: function (subject, context) {
                            const dom = context.dom
                            var kb = context.session.store
                            var WF = $rdf.Namespace('http://www.w3.org/2005/01/wf/flow#')
                            var QU = $rdf.Namespace('http://www.w3.org/2000/10/swap/pim/qif#')
                        Severity: Major
                        Found in src/attach/attachPane.js - About 1 day to fix
                          Severity
                          Category
                          Status
                          Source
                          Language