creative-connections/Bodylight.js-Components

View on GitHub

Showing 430 of 684 total issues

Avoid too many return statements within this function.
Open

    return true;
Severity: Major
Found in src_aurelia-bodylight-plugin/src/elements/markdown-it-bfootnote.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

          if (state.src.charCodeAt(pos) === 0x0A) { return false; }
    Severity: Major
    Found in src_aurelia-bodylight-plugin/src/elements/markdown-it-bfootnote.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

          if (isNaN(p.x) || (!allowNaNY && isNaN(p.y))) return false;
      Severity: Major
      Found in src_aurelia-bodylight-plugin/src/utils/dygraph.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

            if (title.length === 0) { return false; }
        Severity: Major
        Found in src_aurelia-bodylight-plugin/src/elements/markdown-it-abbr-ext.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

              if (label.length === 0) { return false; }
          Severity: Major
          Found in src_aurelia-bodylight-plugin/src/elements/markdown-it-abbr-ext.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                  return false;
            Severity: Major
            Found in src_aurelia-bodylight-plugin/src/elements/markdown-it-abbr-ext.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                  return true;
              Severity: Major
              Found in src_aurelia-bodylight-plugin/src/elements/markdown-it-abbr-ext.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                    if (silent) { return true; }
                Severity: Major
                Found in src_aurelia-bodylight-plugin/src/elements/markdown-it-abbr-ext.js - About 30 mins to fix

                  Function findMaxXindex has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                  Dygraph.prototype.findMaxXindex = function (arr) {
                      if (this.maxXindex === null) {
                          this.maxXindex = 0;
                          var x2 = arr[0][0]
                          for (var maxi = 1; maxi < arr.length; maxi++){
                  Severity: Minor
                  Found in src_aurelia-bodylight-plugin/src/utils/dygraph.js - About 25 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 bind has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                    bind() {
                      this.paramname = [];
                      this.paramindex = [];
                      if (!this.params) return;
                      console.log('watchhashcore.bind() params:', this.params);
                  Severity: Minor
                  Found in src_aurelia-bodylight-plugin/src/attributes/watch-hash-core.js - About 25 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 drawInteractiveLayer_ has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                  DygraphRangeSelector.prototype.drawInteractiveLayer_ = function() {
                      var ctx = this.fgcanvas_ctx_;
                      ctx.clearRect(0, 0, this.canvasRect_.w, this.canvasRect_.h);
                      var margin = 1;
                      var width = this.canvasRect_.w - margin;
                  Severity: Minor
                  Found in src_aurelia-bodylight-plugin/src/utils/dygraph.js - About 25 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 isSupported has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                  DygraphCanvasRenderer.isSupported = function(canvasName) {
                      var canvas = null;
                      try {
                          if (typeof(canvasName) == 'undefined' || canvasName === null) {
                              canvas = document.createElement("canvas");
                  Severity: Minor
                  Found in src_aurelia-bodylight-plugin/src/utils/dygraph.js - About 25 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 dateAxisFormatter has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                  Dygraph.dateAxisFormatter = function(date, granularity) {
                      if (granularity >= Dygraph.DECADAL) {
                          return date.strftime('%Y');
                      } else if (granularity >= Dygraph.MONTHLY) {
                          return date.strftime('%b %y');
                  Severity: Minor
                  Found in src_aurelia-bodylight-plugin/src/utils/dygraph.js - About 25 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 animateSelection_ has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                  Dygraph.prototype.animateSelection_ = function(direction) {
                      var totalSteps = 10;
                      var millis = 30;
                      if (this.fadeLevel === undefined) this.fadeLevel = 0;
                      if (this.animateId === undefined) this.animateId = 0;
                  Severity: Minor
                  Found in src_aurelia-bodylight-plugin/src/utils/dygraph.js - About 25 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 compareArrays has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                  Dygraph.compareArrays = function(array1, array2) {
                      if (!Dygraph.isArrayLike(array1) || !Dygraph.isArrayLike(array2)) {
                          return false;
                      }
                      if (array1.length !== array2.length) {
                  Severity: Minor
                  Found in src_aurelia-bodylight-plugin/src/utils/dygraph.js - About 25 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 findMinXindex has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                  Dygraph.prototype.findMinXindex = function (arr) {
                      if (this.minXindex === null) {
                          this.minXindex = 0;
                          var x2 = arr[0][0]
                          for (var maxi = 1; maxi < arr.length; maxi++){
                  Severity: Minor
                  Found in src_aurelia-bodylight-plugin/src/utils/dygraph.js - About 25 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 drawMiniPlot_ has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                  DygraphRangeSelector.prototype.drawMiniPlot_ = function() {
                      var fillStyle = this.attr_('rangeSelectorPlotFillColor');
                      var strokeStyle = this.attr_('rangeSelectorPlotStrokeColor');
                      if (!fillStyle && !strokeStyle) {
                          return;
                  Severity: Minor
                  Found in src_aurelia-bodylight-plugin/src/utils/dygraph.js - About 25 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 _evaluateAnnotations has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                  DygraphLayout.prototype._evaluateAnnotations = function() {
                      // Add the annotations to the point to which they belong.
                      // Make a map from (setName, xval) to annotation for quick lookups.
                      var i;
                      var annotations = {};
                  Severity: Minor
                  Found in src_aurelia-bodylight-plugin/src/utils/dygraph.js - About 25 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 extractSeries_ has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                  Dygraph.prototype.extractSeries_ = function(rawData, i, logScale) {
                      var series = [];
                      for (var j = 0; j < rawData.length; j++) {
                          var x = rawData[j][0];
                          var point = rawData[j][i];
                  Severity: Minor
                  Found in src_aurelia-bodylight-plugin/src/utils/dygraph.js - About 25 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 isElementVisible has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                      isElementVisible(element) {
                          // Check if the element itself is set to display: none
                          if (window.getComputedStyle(element).display === "none") {
                              return false;
                          }
                  Severity: Minor
                  Found in src_aurelia-bodylight-plugin/src/elements/sachart.js - About 25 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

                  Severity
                  Category
                  Status
                  Source
                  Language