creative-connections/aurelia-bodylight-plugin

View on GitHub

Showing 366 of 552 total issues

Function gatherDatasets_ has 89 lines of code (exceeds 25 allowed). Consider refactoring.
Open

Dygraph.prototype.gatherDatasets_ = function(rolledSeries, dateWindow) {
    var boundaryIds = [];
    var cumulative_y = [];  // For stacked series.
    var datasets = [];
    var extremes = {};  // series name -> [low, high]
Severity: Major
Found in src/utils/dygraph.js - About 3 hrs to fix

    Function _renderAnnotations has 86 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    DygraphCanvasRenderer.prototype._renderAnnotations = function() {
        var annotationStyle = {
            "position": "absolute",
            "fontSize": this.attr_('axisLabelFontSize') + "px",
            "zIndex": 10,
    Severity: Major
    Found in src/utils/dygraph.js - About 3 hrs to fix

      Function __init__ has 86 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      Dygraph.prototype.__init__ = function (div, file, attrs) {
          // Hack for IE: if we're using excanvas and the document hasn't finished
          // loading yet (and hence may not have initialized whatever it needs to
          // initialize), then keep calling this routine periodically until it has.
          if (/MSIE/.test(navigator.userAgent) && !window.opera &&
      Severity: Major
      Found in src/utils/dygraph.js - About 3 hrs to fix

        Function movePan has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
        Open

        Dygraph.Interaction.movePan = function(event, g, context) {
            context.dragEndX = g.dragGetX_(event, context);
            context.dragEndY = g.dragGetY_(event, context);
        
            var minDate = context.initialLeftmostDate -
        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

        Function parseConvertors has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
        Open

            parseConvertors() {
              //configure convertors - used to convert units received from fmi
              if (this.convertor) {
                let convertvalues = this.convertor.split(';');
                let identity = x => x;
        Severity: Minor
        Found in src/elements/bind2a.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

        Function markdownitbtoc has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
        Open

        export function markdownitbtoc(md, _options) {
          // Set default options
          let options = Object.assign({}, defaultOptions, _options);
        
          // Global variables
        Severity: Minor
        Found in src/elements/markdown-it-btoc.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

        Function bind has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
        Open

            bind() {
              super.bind();
              console.log('chartjs xy point bind()');
              if (this.xmin) {
                //sets yscale min
        Severity: Minor
        Found in src/elements/chartjs-xy-points.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

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

          constructor() {
            //this.data = [[0, 0, 0]];
        
            //this.data=[[1, 5], [2, 5], [3, 4.9], [4, 4.8], [5, 5.2]];
        
        
        Severity: Minor
        Found in src/elements/dygraphchart.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

        Function bind has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
        Open

          bind() {
            if (this.speedfactor) {
              if (typeof this.speedfactor === 'string') this.speedfactor = parseInt(this.speedfactor, 10);
              if (this.speedfactor <= 0 || this.speedfactor > 100) this.speedfactor = 100;
            }
        Severity: Minor
        Found in src/elements/animate-control.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

        Function computeYAxisRanges_ has 80 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        Dygraph.prototype.computeYAxisRanges_ = function (extremes) {
            // Build a map from axis number -> [list of series names]
            var seriesForAxis = [], series;
            for (series in this.seriesToAxisMap_) {
                if (!this.seriesToAxisMap_.hasOwnProperty(series)) continue;
        Severity: Major
        Found in src/utils/dygraph.js - About 3 hrs to fix

          AnimateAdobe has 27 functions (exceeds 20 allowed). Consider refactoring.
          Open

          export class AnimateAdobe {
              @bindable src;
              @bindable width=800;
              @bindable height=600;
              @bindable name;//="ZelezoCelek"
          Severity: Minor
          Found in src/elements/animate-adobe.js - About 3 hrs to fix

            Function isPixelChangingOptionList has 79 lines of code (exceeds 25 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: Major
            Found in src/utils/dygraph.js - About 3 hrs to fix

              Function computeYAxes_ has 78 lines of code (exceeds 25 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: Major
              Found in src/utils/dygraph.js - About 3 hrs to fix

                Function updateDeep has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                Open

                Dygraph.updateDeep = function (self, o) {
                    // Taken from http://stackoverflow.com/questions/384286/javascript-isdom-how-do-you-check-if-a-javascript-object-is-a-dom-object
                    function isNode(o) {
                        return (
                            typeof Node === "object" ? o instanceof Node :
                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

                Function RGBColor has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
                Open

                function RGBColor(color_string)
                {
                    this.ok = false;
                
                    // strip any leading #
                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

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

                    bind() {
                      super.bind();
                      this.plugins = [ChartDataLabels];
                      if (this.extremelimits) {
                        this.elimits = this.extremelimits.split(','); //split by comma
                Severity: Major
                Found in src/elements/chartjs-barplot.js - About 3 hrs to fix

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

                    constructor() {
                      //document.getElementById("id${window.ids - 2}").addEventListener("change", myfun${window.ids});
                      /*function myfun${window.ids}(event){
                          document.getElementById("id${window.ids - 1}").value = event.target.value;
                     }*/
                  Severity: Minor
                  Found in src/elements/bind2previous.js - About 2 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 getScript has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                  Open

                    getScript(source, callback) {
                      //check whether the script is not already there
                      if (Array.from(document.getElementsByTagName('script')).filter(x=> x.getAttribute('src') === source).length > 0) {
                        console.log('fmi.getScript() WARNING, script is already added into DOM:', source);
                        //do callback?
                  Severity: Minor
                  Found in src/elements/fmi.js - About 2 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 72 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  Dygraph.getDateAxis = function(start_time, end_time, granularity, opts, dg) {
                      var formatter = opts("axisLabelFormatter");
                      var ticks = [];
                      var t;
                  
                  
                  Severity: Major
                  Found in src/utils/dygraph.js - About 2 hrs to fix

                    Function bind has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                    Open

                      bind() {
                        this.refindex = parseInt(this.refindex, 10);
                        this.refvalues = parseInt(this.refvalues, 10);
                        this.refendindex = this.refindex + this.refvalues;
                    
                    
                    Severity: Minor
                    Found in src/elements/plotly.js - About 2 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

                    Severity
                    Category
                    Status
                    Source
                    Language