creative-connections/Bodylight.js-Components

View on GitHub

Showing 684 of 684 total issues

Avoid deeply nested control flow statements.
Open

                    if (g == 7) {  // one week
                        d.setDate(d.getDate() - d.getDay());
                    }
Severity: Major
Found in src_aurelia-bodylight-plugin/src/utils/dygraph.js - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

                        if (y === null || isNaN(y)) continue;
    Severity: Major
    Found in src_aurelia-bodylight-plugin/src/utils/dygraph.js - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                          if (spacing > pixels_per_tick) break;
      Severity: Major
      Found in src_aurelia-bodylight-plugin/src/utils/dygraph.js - About 45 mins to fix

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

            generateOrAbortCore(unixTsMs, rollbackAllowance) {
                const MAX_COUNTER = 4398046511103;
                if (!Number.isInteger(unixTsMs) ||
                    unixTsMs < 1 ||
                    unixTsMs > 281474976710655) {
        Severity: Minor
        Found in src_aurelia-bodylight-plugin/src/utils/uuidv7.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 deeply nested control flow statements.
        Open

                            for (i = datasets.length - 1; i >= 0; i--) {
                                if (!datasets[i]) continue;
                                datasets[i][j][1] = NaN;
                            }
        Severity: Major
        Found in src_aurelia-bodylight-plugin/src/utils/dygraph.js - About 45 mins to fix

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

            download() {
              //ask for filename
              let filename = prompt('File name (*.csv):', 'data.csv');
              if (filename) {
                //adds csv as extension
          Severity: Minor
          Found in src_aurelia-bodylight-plugin/src/elements/chartjs.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

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

          const registerCustomElementFunction = () => {
            //register e.g. click on abbr element will show title and allows expand to url - wikipedia content
            //click on abbr will show extended modal info and link 
            
            //click on abbreviation shows a sibling dialog, if presented
          Severity: Minor
          Found in src_aurelia-bodylight-plugin/src/elements/markdownaurelia.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 deeply nested control flow statements.
          Open

                          if (dx > 0) {
                              var r = (p1.canvasx - domX) / dx;
                              py += r * (p0.canvasy - p1.canvasy);
                          }
          Severity: Major
          Found in src_aurelia-bodylight-plugin/src/utils/dygraph.js - About 45 mins to fix

            Avoid deeply nested control flow statements.
            Open

                                if (!Dygraph.isOK(point.y)) {
                                    prevX = NaN;
                                    continue;
                                }
            Severity: Major
            Found in src_aurelia-bodylight-plugin/src/utils/dygraph.js - About 45 mins to fix

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

                  showhidefull() {
                    this.nav = ! this.nav;
                    if (! this.nav) {
                      if (document.documentElement.requestFullscreen) {
                        document.documentElement.requestFullscreen();
              Severity: Minor
              Found in src_aurelia-bodylight-plugin/src/elements/markdown-top-nav.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 deeply nested control flow statements.
              Open

                            if (window.bodylightnavopenhide) window.bodylightnavopenhide(currentnavitem.parentNode.parentNode.previousSibling);
              Severity: Major
              Found in src_aurelia-bodylight-plugin/src/elements/markdown-top-nav.js - About 45 mins to fix

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

                    bind(){
                        super.bind();
                        this.type = 'scatter';
                        this.data.labels = [];
                        this.xrefindex = parseInt(this.xrefindex, 10);
                Severity: Minor
                Found in src_aurelia-bodylight-plugin/src/elements/chartjs-fixed-xy.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 deeply nested control flow statements.
                Open

                                    for (k = 0; k < sum.length; k++) {
                                        y = dataPoint[j][k];
                                        if (y === null || isNaN(y)) continue;
                                        sum[k] += y;
                                        count[k]++;
                Severity: Major
                Found in src_aurelia-bodylight-plugin/src/utils/dygraph.js - About 45 mins to fix

                  Avoid deeply nested control flow statements.
                  Open

                                      if (stepPlot) {
                                          newYs = [ point.y_bottom, point.y_top ];
                                          prevY = point.y;
                                      } else {
                                          newYs = [ point.y_bottom, point.y_top ];
                  Severity: Major
                  Found in src_aurelia-bodylight-plugin/src/utils/dygraph.js - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                for (j = 1; j < inFields.length; j++) {
                                    fields[j] = this.parseFloat_(inFields[j], i, line);
                                }
                    Severity: Major
                    Found in src_aurelia-bodylight-plugin/src/utils/dygraph.js - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                          if (minY > 0) minAxisY = 0;
                      Severity: Major
                      Found in src_aurelia-bodylight-plugin/src/utils/dygraph.js - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                    for (j = 1; j < inFields.length; j++) {
                                        var val = inFields[j];
                                        if (/^ *$/.test(val)) {
                                            fields[j] = [null, null, null];
                                        } else {
                        Severity: Major
                        Found in src_aurelia-bodylight-plugin/src/utils/dygraph.js - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                              for (var k = 0; k < annotationCols[col].length; k++) {
                                                  if (k) ann.text += "\n";
                                                  ann.text += data.getValue(i, annotationCols[col][k]);
                                              }
                          Severity: Major
                          Found in src_aurelia-bodylight-plugin/src/utils/dygraph.js - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                if (typeof(self[k]) != 'object' || self[k] === null) {
                                                    self[k] = {};
                                                }
                            Severity: Major
                            Found in src_aurelia-bodylight-plugin/src/utils/dygraph.js - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                            if (currentnavitem.parentNode.parentNode && currentnavitem.parentNode.parentNode.parentNode && currentnavitem.parentNode.parentNode.parentNode.className === 'w3-hide')
                                              if (window.bodylightnavopenhide) window.bodylightnavopenhide(currentnavitem.parentNode.parentNode.parentNode.previousSibling);
                              Severity: Major
                              Found in src_aurelia-bodylight-plugin/src/elements/markdown-top-nav.js - About 45 mins to fix
                                Severity
                                Category
                                Status
                                Source
                                Language