creative-connections/Bodylight.js-Components

View on GitHub

Showing 430 of 684 total issues

Avoid deeply nested control flow statements.
Open

                for (j = Math.max(0, i - rollPeriod + 1); j < i + 1; j++) {
                    y = originalData[j][1][0];
                    if (y === null || isNaN(y)) continue;
                    num_ok++;
                    sum += originalData[j][1][0];
Severity: Major
Found in src_aurelia-bodylight-plugin/src/utils/dygraph.js - About 45 mins to fix

    Function watch has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    let watch = (callback) => {
      watchCallback = callback || watchCallback;
    
      // watch every glob individually
      for(let watcher of watches) {
    Severity: Minor
    Found in src_aurelia-bodylight-plugin/aurelia_project/tasks/watch.js - About 45 mins 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

    Avoid deeply nested control flow statements.
    Open

                                        if (value.y) ctx.fillText(value.y.toPrecision(4),x,y);
    Severity: Major
    Found in src_aurelia-bodylight-plugin/src/elements/chartjs-fixed.js - About 45 mins to fix

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

      constructor() {
          super();
          this.handleValueChange = e => {
              //sets data to dataset
              //apply value convert among all data
      Severity: Minor
      Found in src_aurelia-bodylight-plugin/src/elements/range-smooth2.js - About 45 mins 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

      Avoid deeply nested control flow statements.
      Open

                              for (let answer of answersStruct.answers) {
                                  const aid = answer.charAt(0);
                                  if (aggregatedResults[qid].a[aid])
                                      aggregatedResults[qid].a[aid]++;
                                  else
      Severity: Major
      Found in src_aurelia-bodylight-plugin/src/elements/fb-config.js - About 45 mins to fix

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

            bind() {
              //console.log('button.bind()');
              this.ids2send = this.ids.split(',');
              this.createids = [];
              //create those ids not yet in HTML DOM and put them to createids array
        Severity: Minor
        Found in src_aurelia-bodylight-plugin/src/elements/buttonparams.js - About 45 mins 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

        Avoid deeply nested control flow statements.
        Open

                                for (animchild of window.ani.exportRoot.children) {
                                if (typeof animchild.gotoAndStop === 'function')
                                   animchild.gotoAndStop (newValue);                    
                                }
        Severity: Major
        Found in src_aurelia-bodylight-plugin/src/elements/range.js - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                                  for (let answer of answersStruct.answers) {
                                      const aid = answer.charAt(0);
                                      aggregatedResults[qid].a[aid] = 1;
                                  }
          Severity: Major
          Found in src_aurelia-bodylight-plugin/src/elements/fb-config.js - About 45 mins to fix

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

                constructor() {
                  //console.log('animate-adobe constructor()');
                  //fix issue - some bindings not detached
                  //window.animatebindings = [];
                  this.handleValueChange = e => {
            Severity: Minor
            Found in src_aurelia-bodylight-plugin/src/elements/animate-adobe.js - About 45 mins 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 8 (exceeds 5 allowed). Consider refactoring.
            Open

                attached() {
                  //disable animation if enabled from previous
                  console.log('adobeobj attached()');
                  if (window.ani) this.disableAnimation();
                  if (this.responsive && (typeof this.responsive === 'string')) this.responsive = this.responsive==='true';
            Severity: Minor
            Found in src_aurelia-bodylight-plugin/src/elements/animate-adobe.js - About 45 mins 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

            Consider simplifying this complex logical expression.
            Open

                if (this.element && this.element.au && this.element.au.controller && typeof (this.element.au.controller) === 'object' && this.element.au.controller.viewModel && typeof (this.element.au.controller.viewModel) === 'object') {
                    this.elementVM = this.element.au.controller.viewModel;
                    //check whether this.elementVM has changesrc function - to be called in event listener
                    //this.isReadMDCustomElement = (typeof this.elementVM.changesrc === 'function');
                } else {console.warn('element viewmodel object doesnot exists, cant be called by handleXXX methods')}
            Severity: Major
            Found in src_aurelia-bodylight-plugin/src/attributes/fmu-index.js - About 40 mins to fix

              Consider simplifying this complex logical expression.
              Open

                  if (
                      (typ != 'object' && !(typ == 'function' &&
                          typeof(o.item) == 'function')) ||
                      o === null ||
                      typeof(o.length) != 'number' ||
              Severity: Major
              Found in src_aurelia-bodylight-plugin/src/utils/dygraph.js - About 40 mins to fix

                Consider simplifying this complex logical expression.
                Open

                    if (this.element &&
                      this.element.au &&
                      this.element.au.controller &&
                      typeof (this.element.au.controller) === 'object' &&
                      this.element.au.controller.viewModel &&
                Severity: Major
                Found in src_aurelia-bodylight-plugin/src/attributes/value-convertor.js - About 40 mins to fix

                  Function doAnimatedZoom has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                  Dygraph.prototype.doAnimatedZoom = function(oldXRange, newXRange, oldYRanges, newYRanges, callback) {
                  Severity: Minor
                  Found in src_aurelia-bodylight-plugin/src/utils/dygraph.js - About 35 mins to fix

                    Function nonTrivialStrategy has 5 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                    var nonTrivialStrategy = function(renderer, ctx, color, strokeWidth, strokePattern) {
                    Severity: Minor
                    Found in src_aurelia-bodylight-plugin/src/utils/dygraph.js - About 35 mins to fix

                      Function getDateAxis has 5 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                      Dygraph.getDateAxis = function(start_time, end_time, granularity, opts, dg) {
                      Severity: Minor
                      Found in src_aurelia-bodylight-plugin/src/utils/dygraph.js - About 35 mins to fix

                        Function binarySearch has 5 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                        Dygraph.binarySearch = function(val, arry, abs, low, high) {
                        Severity: Minor
                        Found in src_aurelia-bodylight-plugin/src/utils/dygraph.js - About 35 mins to fix

                          Function renderFootnoteAnchor has 5 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                          function renderFootnoteAnchor(tokens, idx, options, env, slf) {
                          Severity: Minor
                          Found in src_aurelia-bodylight-plugin/src/elements/markdown-it-bfootnote.js - About 35 mins to fix

                            Function renderFootnoteOpen has 5 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                            function renderFootnoteOpen(tokens, idx, options, env, slf) {
                            Severity: Minor
                            Found in src_aurelia-bodylight-plugin/src/elements/markdown-it-bfootnote.js - About 35 mins to fix

                              Function renderFootnoteRef has 5 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                              function renderFootnoteRef(tokens, idx, options, env, slf) {
                              Severity: Minor
                              Found in src_aurelia-bodylight-plugin/src/elements/markdown-it-bfootnote.js - About 35 mins to fix
                                Severity
                                Category
                                Status
                                Source
                                Language