creative-connections/Bodylight.js-Components

View on GitHub

Showing 430 of 684 total issues

Function bind has 76 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    bind() {
      super.bind();
      this.plugins = [ChartDataLabels];
      if (this.extremelimits) {
        this.elimits = this.extremelimits.split(','); //split by comma
Severity: Major
Found in src_aurelia-bodylight-plugin/src/elements/chartjs-barplot.js - About 3 hrs to fix

    Function initdygraph has 74 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        initdygraph() {
            console.log('sachart - initdygraph');
            if (this.pH >0) this.data = [[this.pH, this.pCO2]];
            else this.data = [];
            this.xaxis = "pH";
    Severity: Major
    Found in src_aurelia-bodylight-plugin/src/elements/sachart.js - About 2 hrs to fix

      Function constructor has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
      Open

        constructor() {
          //document.getElementById("id${window.ids - 2}").addEventListener("change", myfun${window.ids});
          /*function myfun${window.ids}(event){
              document.getElementById("id${window.ids - 1}").value = event.target.value;
         }*/
      Severity: Minor
      Found in src_aurelia-bodylight-plugin/src/elements/bind2previous.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 getScript has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
      Open

        getScript(source, callback) {
          //check whether the script is not already there
          if (Array.from(document.getElementsByTagName('script')).filter(x=> x.getAttribute('src') === source).length > 0) {
            console.log('fmi.getScript() WARNING, script is already added into DOM:', source);
            //do callback?
      Severity: Minor
      Found in src_aurelia-bodylight-plugin/src/elements/fmi.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 constructor has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
      Open

          constructor() {
            this.handleTick = e => {
              this.currenttick++;
              if (this.currenttick >= this.ticks2reset) {
                //do reset values
      Severity: Minor
      Found in src_aurelia-bodylight-plugin/src/elements/buttonparams.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 getDateAxis has 72 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      Dygraph.getDateAxis = function(start_time, end_time, granularity, opts, dg) {
          var formatter = opts("axisLabelFormatter");
          var ticks = [];
          var t;
      
      
      Severity: Major
      Found in src_aurelia-bodylight-plugin/src/utils/dygraph.js - About 2 hrs to fix

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

            constructor() {
                super();
                console.log('sachart constructor');
                this.xy = true; //set xy chart - datapoint will not contain time point
                this.handleResize = () => {
        Severity: Minor
        Found in src_aurelia-bodylight-plugin/src/elements/sachart.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 bind has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
        Open

          bind() {
            this.refindex = parseInt(this.refindex, 10);
            this.refvalues = parseInt(this.refvalues, 10);
            this.refendindex = this.refindex + this.refvalues;
        
        
        Severity: Minor
        Found in src_aurelia-bodylight-plugin/src/elements/plotly.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 configure has 68 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export function configure(config) {
          config.globalResources([
            PLATFORM.moduleName('./elements/checkbox'),
            PLATFORM.moduleName('./elements/buttonparams'),
            PLATFORM.moduleName('./elements/receptacle.html'),
        Severity: Major
        Found in src_aurelia-bodylight-plugin/src/index.js - About 2 hrs to fix

          Function bind has 67 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            bind() {
              this.useranswer = [];
              this.showquiz=true;
              this.showresult = false;
              this.answers_array = (this.answers)? this.answers.split('|').map(s => s.trim()): [];
          Severity: Major
          Found in src_aurelia-bodylight-plugin/src/elements/quizx.js - About 2 hrs to fix

            Consider simplifying this complex logical expression.
            Open

                    if (!Number.isInteger(unixTsMs) ||
                        !Number.isInteger(randA) ||
                        !Number.isInteger(randBHi) ||
                        !Number.isInteger(randBLo) ||
                        unixTsMs < 0 ||
            Severity: Critical
            Found in src_aurelia-bodylight-plugin/src/utils/uuidv7.js - About 2 hrs to fix

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

              Dygraph.prototype.start_ = function() {
                  var data = this.file_;
              
                  // Functions can return references of all other types.
                  if (typeof data == 'function') {
              Severity: Minor
              Found in src_aurelia-bodylight-plugin/src/utils/dygraph.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 hslToRgb has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
              Open

                  hslToRgb(h, s, l) {
                    let r; let g; let b;
              
                    if (s === 0) {
                      r = g = b = l; // achromatic
              Severity: Minor
              Found in src_aurelia-bodylight-plugin/src/elements/pdb-pdbe-molstar.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 removeAnswer has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
              Open

                  removeAnswer(qid2,answer){
                      let qid = qid2;
                      if (qid2.includes(';')) qid = qid2.split(';')[0]; //first is id second is id of related tabs
                      if (this.quizids.includes(qid2)) {
                          let index = this.qas.findIndex(item => item.id === qid);
              Severity: Minor
              Found in src_aurelia-bodylight-plugin/src/elements/quiz-summary.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 refresh has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
              Open

              let refresh = debounce(() => {
                if (isBuilding) {
                  log('Watcher: A build is already in progress, deferring change detection...');
                  return;
                }
              Severity: Minor
              Found in src_aurelia-bodylight-plugin/aurelia_project/tasks/watch.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 bind has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
              Open

                bind() {
                  this.useranswer = [];
                  this.showquiz=true;
                  this.showresult = false;
                  this.answers_array = (this.answers)? this.answers.split('|').map(s => s.trim()): [];
              Severity: Minor
              Found in src_aurelia-bodylight-plugin/src/elements/quizx.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 createDragInterface_ has 63 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              Dygraph.prototype.createDragInterface_ = function() {
                  var context = {
                      // Tracks whether the mouse is down right now
                      isZooming: false,
                      isPanning: false,  // is this drag part of a pan?
              Severity: Major
              Found in src_aurelia-bodylight-plugin/src/utils/dygraph.js - About 2 hrs to fix

                Function footnoteTail has 62 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  function footnoteTail(state) {
                    let i; let l; let j; let t; let lastParagraph; let list; let token; let tokens; let current; let currentLabel;
                    let insideRef = false;
                    let refTokens = {};
                
                
                Severity: Major
                Found in src_aurelia-bodylight-plugin/src/elements/markdown-it-bfootnote.js - About 2 hrs to fix

                  Function bind has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    bind() {
                      this.useranswer = [];
                      this.showquiz=true;
                      this.showresult = false;
                      this.answers_array = (this.answers)? this.answers.split('|').map(s => s.trim()): [];
                  Severity: Major
                  Found in src_aurelia-bodylight-plugin/src/elements/quiz.js - About 2 hrs to fix

                    Function instantiate has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      instantiate() {
                        console.log('fmi instantiate()');
                        //first define FMI API function names;
                        const sReset = 'fmi2Reset';
                        const sInstantiate = 'fmi2Instantiate';
                    Severity: Major
                    Found in src_aurelia-bodylight-plugin/src/elements/fmi.js - About 2 hrs to fix
                      Severity
                      Category
                      Status
                      Source
                      Language