creative-connections/aurelia-bodylight-plugin

View on GitHub

Showing 552 of 552 total issues

Avoid deeply nested control flow statements.
Open

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

    Avoid deeply nested control flow statements.
    Open

                        if (requiresNewPoints) {
                            break;
                        }
    Severity: Major
    Found in src/utils/dygraph.js - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                          if (lastDisplayed === null) {
                              lastDisplayed = {
                                  tickValue: tickValue,
                                  pixel_coord: pixel_coord
                              };
      Severity: Major
      Found in 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/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/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

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

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

                constructor() {
                  //console.log('animate-adobe constructor()');
                  //fix issue - some bindings not detached
                  //window.animatebindings = [];
                  this.handleValueChange = e => {
            Severity: Minor
            Found in src/elements/animate-adobe.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 (j = 1; j < inFields.length; j++) {
                            fields[j] = this.parseFloat_(inFields[j], i, line);
                        }
            Severity: Major
            Found in src/utils/dygraph.js - About 45 mins to fix

              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/utils/dygraph.js - About 45 mins to fix

                Avoid deeply nested control flow statements.
                Open

                                if (cumulative_y[x] < seriesExtremes[0]) {
                                    seriesExtremes[0] = cumulative_y[x];
                                }
                Severity: Major
                Found in src/utils/dygraph.js - About 45 mins to fix

                  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/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/utils/dygraph.js - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                          if (stepPlot) {
                                              strategy.drawLine(prevCanvasX, prevCanvasY, point.canvasx, prevCanvasY);
                                              prevCanvasX = point.canvasx;
                                          }
                      Severity: Major
                      Found in src/utils/dygraph.js - About 45 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                        if (num_ok) {
                                            stddev = Math.sqrt(variance) / num_ok;
                                            rollingData[i] = [originalData[i][0],
                                                [sum / num_ok, sigma * stddev, sigma * stddev]];
                                        } else {
                        Severity: Major
                        Found in src/utils/dygraph.js - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                          if (cumulative_y[x] === undefined) {
                                              cumulative_y[x] = 0;
                                          }
                          Severity: Major
                          Found in src/utils/dygraph.js - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                if (attrs[property].hasOwnProperty(subProperty) && !pixelSafeOptions[subProperty]) {
                                                    requiresNewPoints = true;
                                                }
                            Severity: Major
                            Found in src/utils/dygraph.js - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                              if (prev[1][1] !== null && !isNaN(prev[1][1])) {
                                                  low -= prev[1][0];
                                                  mid -= prev[1][1];
                                                  high -= prev[1][2];
                                                  count -= 1;
                              Severity: Major
                              Found in src/utils/dygraph.js - About 45 mins to fix

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

                                let watch = (callback) => {
                                  watchCallback = callback || watchCallback;
                                
                                  // watch every glob individually
                                  for(let watcher of watches) {
                                Severity: Minor
                                Found in aurelia_project/tasks/watch.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

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

                                        if (ret.length > 0 && row[0] < ret[ret.length - 1][0]) {
                                            outOfOrder = true;
                                        }
                                Severity: Minor
                                Found in src/utils/dygraph.js and 1 other location - About 45 mins to fix
                                src/utils/dygraph.js on lines 4610..4612

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

                                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

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

                                      if (((this.elimits[1] - parseFloat(this.initialdata)) / (this.elimits[1] - this.elimits[0])) < 0.05) {
                                        this.options.plugins.datalabels.align = 'left';
                                        this.options.plugins.datalabels.color = 'white';
                                      } else {
                                        this.options.plugins.datalabels.align = 'right';
                                Severity: Minor
                                Found in src/elements/chartjs-barplot.js and 1 other location - About 45 mins to fix
                                src/elements/chartjs-barplot.js on lines 40..46

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

                                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

                                Severity
                                Category
                                Status
                                Source
                                Language