creative-connections/aurelia-bodylight-plugin

View on GitHub

Showing 552 of 552 total issues

Function numericTicks has 123 lines of code (exceeds 25 allowed). Consider refactoring.
Open

Dygraph.numericTicks = function (a, b, pixels, opts, dygraph, vals) {
    //console.log("nt a " + a + " b " + b + " vals " + vals);
    var pixels_per_tick = opts('pixelsPerLabel');
    var ticks = [];
    var i, j, tickV, nTicks;
Severity: Major
Found in src/utils/dygraph.js - About 4 hrs to fix

    Function registerInputs has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
    Open

      registerInputs(){
        if (this.inputs) { //register DOM elements to listen to their 'change' event directly
          let inputparts = this.inputs.split(';'); //splits groups delimited by ;
          this.inputreferences = [];
          for (let inputpart of inputparts) {
    Severity: Minor
    Found in src/elements/fmi.js - About 4 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 _renderAnnotations has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
    Open

    DygraphCanvasRenderer.prototype._renderAnnotations = function() {
        var annotationStyle = {
            "position": "absolute",
            "fontSize": this.attr_('axisLabelFontSize') + "px",
            "zIndex": 10,
    Severity: Minor
    Found in src/utils/dygraph.js - About 4 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 rollingAverage has 115 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    Dygraph.prototype.rollingAverage = function(originalData, rollPeriod) {
        if (originalData.length < 2)
            return originalData;
        rollPeriod = Math.min(rollPeriod, originalData.length);
        var rollingData = [];
    Severity: Major
    Found in src/utils/dygraph.js - About 4 hrs to fix

      Function extremeValues_ has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
      Open

      Dygraph.prototype.extremeValues_ = function(series) {
          var minY = null, maxY = null, j, y;
      
          var bars = this.attr_("errorBars") || this.attr_("customBars");
          if (bars) {
      Severity: Minor
      Found in src/utils/dygraph.js - About 4 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 attached has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
      Open

        attached() {
          //listening to custom event fmidata
          console.log('dygraph attached');
          if (this.refindex && (this.refindex.indexOf(',')>0)) this.refindices = this.refindex.split(',');
          let fmielement = document.getElementById(this.fromid);
      Severity: Minor
      Found in src/elements/dygraphchart.js - About 4 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 parseDataTable_ has 109 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      Dygraph.prototype.parseDataTable_ = function(data) {
          var shortTextForAnnotationNum = function(num) {
              // converts [0-9]+ [A-Z][a-z]*
              // example: 0=A, 1=B, 25=Z, 26=Aa, 27=Ab
              // and continues like.. Ba Bb .. Za .. Zz..Aaa...Zzz Aaaa Zzzz
      Severity: Major
      Found in src/utils/dygraph.js - About 4 hrs to fix

        Function parseCSV_ has 104 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        Dygraph.prototype.parseCSV_ = function(data) {
            var ret = [];
            var lines = data.split("\n");
            var vals, j;
        
        
        Severity: Major
        Found in src/utils/dygraph.js - About 4 hrs to fix

          Function doUnzoom_ has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
          Open

          Dygraph.prototype.doUnzoom_ = function() {
              var dirty = false, dirtyX = false, dirtyY = false;
              if (this.dateWindow_ !== null) {
                  dirty = true;
                  dirtyX = true;
          Severity: Minor
          Found in src/utils/dygraph.js - About 4 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 _evaluateLimits has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
          Open

          DygraphLayout.prototype._evaluateLimits = function () {
              //TODO(tomaton): fix xrange when last x value is not the highest in case of x = sin(y) x is from 0 to 1 and back to 0
              //and range for x is 0 to 1
              this.minxval = this.maxxval = null;
              if (this.dateWindow_) {
          Severity: Minor
          Found in src/utils/dygraph.js - About 4 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 28 (exceeds 5 allowed). Consider refactoring.
          Open

            constructor() {
              this.handleValueChange = e => {
                //sets data to dataset
                //apply value convert among all data
                let rawdata;
          Severity: Minor
          Found in src/elements/chartjs.js - About 4 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 28 (exceeds 5 allowed). Consider refactoring.
          Open

              constructor() {
                  super();
                  //this.type = 'line';
                  this.handleValueChange = e => {
                      //e.detail do not reallocate - using same buffer, thus slicing to append to data array
          Severity: Minor
          Found in src/elements/chartjs-time.js - About 4 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 28 (exceeds 5 allowed). Consider refactoring.
          Open

            bind() {
              //register throttled update function    
              if (typeof this.throttle === 'string') this.throttle = parseInt(this.throttle, 10);
              if (typeof this.dataevent === 'string') this.dataevent = this.dataevent === 'true';
              if (typeof this.precision === 'string') this.precision = parseInt(this.precision, 10);
          Severity: Minor
          Found in src/elements/value.js - About 4 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

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

          Dygraph.pageY = function(e) {
              if (e.pageY) {
                  return (!e.pageY || e.pageY < 0) ? 0 : e.pageY;
              } else {
                  var de = document;
          Severity: Major
          Found in src/utils/dygraph.js and 1 other location - About 4 hrs to fix
          src/utils/dygraph.js on lines 5493..5503

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

          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

          Dygraph.pageX = function(e) {
              if (e.pageX) {
                  return (!e.pageX || e.pageX < 0) ? 0 : e.pageX;
              } else {
                  var de = document;
          Severity: Major
          Found in src/utils/dygraph.js and 1 other location - About 4 hrs to fix
          src/utils/dygraph.js on lines 5511..5521

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

          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 isPixelChangingOptionList has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
          Open

          Dygraph.isPixelChangingOptionList = function(labels, attrs) {
              // A whitelist of options that do not change pixel positions.
              var pixelSafeOptions = {
                  'annotationClickHandler': true,
                  'annotationDblClickHandler': true,
          Severity: Minor
          Found in src/utils/dygraph.js - About 3 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

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

                script.onload = script.onreadystatechange = function( _, isAbort ) {
                  if (isAbort || !script.readyState || /loaded|complete/.test(script.readyState) ) {
                    script.onerror = script.onload = script.onreadystatechange = null;
                    script = undefined;
          
          
          Severity: Major
          Found in src/elements/animate-adobe.js and 1 other location - About 3 hrs to fix
          src/elements/animate-adobe-ss.js on lines 189..196

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

          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

              script.onload = script.onreadystatechange = function( _, isAbort ) {
                if (isAbort || !script.readyState || /loaded|complete/.test(script.readyState) ) {
                  script.onerror = script.onload = script.onreadystatechange = null;
                  script = undefined;
          
          
          Severity: Major
          Found in src/elements/animate-adobe-ss.js and 1 other location - About 3 hrs to fix
          src/elements/animate-adobe.js on lines 255..262

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

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

          DygraphRangeSelector.prototype.computeCombinedSeriesAndLimits_ = function() {
              var data = this.dygraph_.rawData_;
              var logscale = this.attr_('logscale');
          
              // Create a combined series (average of all series values).
          Severity: Major
          Found in src/utils/dygraph.js - About 3 hrs to fix

            Function constructor has 95 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                constructor() {
                    super();
                    this.handleValueChange = e => {
                        //let j = this.currentdataset;
                        //all values from refindex to one dataset - as one curve
            Severity: Major
            Found in src/elements/chartjs-fixed-xy.js - About 3 hrs to fix
              Severity
              Category
              Status
              Source
              Language