creative-connections/Bodylight.js-Components

View on GitHub

Showing 684 of 684 total issues

Function setAnimationValue has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    setAnimationValue(objname, value) {
      //console.log('animateadobe setAnimationValue',value);
      //console.log('adobe-animate() setting window.ani.exportRoot.children[0][' + objname + '].gotoAndStop(' + value + ')');
      if (window.ani.exportRoot) {
        //resolve path from string
Severity: Minor
Found in src_aurelia-bodylight-plugin/src/elements/animate-adobe.js - About 55 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 setText has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    setText(objname, textvalue) {
      //console.log('animateadobe set text:',textvalue);
      if (window.ani.exportRoot) {
        const resolvePath = (object, path, defaultValue) => path
          .split('.')
Severity: Minor
Found in src_aurelia-bodylight-plugin/src/elements/animate-adobe.js - About 55 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 constructor has a Cognitive Complexity of 9 (exceeds 5 allowed). 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: Minor
Found in src_aurelia-bodylight-plugin/src/elements/audio-on-decrease.js - About 55 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 8 locations. Consider refactoring.
Open

    this.terms_array = (this.terms)? this.terms.split('|').map(s => s.trim()): [];
Severity: Major
Found in src_aurelia-bodylight-plugin/src/elements/quizx.js and 7 other locations - About 55 mins to fix
src_aurelia-bodylight-plugin/src/elements/quiz.js on lines 25..25
src_aurelia-bodylight-plugin/src/elements/quiz.js on lines 26..26
src_aurelia-bodylight-plugin/src/elements/quiz.js on lines 27..27
src_aurelia-bodylight-plugin/src/elements/quiz.js on lines 28..28
src_aurelia-bodylight-plugin/src/elements/quizx.js on lines 28..28
src_aurelia-bodylight-plugin/src/elements/quizx.js on lines 30..30
src_aurelia-bodylight-plugin/src/elements/quizx.js on lines 31..31

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

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

    this.explanation_array = (this.explanations)? this.explanations.split('|').map(s => s.trim()): [];
Severity: Major
Found in src_aurelia-bodylight-plugin/src/elements/quizx.js and 7 other locations - About 55 mins to fix
src_aurelia-bodylight-plugin/src/elements/quiz.js on lines 25..25
src_aurelia-bodylight-plugin/src/elements/quiz.js on lines 26..26
src_aurelia-bodylight-plugin/src/elements/quiz.js on lines 27..27
src_aurelia-bodylight-plugin/src/elements/quiz.js on lines 28..28
src_aurelia-bodylight-plugin/src/elements/quizx.js on lines 28..28
src_aurelia-bodylight-plugin/src/elements/quizx.js on lines 29..29
src_aurelia-bodylight-plugin/src/elements/quizx.js on lines 31..31

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

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

    this.answers_array = (this.answers)? this.answers.split('|').map(s => s.trim()): [];
Severity: Major
Found in src_aurelia-bodylight-plugin/src/elements/quiz.js and 7 other locations - About 55 mins to fix
src_aurelia-bodylight-plugin/src/elements/quiz.js on lines 26..26
src_aurelia-bodylight-plugin/src/elements/quiz.js on lines 27..27
src_aurelia-bodylight-plugin/src/elements/quiz.js on lines 28..28
src_aurelia-bodylight-plugin/src/elements/quizx.js on lines 28..28
src_aurelia-bodylight-plugin/src/elements/quizx.js on lines 29..29
src_aurelia-bodylight-plugin/src/elements/quizx.js on lines 30..30
src_aurelia-bodylight-plugin/src/elements/quizx.js on lines 31..31

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

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

    this.answers_array = (this.answers)? this.answers.split('|').map(s => s.trim()): [];
Severity: Major
Found in src_aurelia-bodylight-plugin/src/elements/quizx.js and 7 other locations - About 55 mins to fix
src_aurelia-bodylight-plugin/src/elements/quiz.js on lines 25..25
src_aurelia-bodylight-plugin/src/elements/quiz.js on lines 26..26
src_aurelia-bodylight-plugin/src/elements/quiz.js on lines 27..27
src_aurelia-bodylight-plugin/src/elements/quiz.js on lines 28..28
src_aurelia-bodylight-plugin/src/elements/quizx.js on lines 29..29
src_aurelia-bodylight-plugin/src/elements/quizx.js on lines 30..30
src_aurelia-bodylight-plugin/src/elements/quizx.js on lines 31..31

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

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

    this.correct_array = (this.correctoptions)?this.correctoptions.split('|').map(s => s.trim()):[];
Severity: Major
Found in src_aurelia-bodylight-plugin/src/elements/quizx.js and 7 other locations - About 55 mins to fix
src_aurelia-bodylight-plugin/src/elements/quiz.js on lines 25..25
src_aurelia-bodylight-plugin/src/elements/quiz.js on lines 26..26
src_aurelia-bodylight-plugin/src/elements/quiz.js on lines 27..27
src_aurelia-bodylight-plugin/src/elements/quiz.js on lines 28..28
src_aurelia-bodylight-plugin/src/elements/quizx.js on lines 28..28
src_aurelia-bodylight-plugin/src/elements/quizx.js on lines 29..29
src_aurelia-bodylight-plugin/src/elements/quizx.js on lines 30..30

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

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 (this.chart.data.datasets.length>this.maxdata) { this.chart.data.datasets.pop();}
Severity: Minor
Found in src_aurelia-bodylight-plugin/src/elements/chartjs-fixed.js and 1 other location - About 55 mins to fix
src_aurelia-bodylight-plugin/src/elements/chartjs-fixed-xy.js on lines 117..119

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

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

    this.explanation_array = (this.explanations)? this.explanations.split('|').map(s => s.trim()): [];
Severity: Major
Found in src_aurelia-bodylight-plugin/src/elements/quiz.js and 7 other locations - About 55 mins to fix
src_aurelia-bodylight-plugin/src/elements/quiz.js on lines 25..25
src_aurelia-bodylight-plugin/src/elements/quiz.js on lines 26..26
src_aurelia-bodylight-plugin/src/elements/quiz.js on lines 28..28
src_aurelia-bodylight-plugin/src/elements/quizx.js on lines 28..28
src_aurelia-bodylight-plugin/src/elements/quizx.js on lines 29..29
src_aurelia-bodylight-plugin/src/elements/quizx.js on lines 30..30
src_aurelia-bodylight-plugin/src/elements/quizx.js on lines 31..31

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

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

    this.correct_array = (this.correctoptions)?this.correctoptions.split('|').map(s => s.trim()):[];
Severity: Major
Found in src_aurelia-bodylight-plugin/src/elements/quiz.js and 7 other locations - About 55 mins to fix
src_aurelia-bodylight-plugin/src/elements/quiz.js on lines 25..25
src_aurelia-bodylight-plugin/src/elements/quiz.js on lines 26..26
src_aurelia-bodylight-plugin/src/elements/quiz.js on lines 27..27
src_aurelia-bodylight-plugin/src/elements/quizx.js on lines 28..28
src_aurelia-bodylight-plugin/src/elements/quizx.js on lines 29..29
src_aurelia-bodylight-plugin/src/elements/quizx.js on lines 30..30
src_aurelia-bodylight-plugin/src/elements/quizx.js on lines 31..31

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

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.links) {
      this.linkarray = this.links.split('|');
      this.currentlink = this.linkarray[0];
    }
Severity: Minor
Found in src_aurelia-bodylight-plugin/src/elements/carousel.js and 1 other location - About 55 mins to fix
src_aurelia-bodylight-plugin/src/elements/carousel.js on lines 47..50

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

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 (this.chart.data.datasets.length > this.maxdata) {
                this.chart.data.datasets.pop();
            }
Severity: Minor
Found in src_aurelia-bodylight-plugin/src/elements/chartjs-fixed-xy.js and 1 other location - About 55 mins to fix
src_aurelia-bodylight-plugin/src/elements/chartjs-fixed.js on lines 90..90

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

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

    this.terms_array = (this.terms)? this.terms.split('|').map(s => s.trim()): [];
Severity: Major
Found in src_aurelia-bodylight-plugin/src/elements/quiz.js and 7 other locations - About 55 mins to fix
src_aurelia-bodylight-plugin/src/elements/quiz.js on lines 25..25
src_aurelia-bodylight-plugin/src/elements/quiz.js on lines 27..27
src_aurelia-bodylight-plugin/src/elements/quiz.js on lines 28..28
src_aurelia-bodylight-plugin/src/elements/quizx.js on lines 28..28
src_aurelia-bodylight-plugin/src/elements/quizx.js on lines 29..29
src_aurelia-bodylight-plugin/src/elements/quizx.js on lines 30..30
src_aurelia-bodylight-plugin/src/elements/quizx.js on lines 31..31

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

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.infos) {
      this.infoarray = this.infos.split('|');
      this.currentinfo = this.infoarray[0];
    }
Severity: Minor
Found in src_aurelia-bodylight-plugin/src/elements/carousel.js and 1 other location - About 55 mins to fix
src_aurelia-bodylight-plugin/src/elements/carousel.js on lines 27..30

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

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 DEFAULT has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

    DEFAULT : function(g, name, ctx, canvasx, canvasy, color, radius) {
Severity: Major
Found in src_aurelia-bodylight-plugin/src/utils/dygraph.js - About 50 mins to fix

    Function CIRCLE has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        CIRCLE : function(g, name, ctx, cx, cy, color, radius) {
    Severity: Major
    Found in src_aurelia-bodylight-plugin/src/utils/dygraph.js - About 50 mins to fix

      Function EX has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          EX : function(g, name, ctx, cx, cy, color, radius) {
      Severity: Major
      Found in src_aurelia-bodylight-plugin/src/utils/dygraph.js - About 50 mins to fix

        Function regularShape_ has 7 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            ctx, sides, radius, cx, cy, rotationRadians, delta) {
        Severity: Major
        Found in src_aurelia-bodylight-plugin/src/utils/dygraph.js - About 50 mins to fix

          Function PLUS has 7 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              PLUS : function(g, name, ctx, cx, cy, color, radius) {
          Severity: Major
          Found in src_aurelia-bodylight-plugin/src/utils/dygraph.js - About 50 mins to fix
            Severity
            Category
            Status
            Source
            Language