creative-connections/Bodylight.js-Components

View on GitHub

Showing 430 of 684 total issues

Function findStackedPoint has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

Dygraph.prototype.findStackedPoint = function(domX, domY) {
    var row = this.findClosestRow(domX);
    var boundary = this.getLeftBoundary_();
    var rowIdx = row - boundary;
    var points = this.layout_.points;
Severity: Minor
Found in src_aurelia-bodylight-plugin/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 __init__ has a Cognitive Complexity of 25 (exceeds 5 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: Minor
Found in src_aurelia-bodylight-plugin/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 constructor has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

  constructor() {
    //create lambda function which is added as listener later
    this.changeinputs = {}; //[]; change to associative array
    this.handleValueChange = e => {
      //e.target; //triggered the event
Severity: Minor
Found in src_aurelia-bodylight-plugin/src/elements/fmi.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 25 (exceeds 5 allowed). Consider refactoring.
Open

    bind() {
      super.bind();
      this.plugins = [ChartDataLabels];
      if (this.extremelimits) {
        this.elimits = this.extremelimits.split(','); //split by comma
Severity: Minor
Found in src_aurelia-bodylight-plugin/src/elements/chartjs-barplot.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 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_aurelia-bodylight-plugin/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_aurelia-bodylight-plugin/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_aurelia-bodylight-plugin/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_aurelia-bodylight-plugin/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_aurelia-bodylight-plugin/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_aurelia-bodylight-plugin/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_aurelia-bodylight-plugin/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]];
            //create lambda function which is added as listener later
            console.log('dygraph chart constructor');
        Severity: Minor
        Found in src_aurelia-bodylight-plugin/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 ((typeof this.vertical) === "string") this.vertical = this.vertical === 'true';
              if (this.w3class) {
                  this.activeclass= this.w3class+ ' '+(this.vertical?this.activeclasstemplatevertical:this.activeclasstemplate);
                  this.inactiveclass= this.w3class+' '+(this.vertical?this.inactiveclasstemplatevertical:this.inactiveclasstemplate);
        Severity: Minor
        Found in src_aurelia-bodylight-plugin/src/elements/tabs.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_aurelia-bodylight-plugin/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_aurelia-bodylight-plugin/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_aurelia-bodylight-plugin/src/utils/dygraph.js - About 3 hrs to fix

              Function abbr_replace has 79 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                function abbr_replace(state) {
                  var i, j, l, tokens, token, text, nodes, pos, reg, m, regText, regSimple,
                      currentToken,
                      blockTokens = state.tokens;
              
              
              Severity: Major
              Found in src_aurelia-bodylight-plugin/src/elements/markdown-it-abbr-ext.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_aurelia-bodylight-plugin/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_aurelia-bodylight-plugin/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_aurelia-bodylight-plugin/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

                  Severity
                  Category
                  Status
                  Source
                  Language