creative-connections/Bodylight.js-Components

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

Summary

Maintainability
F
1 wk
Test Coverage

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

  bind() {
    this.useranswer = [];
    this.showquiz=true;
    this.showresult = false;
    this.answers_array = (this.answers)? this.answers.split('|').map(s => s.trim()): [];
Severity: Major
Found in src_aurelia-bodylight-plugin/src/elements/quizx.js - About 2 hrs to fix

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

      bind() {
        this.useranswer = [];
        this.showquiz=true;
        this.showresult = false;
        this.answers_array = (this.answers)? this.answers.split('|').map(s => s.trim()): [];
    Severity: Minor
    Found in src_aurelia-bodylight-plugin/src/elements/quizx.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 bindhint has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
    Open

      bindhint(qa){
        const answers = qa[this.id].a;
        for (const key of Object.keys(answers)) {
          const value = answers[key];      
          if (this.randomanswers) {
    Severity: Minor
    Found in src_aurelia-bodylight-plugin/src/elements/quizx.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

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

        if (this.type === 'match') {
          //prepare randomterms and randomanswers
          let indices1 = [...Array(this.terms_array.length).keys()];
          let indices2 = [...Array(this.answers_array.length).keys()];
          let shuffled1indices = _.shuffle(indices1);
    Severity: Major
    Found in src_aurelia-bodylight-plugin/src/elements/quizx.js and 1 other location - About 2 days to fix
    src_aurelia-bodylight-plugin/src/elements/quiz.js on lines 42..62

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

    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

      checkTermAnswerMatch(){
        if (this.selectedAnswer.index == this.selectedTerm.index) {
          this.selectedTerm.class = this.correct+' '+this.correctcolors[this.selectedAnswer.index]; 
          this.selectedAnswer.class=  this.correct+' '+this.correctcolors[this.selectedAnswer.index];
          this.selectedTerm.disabled = true;
    Severity: Major
    Found in src_aurelia-bodylight-plugin/src/elements/quizx.js and 1 other location - About 1 day to fix
    src_aurelia-bodylight-plugin/src/elements/quiz.js on lines 153..167

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

    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

      submit() {
        //console.log('Bdlquis submit()');
        this.showresult = true;
        if (this.type === 'choice2') {
          if (this.selectedAnswer.correct) this.selectedAnswer.class = this.selectedcorrect;
    Severity: Major
    Found in src_aurelia-bodylight-plugin/src/elements/quizx.js and 1 other location - About 3 hrs to fix
    src_aurelia-bodylight-plugin/src/elements/quiz.js on lines 135..143

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

    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

      selectAnswer(answer){ //in choice - answer was selected
        if (answer.disabled) return;
        if (this.selectedAnswer) {this.selectedAnswer.class= this.unselected;}
        this.selectedAnswer = answer;
        if (this.selectedTerm) {
    Severity: Major
    Found in src_aurelia-bodylight-plugin/src/elements/quizx.js and 1 other location - About 3 hrs to fix
    src_aurelia-bodylight-plugin/src/elements/quiz.js on lines 180..190

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

    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

      selectTerm(term){
        if (term.disabled) return;
        if (this.selectedTerm) {this.selectedTerm.class = this.unselected;}
        this.selectedTerm = term;
        if (this.selectedAnswer) {
    Severity: Major
    Found in src_aurelia-bodylight-plugin/src/elements/quizx.js and 1 other location - About 3 hrs to fix
    src_aurelia-bodylight-plugin/src/elements/quiz.js on lines 169..178

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

    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.answers_array.length; i++) {
          this.answer_exp_array.push(
            {
              id: i,
              answer: this.answers_array[i],
    Severity: Major
    Found in src_aurelia-bodylight-plugin/src/elements/quizx.js and 1 other location - About 3 hrs to fix
    src_aurelia-bodylight-plugin/src/elements/quiz.js on lines 31..40

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

    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

        this.subscription1 = this.ea.subscribe('quizshow', quizid => {
          if (this.check(quizid,this.id)) this.show();//quizid);
        });
    Severity: Major
    Found in src_aurelia-bodylight-plugin/src/elements/quizx.js and 1 other location - About 1 hr to fix
    src_aurelia-bodylight-plugin/src/elements/quizx.js on lines 102..104

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

    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

        this.subscription2 = this.ea.subscribe('quizhide', quizid => {
          if (this.check(quizid,this.id)) this.hide();//quizid);
        }); 
    Severity: Major
    Found in src_aurelia-bodylight-plugin/src/elements/quizx.js and 1 other location - About 1 hr to fix
    src_aurelia-bodylight-plugin/src/elements/quizx.js on lines 99..101

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

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

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

        } else {
          let setqa = {id:this.id,answer:answer.answer,removeAnswer:true}
          this.ea.publish('quizsetanswer', setqa)
        }
    Severity: Minor
    Found in src_aurelia-bodylight-plugin/src/elements/quizx.js and 1 other location - About 45 mins to fix
    src_aurelia-bodylight-plugin/src/elements/quizx.js on lines 251..254

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

    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 (answer.user) {
          let setqa = {id:this.id,answer:answer.answer,addAnswer:true}
          this.ea.publish('quizsetanswer', setqa)
        } else {
    Severity: Minor
    Found in src_aurelia-bodylight-plugin/src/elements/quizx.js and 1 other location - About 45 mins to fix
    src_aurelia-bodylight-plugin/src/elements/quizx.js on lines 254..257

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

    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