creative-connections/Bodylight.js-Components

View on GitHub

Showing 430 of 684 total issues

Function Legend has 181 lines of code (exceeds 25 allowed). Consider refactoring.
Open

Dygraph.Plugins.Legend = (function() {

    /*

Current bits of jankiness:
Severity: Major
Found in src_aurelia-bodylight-plugin/src/utils/dygraph.js - About 7 hrs to fix

    Function updatetitles has a Cognitive Complexity of 46 (exceeds 5 allowed). Consider refactoring.
    Open

      updatetitles(hashstruct) {
          //this.currentlink
          console.log('top nav hash:', hashstruct);
          if (window.markdownnav) {
            let currentlink = '#' + (hashstruct[0].length > 0 ? hashstruct[0] : this.index);
    Severity: Minor
    Found in src_aurelia-bodylight-plugin/src/elements/markdown-top-nav.js - About 7 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 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_aurelia-bodylight-plugin/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

    Function bind has 169 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

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

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

      export class Fmi {
        @bindable fminame='';
        @bindable fmifunctionprefixname='';
        @bindable tolerance=0.000001;//0.000030517578
        @bindable starttime=0;
      Severity: Minor
      Found in src_aurelia-bodylight-plugin/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_aurelia-bodylight-plugin/src/utils/dygraph.js - About 6 hrs to fix

          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_aurelia-bodylight-plugin/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 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_aurelia-bodylight-plugin/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_aurelia-bodylight-plugin/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 valueChanged has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
          Open

              valueChanged(newValue, oldValue) {
                  //if (oldValue !== newValue)
                  if (this.ids) {
                      //semaphore only one change in time is allowed
                      if (!window.rangebinding) {
          Severity: Minor
          Found in src_aurelia-bodylight-plugin/src/elements/range.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 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_aurelia-bodylight-plugin/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 405 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_aurelia-bodylight-plugin/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_aurelia-bodylight-plugin/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_aurelia-bodylight-plugin/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_aurelia-bodylight-plugin/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_aurelia-bodylight-plugin/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_aurelia-bodylight-plugin/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 sub_plugin has 121 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function sub_plugin(md) {
                    var escapeRE        = md.utils.escapeRE,
                        arrayReplaceAt  = md.utils.arrayReplaceAt;
                  
                    // ASCII characters in Cc, Sc, Sm, Sk categories we should terminate on;
                  Severity: Major
                  Found in src_aurelia-bodylight-plugin/src/elements/markdown-it-abbr-ext.js - About 4 hrs to fix

                    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_aurelia-bodylight-plugin/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_aurelia-bodylight-plugin/src/utils/dygraph.js - About 4 hrs to fix
                      Severity
                      Category
                      Status
                      Source
                      Language