creative-connections/Bodylight.js-Components

View on GitHub
src_aurelia-bodylight-plugin/src/elements/fmi.js

Summary

Maintainability
F
1 wk
Test Coverage

File fmi.js has 721 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_aurelia-bodylight-plugin/src/elements/fmi.js - About 1 day to fix

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

    export class Fmi {
      @bindable fminame='';
      @bindable fmifunctionprefixname='';
      @bindable tolerance=0.000001;//0.000030517578
      @bindable starttime=0;
    Severity: Minor
    Found in src_aurelia-bodylight-plugin/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_aurelia-bodylight-plugin/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_aurelia-bodylight-plugin/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_aurelia-bodylight-plugin/src/elements/fmi.js - About 3 hrs to fix

      Cognitive Complexity

      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

      A method's cognitive complexity is based on a few simple rules:

      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
      • Code is considered more complex for each "break in the linear flow of the code"
      • Code is considered more complex when "flow breaking structures are nested"

      Further reading

      Function 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_aurelia-bodylight-plugin/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 instantiate has 61 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_aurelia-bodylight-plugin/src/elements/fmi.js - About 2 hrs to fix

        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_aurelia-bodylight-plugin/src/elements/fmi.js - About 2 hrs to fix

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

            initfmi() {
              console.log('fmi initfmi()');
              let that = {};
              /* global/local fminame */
              
          Severity: Minor
          Found in src_aurelia-bodylight-plugin/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();
                //read input values
            Severity: Minor
            Found in src_aurelia-bodylight-plugin/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_aurelia-bodylight-plugin/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_aurelia-bodylight-plugin/src/elements/fmi.js - About 1 hr to fix

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

                  deregisterInputs() {
                    console.warn('deregistering inputs');//do removeListeners()
                    window.animateranges = [];
                    if (this.inputs) {
                      let inputparts = this.inputs.split(';');
                Severity: Minor
                Found in src_aurelia-bodylight-plugin/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 setInputVariables has a Cognitive Complexity of 12 (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_aurelia-bodylight-plugin/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 a Cognitive Complexity of 11 (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_aurelia-bodylight-plugin/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 30 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_aurelia-bodylight-plugin/src/elements/fmi.js - About 1 hr to fix

                  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_aurelia-bodylight-plugin/src/elements/fmi.js - About 1 hr to fix

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

                      initfmi() {
                        console.log('fmi initfmi()');
                        let that = {};
                        /* global/local fminame */
                        
                    Severity: Minor
                    Found in src_aurelia-bodylight-plugin/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 shot has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                      shot(e){
                        console.log('fmi -> shot()')
                        //check whether initialized and instantiated
                        if (!this.inst) {
                          //not instantiated
                    Severity: Minor
                    Found in src_aurelia-bodylight-plugin/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

                    Function instantiate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                      instantiate() {
                        console.log('fmi instantiate()');
                        //first define FMI API function names;
                        const sReset = 'fmi2Reset';
                        const sInstantiate = 'fmi2Instantiate';
                    Severity: Minor
                    Found in src_aurelia-bodylight-plugin/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

                      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_aurelia-bodylight-plugin/src/elements/fmi.js and 1 other location - About 6 hrs to fix
                    src_aurelia-bodylight-plugin/src/elements/fmi.js on lines 882..895

                    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

                      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_aurelia-bodylight-plugin/src/elements/fmi.js and 1 other location - About 6 hrs to fix
                    src_aurelia-bodylight-plugin/src/elements/fmi.js on lines 897..910

                    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

                      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_aurelia-bodylight-plugin/src/elements/fmi.js and 1 other location - About 5 hrs to fix
                    src_aurelia-bodylight-plugin/src/elements/fmi.js on lines 837..850

                    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

                      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_aurelia-bodylight-plugin/src/elements/fmi.js and 1 other location - About 5 hrs to fix
                    src_aurelia-bodylight-plugin/src/elements/fmi.js on lines 940..950

                    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_aurelia-bodylight-plugin/src/elements/fmi.js and 1 other location - About 5 hrs to fix
                    src_aurelia-bodylight-plugin/src/elements/fmi.js on lines 852..865

                    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_aurelia-bodylight-plugin/src/elements/fmi.js and 1 other location - About 5 hrs to fix
                    src_aurelia-bodylight-plugin/src/elements/fmi.js on lines 929..939

                    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_aurelia-bodylight-plugin/src/elements/fmi.js and 1 other location - About 2 hrs to fix
                    src_aurelia-bodylight-plugin/src/elements/remote-value.js on lines 153..159

                    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_aurelia-bodylight-plugin/src/elements/fmi.js and 2 other locations - About 2 hrs to fix
                    src_aurelia-bodylight-plugin/src/elements/animate-adobe-ss.js on lines 152..157
                    src_aurelia-bodylight-plugin/src/elements/animate-adobe.js on lines 221..226

                    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_aurelia-bodylight-plugin/src/elements/fmi.js and 1 other location - About 2 hrs to fix
                    src_aurelia-bodylight-plugin/src/elements/fmi.js on lines 323..331

                    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_aurelia-bodylight-plugin/src/elements/fmi.js and 1 other location - About 2 hrs to fix
                    src_aurelia-bodylight-plugin/src/elements/fmi.js on lines 317..331

                    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_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 373..376

                    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_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 203..206

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

                    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

                    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_aurelia-bodylight-plugin/src/elements/fmi.js and 1 other location - About 1 hr to fix
                    src_aurelia-bodylight-plugin/src/elements/remote-value.js on lines 36..38

                    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_aurelia-bodylight-plugin/src/elements/fmi.js and 4 other locations - About 35 mins to fix
                    src_aurelia-bodylight-plugin/src/elements/fmi.js on lines 442..442
                    src_aurelia-bodylight-plugin/src/elements/fmi.js on lines 778..778
                    src_aurelia-bodylight-plugin/src/elements/fmi.js on lines 793..793
                    src_aurelia-bodylight-plugin/src/elements/fmi.js on lines 981..981

                    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_aurelia-bodylight-plugin/src/elements/fmi.js and 4 other locations - About 35 mins to fix
                    src_aurelia-bodylight-plugin/src/elements/fmi.js on lines 361..361
                    src_aurelia-bodylight-plugin/src/elements/fmi.js on lines 442..442
                    src_aurelia-bodylight-plugin/src/elements/fmi.js on lines 793..793
                    src_aurelia-bodylight-plugin/src/elements/fmi.js on lines 981..981

                    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_aurelia-bodylight-plugin/src/elements/fmi.js and 4 other locations - About 35 mins to fix
                    src_aurelia-bodylight-plugin/src/elements/fmi.js on lines 361..361
                    src_aurelia-bodylight-plugin/src/elements/fmi.js on lines 778..778
                    src_aurelia-bodylight-plugin/src/elements/fmi.js on lines 793..793
                    src_aurelia-bodylight-plugin/src/elements/fmi.js on lines 981..981

                    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_aurelia-bodylight-plugin/src/elements/fmi.js and 4 other locations - About 35 mins to fix
                    src_aurelia-bodylight-plugin/src/elements/fmi.js on lines 361..361
                    src_aurelia-bodylight-plugin/src/elements/fmi.js on lines 442..442
                    src_aurelia-bodylight-plugin/src/elements/fmi.js on lines 778..778
                    src_aurelia-bodylight-plugin/src/elements/fmi.js on lines 793..793

                    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_aurelia-bodylight-plugin/src/elements/fmi.js and 4 other locations - About 35 mins to fix
                    src_aurelia-bodylight-plugin/src/elements/fmi.js on lines 361..361
                    src_aurelia-bodylight-plugin/src/elements/fmi.js on lines 442..442
                    src_aurelia-bodylight-plugin/src/elements/fmi.js on lines 778..778
                    src_aurelia-bodylight-plugin/src/elements/fmi.js on lines 981..981

                    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