creative-connections/aurelia-bodylight-plugin

View on GitHub

Showing 552 of 552 total issues

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

  bind() {
    //console.log('chartjs bind');
    if ((typeof this.refindex == 'string') && (this.refindex.indexOf(',')>0)) { this.refindices = this.refindex.split(',')}
    else {
      this.refindex = myParseInt(this.refindex, 10);
Severity: Major
Found in src/elements/chartjs.js - About 6 hrs to fix

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

        removeScript(source) {
          let src = window.bdlBaseHref ? window.bdlBaseHref + source : source;
          let tags = document.getElementsByTagName('script');
          for (let i = tags.length; i >= 0; i--) { //search backwards within nodelist for matching elements to remove
            if (tags[i] && tags[i].getAttribute('src') !== null && tags[i].getAttribute('src').indexOf(src) !== -1) {tags[i].parentNode.removeChild(tags[i]);} //remove element by calling parentNode.removeChild()
    Severity: Major
    Found in src/elements/animate-adobe.js and 1 other location - About 6 hrs to fix
    src/elements/animate-adobe-ss.js on lines 253..259

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

    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

      removeScript(source) {
        let src = window.bdlBaseHref ? window.bdlBaseHref + source : source;
        let tags = document.getElementsByTagName('script');
        for (let i = tags.length; i >= 0; i--) { //search backwards within nodelist for matching elements to remove
          if (tags[i] && tags[i].getAttribute('src') !== null && tags[i].getAttribute('src').indexOf(src) !== -1) {tags[i].parentNode.removeChild(tags[i]);} //remove element by calling parentNode.removeChild()
    Severity: Major
    Found in src/elements/animate-adobe-ss.js and 1 other location - About 6 hrs to fix
    src/elements/animate-adobe.js on lines 207..213

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

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

    Dygraph.findPosY = function(obj) {
        var curtop = 0;
        if(obj.offsetParent) {
            var copyObj = obj;
            while(1) {
    Severity: Major
    Found in src/utils/dygraph.js and 1 other location - About 6 hrs to fix
    src/utils/dygraph.js on lines 5438..5458

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

    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

    Dygraph.findPosX = function(obj) {
        var curleft = 0;
        if(obj.offsetParent) {
            var copyObj = obj;
            while(1) {
    Severity: Major
    Found in src/utils/dygraph.js and 1 other location - About 6 hrs to fix
    src/utils/dygraph.js on lines 5465..5485

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

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

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

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

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

    Refactorings

    Further Reading

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

        constructor() {
            super();
            this.handleValueChange = e => {
                //let j = this.currentdataset;
                //all values from refindex to one dataset - as one curve
    Severity: Minor
    Found in src/elements/chartjs-fixed-xy.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

    File animate-adobe.js has 404 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import {bindable} from 'aurelia-framework';
    //import '@danzen/createjs';
    //import 'createjs/builds/1.0.0/createjs';
    import 'latest-createjs';
    //import 'createjs/builds/1.0.0/createjs';
    Severity: Minor
    Found in src/elements/animate-adobe.js - About 5 hrs to fix

      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

          onCanvasTouchEvent = function(e) {
              if (e.type == 'touchstart' && e.targetTouches.length == 1) {
                  if (onPanStart(e.targetTouches[0])) {
                      Dygraph.cancelEvent(e);
                  }
      Severity: Major
      Found in src/utils/dygraph.js and 1 other location - About 5 hrs to fix
      src/utils/dygraph.js on lines 7270..7282

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

      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

          onZoomHandleTouchEvent = function(e) {
              if (e.type == 'touchstart' && e.targetTouches.length == 1) {
                  if (onZoomStart(e.targetTouches[0])) {
                      Dygraph.cancelEvent(e);
                  }
      Severity: Major
      Found in src/utils/dygraph.js and 1 other location - About 5 hrs to fix
      src/utils/dygraph.js on lines 7284..7296

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

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

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

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

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

      Refactorings

      Further Reading

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

      DygraphCanvasRenderer.prototype._renderAxis = function() {
          if (!this.attr_('drawXAxis') && !this.attr_('drawYAxis')) return;
      
          // Round pixels to half-integer boundaries for crisper drawing.
          function halfUp(x)  { return Math.round(x) + 0.5; }
      Severity: Major
      Found in src/utils/dygraph.js - About 5 hrs to fix

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

          constructor() {
            super();
            //create lambda function which is added as listener later
            this.handleValueChange = e => {
              this.value = e.detail.data[this.refindex] * this.numerator / this.denominator;
        Severity: Major
        Found in src/elements/audio-on-decrease.js and 1 other location - About 5 hrs to fix
        src/elements/trigger-on-decrease.js on lines 7..18

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

        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

          constructor() {
            super();
            //create lambda function which is added as listener later
            this.handleValueChange = e => {
              this.value = e.detail.data[this.refindex] * this.numerator / this.denominator;
        Severity: Major
        Found in src/elements/trigger-on-decrease.js and 1 other location - About 5 hrs to fix
        src/elements/audio-on-decrease.js on lines 11..22

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

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

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

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

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

        Refactorings

        Further Reading

        Function attached has 131 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          attached() {
            //console.log('chartjs attached');
            //listening to custom event fmidata and fmireset
            const fromel = document.getElementById(this.fromid);
            if (fromel) {
        Severity: Major
        Found in src/elements/chartjs.js - About 5 hrs to fix

          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

          Severity
          Category
          Status
          Source
          Language