creative-connections/aurelia-bodylight-plugin

View on GitHub

Showing 366 of 552 total issues

Function attached has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
Open

  attached() {
    //console.log('chartjs attached');
    //listening to custom event fmidata and fmireset
    const fromel = document.getElementById(this.fromid);
    if (fromel) {
Severity: Minor
Found in src/elements/chartjs.js - About 6 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

File chartjs.js has 451 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import Chart from 'chart.js';
import ChartDataLabels from 'chartjs-plugin-datalabels';
import {bindable} from 'aurelia-framework';
import _ from 'lodash';

Severity: Minor
Found in src/elements/chartjs.js - About 6 hrs to fix

    Fmi has 48 functions (exceeds 20 allowed). Consider refactoring.
    Open

    export class Fmi {
      @bindable fminame='N/A';
      @bindable tolerance=0.000001;//0.000030517578
      @bindable starttime=0;
      @bindable stoptime=0; //if >0 then fmi will stop at stoptime
    Severity: Minor
    Found in src/elements/fmi.js - About 6 hrs to fix

      Function _renderLineChart has 162 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      DygraphCanvasRenderer.prototype._renderLineChart = function() {
          // TODO(danvk): use this.attr_ for many of these.
          var ctx = this.elementContext;
          var fillAlpha = this.attr_('fillAlpha');
          var errorBars = this.attr_("errorBars") || this.attr_("customBars");
      Severity: Major
      Found in src/utils/dygraph.js - About 6 hrs to fix

        Function getDateAxis has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
        Open

        Dygraph.getDateAxis = function(start_time, end_time, granularity, opts, dg) {
            var formatter = opts("axisLabelFormatter");
            var ticks = [];
            var t;
        
        
        Severity: Minor
        Found in src/utils/dygraph.js - About 6 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 computeYAxes_ has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
        Open

        Dygraph.prototype.computeYAxes_ = function() {
            // Preserve valueWindow settings if they exist, and if the user hasn't
            // specified a new valueRange.
            var i, valueWindows, seriesName, axis, index, opts, v;
            if (this.axes_ !== undefined && this.user_attrs_.hasOwnProperty("valueRange") === false) {
        Severity: Minor
        Found in src/utils/dygraph.js - About 6 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 _drawSeries has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
        Open

        DygraphCanvasRenderer.prototype._drawSeries = function(
            ctx, iter, strokeWidth, pointSize, drawPoints, drawGapPoints,
            stepPlot, strategy) {
        
            var prevCanvasX = null;
        Severity: Minor
        Found in src/utils/dygraph.js - About 6 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 160 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          bind() {
            //console.log('chartjs bind');
            if ((typeof this.refindex == 'string') && (this.refindex.indexOf(',')>0)) { this.refindices = this.refindex.split(',')}
            else {
              this.refindex = myParseInt(this.refindex, 10);
        Severity: Major
        Found in src/elements/chartjs.js - About 6 hrs to fix

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

              constructor() {
                  super();
                  this.handleValueChange = e => {
                      //let j = this.currentdataset;
                      //all values from refindex to one dataset - as one curve
          Severity: Minor
          Found in src/elements/chartjs-fixed-xy.js - About 5 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

          File animate-adobe.js has 404 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import {bindable} from 'aurelia-framework';
          //import '@danzen/createjs';
          //import 'createjs/builds/1.0.0/createjs';
          import 'latest-createjs';
          //import 'createjs/builds/1.0.0/createjs';
          Severity: Minor
          Found in src/elements/animate-adobe.js - About 5 hrs to fix

            Function step has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
            Open

              step(e) {
                //this = window.thisfmi;
                //primitive semaphore, only one instance can perform this call
                if (!this.doingstep) {
                  //console.log('fmu step()');
            Severity: Minor
            Found in src/elements/fmi.js - About 5 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 _renderAxis has 135 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            DygraphCanvasRenderer.prototype._renderAxis = function() {
                if (!this.attr_('drawXAxis') && !this.attr_('drawYAxis')) return;
            
                // Round pixels to half-integer boundaries for crisper drawing.
                function halfUp(x)  { return Math.round(x) + 0.5; }
            Severity: Major
            Found in src/utils/dygraph.js - About 5 hrs to fix

              Function attached has 131 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                attached() {
                  //console.log('chartjs attached');
                  //listening to custom event fmidata and fmireset
                  const fromel = document.getElementById(this.fromid);
                  if (fromel) {
              Severity: Major
              Found in src/elements/chartjs.js - About 5 hrs to fix

                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
                      Severity
                      Category
                      Status
                      Source
                      Language