creative-connections/Bodylight.js-Components

View on GitHub

Showing 684 of 684 total issues

Avoid deeply nested control flow statements.
Open

                    if (maxY < 0) maxAxisY = 0;
Severity: Major
Found in src_aurelia-bodylight-plugin/src/utils/dygraph.js - About 45 mins to fix

    Avoid deeply nested control flow statements.
    Open

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

      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

        Avoid deeply nested control flow statements.
        Open

                            if (attrs[property].hasOwnProperty(subProperty) && !pixelSafeOptions[subProperty]) {
                                requiresNewPoints = true;
                            }
        Severity: Major
        Found in src_aurelia-bodylight-plugin/src/utils/dygraph.js - About 45 mins to fix

          Avoid deeply nested control flow statements.
          Open

                              if (lastDisplayed === null) {
                                  lastDisplayed = {
                                      tickValue: tickValue,
                                      pixel_coord: pixel_coord
                                  };
          Severity: Major
          Found in src_aurelia-bodylight-plugin/src/utils/dygraph.js - About 45 mins to fix

            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

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                    if (abs > 0) {
                        // Accept if element > val, but also if prior element < val.
                        idx = mid - 1;
                        if (validIndex(idx) && arry[idx] < val) {
                            return mid;
            Severity: Minor
            Found in src_aurelia-bodylight-plugin/src/utils/dygraph.js and 1 other location - About 45 mins to fix
            src_aurelia-bodylight-plugin/src/utils/dygraph.js on lines 5674..5680

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 50.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            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 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

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

                } else {
                  let setqa = {id:this.id,answer:answer.answer,removeAnswer:true}
                  this.ea.publish('quizsetanswer', setqa)
                }
            Severity: Minor
            Found in src_aurelia-bodylight-plugin/src/elements/quizx.js and 1 other location - About 45 mins to fix
            src_aurelia-bodylight-plugin/src/elements/quizx.js on lines 251..254

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 50.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            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

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                      if (ret.length > 0 && row[0] < ret[ret.length - 1][0]) {
                          outOfOrder = true;
                      }
              Severity: Minor
              Found in src_aurelia-bodylight-plugin/src/utils/dygraph.js and 1 other location - About 45 mins to fix
              src_aurelia-bodylight-plugin/src/utils/dygraph.js on lines 4610..4612

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 50.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              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

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                        if (abs < 0) {
                            // Accept if element < val, but also if prior element > val.
                            idx = mid + 1;
                            if (validIndex(idx) && arry[idx] > val) {
                                return mid;
                Severity: Minor
                Found in src_aurelia-bodylight-plugin/src/utils/dygraph.js and 1 other location - About 45 mins to fix
                src_aurelia-bodylight-plugin/src/utils/dygraph.js on lines 5664..5670

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 50.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                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

                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

                Identical blocks of code found in 2 locations. Consider refactoring.
                Open

                        if (((this.elimits[1] - rawdata) / (this.elimits[1] - this.elimits[0])) < 0.05) {
                          this.options.plugins.datalabels.align = 'left';
                          this.options.plugins.datalabels.color = 'white';
                        } else {
                          this.options.plugins.datalabels.align = 'right';
                Severity: Minor
                Found in src_aurelia-bodylight-plugin/src/elements/chartjs-barplot.js and 1 other location - About 45 mins to fix
                src_aurelia-bodylight-plugin/src/elements/chartjs-barplot.js on lines 115..121

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 50.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                Similar blocks of code found in 2 locations. Consider refactoring.
                Open

                    if (answer.user) {
                      let setqa = {id:this.id,answer:answer.answer,addAnswer:true}
                      this.ea.publish('quizsetanswer', setqa)
                    } else {
                Severity: Minor
                Found in src_aurelia-bodylight-plugin/src/elements/quizx.js and 1 other location - About 45 mins to fix
                src_aurelia-bodylight-plugin/src/elements/quizx.js on lines 254..257

                Duplicated Code

                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                Tuning

                This issue has a mass of 50.

                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                Refactorings

                Further Reading

                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

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