creative-connections/Bodylight.js-Components

View on GitHub

Showing 684 of 684 total issues

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

Dygraph.findPosY = function(obj) {
    var curtop = 0;
    if(obj.offsetParent) {
        var copyObj = obj;
        while(1) {
Severity: Major
Found in src_aurelia-bodylight-plugin/src/utils/dygraph.js and 1 other location - About 6 hrs to fix
src_aurelia-bodylight-plugin/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_aurelia-bodylight-plugin/src/utils/dygraph.js and 1 other location - About 6 hrs to fix
src_aurelia-bodylight-plugin/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

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

      for (let i=0;i<this.answer_exp_array.length;i++) {
//        const myterm = {title:this.answers_array[shuffled2indices[i]].answer,index:shuffled2indices[i],disabled:false,class:this.unselected}
        const myterm = {
          title:this.answer_exp_array[shuffled2indices[i]].answer,
          index:shuffled2indices[i],
Severity: Major
Found in src_aurelia-bodylight-plugin/src/elements/quizx.js and 1 other location - About 5 hrs to fix
src_aurelia-bodylight-plugin/src/elements/quiz.js on lines 77..88

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

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

      for (let i=0;i<this.answer_exp_array.length;i++) {
//        const myterm = {title:this.answers_array[shuffled2indices[i]].answer,index:shuffled2indices[i],disabled:false,class:this.unselected}
        const myterm = {
          title:this.answer_exp_array[shuffled2indices[i]].answer,
          index:shuffled2indices[i],
Severity: Major
Found in src_aurelia-bodylight-plugin/src/elements/quiz.js and 1 other location - About 5 hrs to fix
src_aurelia-bodylight-plugin/src/elements/quizx.js on lines 84..95

Duplicated Code

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

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

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

Tuning

This issue has a mass of 151.

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_aurelia-bodylight-plugin/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 405 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_aurelia-bodylight-plugin/src/elements/animate-adobe.js - About 5 hrs to fix

    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

        onZoomHandleTouchEvent = function(e) {
            if (e.type == 'touchstart' && e.targetTouches.length == 1) {
                if (onZoomStart(e.targetTouches[0])) {
                    Dygraph.cancelEvent(e);
                }
    Severity: Major
    Found in src_aurelia-bodylight-plugin/src/utils/dygraph.js and 1 other location - About 5 hrs to fix
    src_aurelia-bodylight-plugin/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

    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_aurelia-bodylight-plugin/src/utils/dygraph.js and 1 other location - About 5 hrs to fix
    src_aurelia-bodylight-plugin/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

    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 _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_aurelia-bodylight-plugin/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;
      src_aurelia-bodylight-plugin/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;
      src_aurelia-bodylight-plugin/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_aurelia-bodylight-plugin/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_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

        Function numericTicks has 123 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        Dygraph.numericTicks = function (a, b, pixels, opts, dygraph, vals) {
            //console.log("nt a " + a + " b " + b + " vals " + vals);
            var pixels_per_tick = opts('pixelsPerLabel');
            var ticks = [];
            var i, j, tickV, nTicks;
        Severity: Major
        Found in src_aurelia-bodylight-plugin/src/utils/dygraph.js - About 4 hrs to fix

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

          function sub_plugin(md) {
            var escapeRE        = md.utils.escapeRE,
                arrayReplaceAt  = md.utils.arrayReplaceAt;
          
            // ASCII characters in Cc, Sc, Sm, Sk categories we should terminate on;
          Severity: Major
          Found in src_aurelia-bodylight-plugin/src/elements/markdown-it-abbr-ext.js - About 4 hrs to fix
            Severity
            Category
            Status
            Source
            Language