creative-connections/aurelia-bodylight-plugin

View on GitHub
src/elements/fmi.js

Summary

Maintainability
F
1 wk
Test Coverage

File fmi.js has 692 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import {bindable,observable} from 'aurelia-framework';
import _ from 'lodash';

export const thirdpartytimeout = 5000;

Severity: Major
Found in src/elements/fmi.js - About 1 day to fix

    Fmi has 48 functions (exceeds 20 allowed). Consider refactoring.
    Open

    export class Fmi {
      @bindable fminame='N/A';
      @bindable tolerance=0.000001;//0.000030517578
      @bindable starttime=0;
      @bindable stoptime=0; //if >0 then fmi will stop at stoptime
    Severity: Minor
    Found in src/elements/fmi.js - About 6 hrs to fix

      Function step has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring.
      Open

        step(e) {
          //this = window.thisfmi;
          //primitive semaphore, only one instance can perform this call
          if (!this.doingstep) {
            //console.log('fmu step()');
      Severity: Minor
      Found in src/elements/fmi.js - About 5 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 registerInputs has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
      Open

        registerInputs(){
          if (this.inputs) { //register DOM elements to listen to their 'change' event directly
            let inputparts = this.inputs.split(';'); //splits groups delimited by ;
            this.inputreferences = [];
            for (let inputpart of inputparts) {
      Severity: Minor
      Found in src/elements/fmi.js - About 4 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/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 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 step has 59 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        step(e) {
          //this = window.thisfmi;
          //primitive semaphore, only one instance can perform this call
          if (!this.doingstep) {
            //console.log('fmu step()');
      Severity: Major
      Found in src/elements/fmi.js - About 2 hrs to fix

        Function instantiate has 58 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          instantiate() {
            console.log('fmi instantiate()');
            //first define FMI API function names;
            const sReset = 'fmi2Reset';
            const sInstantiate = 'fmi2Instantiate';
        Severity: Major
        Found in src/elements/fmi.js - About 2 hrs to fix

          Function initfmi has 48 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            initfmi() {
              console.log('fmi initfmi()');
              let that = {};
              if (window.thisfmi) {
                that.fminame = window.thisfmi.fminame;
          Severity: Minor
          Found in src/elements/fmi.js - About 1 hr to fix

            Function startSimulation has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
            Open

              startSimulation() {
                this.animationstarted = true;
                this.fpsInterval = 1000 / (isNaN(this.fpslimit) ? parseInt(this.fpslimit, 10) : this.fpslimit);
                this.then = window.performance.now();
                const performAnimation = (newtime) => {
            Severity: Minor
            Found in src/elements/fmi.js - About 1 hr 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 registerInputs has 41 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              registerInputs(){
                if (this.inputs) { //register DOM elements to listen to their 'change' event directly
                  let inputparts = this.inputs.split(';'); //splits groups delimited by ;
                  this.inputreferences = [];
                  for (let inputpart of inputparts) {
            Severity: Minor
            Found in src/elements/fmi.js - About 1 hr to fix

              Function constructor has 39 lines of code (exceeds 25 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/elements/fmi.js - About 1 hr to fix

                Function deregisterInputs has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                Open

                  deregisterInputs() {
                    //do removeListeners()
                    if (this.inputs) {
                      let inputparts = this.inputs.split(';');
                      for (let inputpart of inputparts) {
                Severity: Minor
                Found in src/elements/fmi.js - About 1 hr 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 28 lines of code (exceeds 25 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 1 hr to fix

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

                    bind() {
                      this.isOneshot = this.mode === 'oneshot';
                      this.isOnestep = this.mode === 'onestep';
                      if (this.isOnestep) {
                        this.showcontrols = false;
                  Severity: Minor
                  Found in src/elements/fmi.js - About 1 hr 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 initfmi has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                  Open

                    initfmi() {
                      console.log('fmi initfmi()');
                      let that = {};
                      if (window.thisfmi) {
                        that.fminame = window.thisfmi.fminame;
                  Severity: Minor
                  Found in src/elements/fmi.js - About 1 hr 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 27 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    bind() {
                      this.isOneshot = this.mode === 'oneshot';
                      this.isOnestep = this.mode === 'onestep';
                      if (this.isOnestep) {
                        this.showcontrols = false;
                  Severity: Minor
                  Found in src/elements/fmi.js - About 1 hr to fix

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

                      setInputVariables() {
                        for (let key in this.changeinputs) {
                          let myinputs = this.changeinputs[key];
                          //console.log('changing inputs', myinputs);
                          //set real - reference is in - one input one reference
                    Severity: Minor
                    Found in src/elements/fmi.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 shot has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                      shot(e){
                        //check whether initialized and instantiated
                        if (!this.inst) {
                          //not instantiated
                          if (window.fmiinst && window.fmiinst[this.fminame]) {
                    Severity: Minor
                    Found in src/elements/fmi.js - About 25 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

                      flushRealQueue() {
                        if (this.setRealQueue) {
                          const referenceBuffer = this.createAndFillBuffer(new Int32Array(this.setRealQueue.references));
                          const references = this.viewBuffer(referenceBuffer);
                          const valueBuffer = this.createAndFillBuffer(new Float64Array(this.setRealQueue.values));
                    Severity: Major
                    Found in src/elements/fmi.js and 1 other location - About 6 hrs to fix
                    src/elements/fmi.js on lines 860..873

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

                    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

                      flushBooleanQueue() {
                        if (this.setBooleanQueue) {
                          const referenceBuffer = this.createAndFillBuffer(new Int32Array(this.setBooleanQueue.references));
                          const references = this.viewBuffer(referenceBuffer);
                          const valueBuffer = this.createAndFillBuffer(new Int32Array(this.setBooleanQueue.values));
                    Severity: Major
                    Found in src/elements/fmi.js and 1 other location - About 6 hrs to fix
                    src/elements/fmi.js on lines 845..858

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

                    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

                      getReals(references) {
                        const queryBuffer = this.createAndFillBuffer(new Int32Array(references));
                        const query = this.viewBuffer(queryBuffer);
                        const outputBuffer = this.createBuffer(new Float64Array(references.length));
                        const output = this.viewBuffer(outputBuffer);
                    Severity: Major
                    Found in src/elements/fmi.js and 1 other location - About 5 hrs to fix
                    src/elements/fmi.js on lines 903..913

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

                    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

                      getBooleans(references) {
                        const queryBuffer = this.createAndFillBuffer(new Int32Array(references));
                        const query = this.viewBuffer(queryBuffer);
                        const outputBuffer = this.createBuffer(new Int32Array(references.length));
                        const output = this.viewBuffer(outputBuffer);
                    Severity: Major
                    Found in src/elements/fmi.js and 1 other location - About 5 hrs to fix
                    src/elements/fmi.js on lines 800..813

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

                    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

                      getSingleBoolean(reference) {
                        const queryBuffer = this.createAndFillBuffer(new Int32Array([reference]));
                        const query = this.viewBuffer(queryBuffer);
                        const outputBuffer = this.createBuffer(new Int32Array(1));
                        const output = this.viewBuffer(outputBuffer);
                    Severity: Major
                    Found in src/elements/fmi.js and 1 other location - About 5 hrs to fix
                    src/elements/fmi.js on lines 815..828

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

                    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

                      getSingleReal(reference) {
                        const queryBuffer = this.createAndFillBuffer(new Int32Array([reference]));
                        const query = this.viewBuffer(queryBuffer);
                        const outputBuffer = this.createBuffer(new Float64Array(1));
                        const output = this.viewBuffer(outputBuffer);
                    Severity: Major
                    Found in src/elements/fmi.js and 1 other location - About 5 hrs to fix
                    src/elements/fmi.js on lines 892..902

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

                    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

                      round(value, decimals) {
                        if (decimals < 0) {let posdecimals = -decimals; return Number(Math.round(value + 'e' + posdecimals) + 'e-' + posdecimals);}
                        return Number(Math.round(value + 'e-' + decimals) + 'e+' + decimals);
                      }
                    Severity: Major
                    Found in src/elements/fmi.js and 1 other location - About 2 hrs to fix
                    src/elements/remote-value.js on lines 149..155

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

                    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 3 locations. Consider refactoring.
                    Open

                        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?
                          if (callback) setTimeout(callback, 0);
                          return;
                    Severity: Major
                    Found in src/elements/fmi.js and 2 other locations - About 2 hrs to fix
                    src/elements/animate-adobe-ss.js on lines 152..157
                    src/elements/animate-adobe.js on lines 218..223

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

                    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 direct(nopromise) to do step()')
                            setTimeout(window.thisfmi.sendStartEvent.bind(window.thisfmi),1000)
                            //setTimeout(window.thisfmi.step.bind(window.thisfmi),1500);
                            _.throttle(window.thisfmi.step.bind(window.thisfmi),1500);
                    Severity: Major
                    Found in src/elements/fmi.js and 1 other location - About 2 hrs to fix
                    src/elements/fmi.js on lines 315..323

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

                    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.isOneshot) {
                            console.log('oneshot scheduling direct(nopromise) to do step()')
                            setTimeout(window.thisfmi.sendStartEvent.bind(window.thisfmi),1000)
                            //setTimeout(window.thisfmi.shot.bind(window.thisfmi),1500);
                            _.throttle(window.thisfmi.shot.bind(window.thisfmi),1500);
                    Severity: Major
                    Found in src/elements/fmi.js and 1 other location - About 2 hrs to fix
                    src/elements/fmi.js on lines 309..323

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

                    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.controlid) {
                          document.getElementById(this.controlid).addEventListener('fmistart', this.handleStart);
                          document.getElementById(this.controlid).addEventListener('fmistop', this.handleStop);
                        }
                    Severity: Major
                    Found in src/elements/fmi.js and 1 other location - About 1 hr to fix
                    src/elements/fmi.js on lines 362..365

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

                    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.controlid) {
                          document.getElementById(this.controlid).removeEventListener('fmistart', this.handleStart);
                          document.getElementById(this.controlid).removeEventListener('fmistop', this.handleStop);
                        }
                    Severity: Major
                    Found in src/elements/fmi.js and 1 other location - About 1 hr to fix
                    src/elements/fmi.js on lines 201..204

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

                    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/elements/fmi.js and 1 other location - About 1 hr to fix
                    src/elements/fmi.js on lines 290..300

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

                    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

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

                          if (e.detail && e.detail.id) targetid = e.detail.id;
                          else if (e.target.id.length > 0) targetid = e.target.id;
                          else targetid = e.target.parentElement.parentElement.id;
                    Severity: Major
                    Found in src/elements/fmi.js and 1 other location - About 1 hr to fix
                    src/elements/remote-value.js on lines 35..37

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

                    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 5 locations. Consider refactoring.
                    Open

                          this.stepSize = this.fmuspeed * ((typeof(this.fstepsize) === 'string' ) ? parseFloat(this.fstepsize) : this.fstepsize);
                    Severity: Major
                    Found in src/elements/fmi.js and 4 other locations - About 35 mins to fix
                    src/elements/fmi.js on lines 421..421
                    src/elements/fmi.js on lines 741..741
                    src/elements/fmi.js on lines 756..756
                    src/elements/fmi.js on lines 944..944

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

                    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 5 locations. Consider refactoring.
                    Open

                        this.stepSize = this.fmuspeed * ((typeof(this.fstepsize) === 'string' ) ? parseFloat(this.fstepsize) : this.fstepsize);
                    Severity: Major
                    Found in src/elements/fmi.js and 4 other locations - About 35 mins to fix
                    src/elements/fmi.js on lines 353..353
                    src/elements/fmi.js on lines 421..421
                    src/elements/fmi.js on lines 741..741
                    src/elements/fmi.js on lines 756..756

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

                    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 5 locations. Consider refactoring.
                    Open

                        this.stepSize = this.fmuspeed * ((typeof(this.fstepsize) === 'string' ) ? parseFloat(this.fstepsize) : this.fstepsize);
                    Severity: Major
                    Found in src/elements/fmi.js and 4 other locations - About 35 mins to fix
                    src/elements/fmi.js on lines 353..353
                    src/elements/fmi.js on lines 421..421
                    src/elements/fmi.js on lines 756..756
                    src/elements/fmi.js on lines 944..944

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

                    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 5 locations. Consider refactoring.
                    Open

                        this.stepSize = this.fmuspeed * ((typeof(this.fstepsize) === 'string' ) ? parseFloat(this.fstepsize) : this.fstepsize);
                    Severity: Major
                    Found in src/elements/fmi.js and 4 other locations - About 35 mins to fix
                    src/elements/fmi.js on lines 353..353
                    src/elements/fmi.js on lines 741..741
                    src/elements/fmi.js on lines 756..756
                    src/elements/fmi.js on lines 944..944

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

                    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 5 locations. Consider refactoring.
                    Open

                        this.stepSize = this.fmuspeed * ((typeof(this.fstepsize) === 'string' ) ? parseFloat(this.fstepsize) : this.fstepsize);
                    Severity: Major
                    Found in src/elements/fmi.js and 4 other locations - About 35 mins to fix
                    src/elements/fmi.js on lines 353..353
                    src/elements/fmi.js on lines 421..421
                    src/elements/fmi.js on lines 741..741
                    src/elements/fmi.js on lines 944..944

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

                    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

                    There are no issues that match your filters.

                    Category
                    Status