creative-connections/Bodylight.js-Components

View on GitHub

Showing 684 of 684 total issues

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

        if (window.thisfmi.isOneshot) {
          //console.log('oneshot scheduling startevent in promise() to do step()')
          setTimeout(window.thisfmi.sendStartEvent.bind(window.thisfmi),800);
          console.log('oneshot scheduling promise() to do shot() after 4.5s')
          //setTimeout(window.thisfmi.shot.bind(window.thisfmi),1500);
Severity: Major
Found in src_aurelia-bodylight-plugin/src/elements/fmi.js and 1 other location - About 1 hr to fix
src_aurelia-bodylight-plugin/src/elements/fmi.js on lines 291..308

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

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 (window.thisfmi.isOnestep) {
          //console.log('onestep scheduling startevent in promise() to do step()')
          setTimeout(window.thisfmi.sendStartEvent.bind(window.thisfmi),1000);
          console.log('onestep scheduling promise() to do step()')
          //setTimeout(window.thisfmi.step.bind(window.thisfmi),1500);
Severity: Major
Found in src_aurelia-bodylight-plugin/src/elements/fmi.js and 1 other location - About 1 hr to fix
src_aurelia-bodylight-plugin/src/elements/fmi.js on lines 298..308

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

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 log has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

Dygraph.log = function(severity, message) {
    var st;
    if (typeof(printStackTrace) != 'undefined') {
        // Remove uninteresting bits: logging functions and paths.
        st = printStackTrace({guess:false});
Severity: Minor
Found in src_aurelia-bodylight-plugin/src/utils/dygraph.js - About 1 hr to fix

    Function handleResize has 34 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      handleResize() {
        console.log('animateadobe handleResize()');
        //do not run if ani.lib is not defined - no adobe component is available
        if (!this.lib) return;
        let w = this.lib.properties.width; let h = this.lib.properties.height;
    Severity: Minor
    Found in src_aurelia-bodylight-plugin/src/elements/animate-adobe-ss.js - About 1 hr to fix

      Function afterDraw has 34 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

                      afterDraw: (chart) => {
                          if (chart.config.options.refpointplugin) {
                              const ctx = chart.canvas.getContext('2d');
                              ctx.save();
      
      
      Severity: Minor
      Found in src_aurelia-bodylight-plugin/src/elements/chartjs-fixed.js - About 1 hr to fix

        Function processAnswers has 34 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            processAnswers(data) {
                //const dbRef = ref(this.database, 'answers/');
                //dbRef.once('value', snapshot => {
                //const data = snapshot.val();
                let aggregatedResults = {}
        Severity: Minor
        Found in src_aurelia-bodylight-plugin/src/elements/fb-config.js - About 1 hr to fix

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

            bind() {
              //either badges are defined - images in slot, or images are defined
              //badges = 5, defines number of dots/badges generated
              //create items array - numbers from 0 to 'badges -1'
              if (this.infos) {
          Severity: Minor
          Found in src_aurelia-bodylight-plugin/src/elements/carousel.js - About 1 hr to fix

            Function handleResize has 34 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                handleResize() {
                  console.log('animateadobe handleResize()');
                  //do not run if ani.lib is not defined - no adobe component is available
                  if (!window.ani.lib) return;
                  let w = window.ani.lib.properties.width; let h = window.ani.lib.properties.height;
            Severity: Minor
            Found in src_aurelia-bodylight-plugin/src/elements/animate-adobe.js - About 1 hr to fix

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

                      if (regionWidth < 2 && regionHeight < 2 &&
                          g.lastx_ !== undefined && g.lastx_ != -1) {
                          Dygraph.Interaction.treatMouseOpAsClick(g, event, context);
                      }
              Severity: Major
              Found in src_aurelia-bodylight-plugin/src/utils/dygraph.js and 1 other location - About 1 hr to fix
              src_aurelia-bodylight-plugin/src/utils/dygraph.js on lines 6601..6604

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

              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 (this.quizindex<(this.quizids.length-1)) {
                        this.quizindex++;
                        this.showquiz(this.quizids2[this.quizindex]);
                        if (this.quizindex<(this.quizids.length-1)) {
                          this.showback = true;
              Severity: Major
              Found in src_aurelia-bodylight-plugin/src/elements/quiz-control.js and 1 other location - About 1 hr to fix
              src_aurelia-bodylight-plugin/src/elements/quiz-control.js on lines 79..95

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

              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

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

                  if (regionWidth < 2 && regionHeight < 2 &&
                      g.lastx_ !== undefined && g.lastx_ != -1) {
                      Dygraph.Interaction.treatMouseOpAsClick(g, event, context);
                  }
              Severity: Major
              Found in src_aurelia-bodylight-plugin/src/utils/dygraph.js and 1 other location - About 1 hr to fix
              src_aurelia-bodylight-plugin/src/utils/dygraph.js on lines 6865..6868

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

              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 (this.quizindex>0) {
                        this.quizindex--;
                        this.showquiz(this.quizids2[this.quizindex]);
                        if (this.quizindex>0) {
                        this.showback = true;
              Severity: Major
              Found in src_aurelia-bodylight-plugin/src/elements/quiz-control.js and 1 other location - About 1 hr to fix
              src_aurelia-bodylight-plugin/src/elements/quiz-control.js on lines 56..72

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

              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 clear has 33 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              DygraphCanvasRenderer.prototype.clear = function() {
                  var context;
                  if (this.isIE) {
                      // VML takes a while to start up, so we just poll every this.IEDelay
                      try {
              Severity: Minor
              Found in src_aurelia-bodylight-plugin/src/utils/dygraph.js - About 1 hr to fix

                Function _evaluateLimits has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                DygraphLayout.prototype._evaluateLimits = function () {
                    //TODO(tomaton): fix xrange when last x value is not the highest in case of x = sin(y) x is from 0 to 1 and back to 0
                    //and range for x is 0 to 1
                    this.minxval = this.maxxval = null;
                    if (this.dateWindow_) {
                Severity: Minor
                Found in src_aurelia-bodylight-plugin/src/utils/dygraph.js - About 1 hr to fix

                  Function generateSource has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    generateSource(className) {
                      return `import {inject} from 'aurelia-dependency-injection';
                  import {Project, ProjectItem, CLIOptions, UI} from 'aurelia-cli';
                  
                  @inject(Project, CLIOptions, UI)
                  Severity: Minor
                  Found in aurelia_project/generators/generator.js - About 1 hr to fix

                    Function afterDraw has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                                    afterDraw: (chart) => {
                                        
                                            const ctx = chart.canvas.getContext('2d');
                                            ctx.save();
                    
                    
                    Severity: Minor
                    Found in src_aurelia-bodylight-plugin/src/elements/chartjs-time.js - About 1 hr to fix

                      Function generateSource has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        generateSource(className) {
                          return `import {inject} from 'aurelia-dependency-injection';
                      import {Project, ProjectItem, CLIOptions, UI} from 'aurelia-cli';
                      
                      @inject(Project, CLIOptions, UI)

                        Function constructor has 33 lines of code (exceeds 25 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 1 hr to fix

                          Function get has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              get() {
                                  this.inProgress = true; // Mark request as in progress
                                  //sends GET request to
                                  let myheaders = new Headers();
                                  //localStorage.setItem('bdl-fhir-url',this.remoteurl);
                          Severity: Minor
                          Found in src_aurelia-bodylight-plugin/src/elements/remote-value.js - About 1 hr to fix

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

                                    if (convertitems[0] === '1' && convertitems[1] === '1') {
                                      this.operation.push(identity);
                                    } else {
                                      let numerator = parseFloat(convertitems[0]);
                                      let denominator = parseFloat(convertitems[1]);
                            src_aurelia-bodylight-plugin/src/elements/plotly.js on lines 40..45

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

                            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

                            Severity
                            Category
                            Status
                            Source
                            Language