kamiazya/ngx-speech-recognition

View on GitHub
projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts

Summary

Maintainability
D
2 days
Test Coverage

Function initInternal has 50 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  private initInternal() {
    // see setter methods
    this.grammars = this._grammars;
    this.lang = this._lang;
    this.continuous = this._continuous;

    Function initHandlers has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

      private initHandlers() {
        const _ = () => { };
        if (!this.audiostartHandler) { this.audiostartHandler = _; }
        if (!this.soundstartHandler) { this.soundstartHandler = _; }
        if (!this.speechstartHandler) { this.speechstartHandler = _; }

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

      set onsoundend(handler: (ev: Event) => any) {
        this.soundendHandler = handler;
      }
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 199..201
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 211..213
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 223..225

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

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

      set onspeechstart(handler: (ev: Event) => any) {
        this.speechstartHandler = handler;
      }
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 199..201
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 223..225
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 235..237

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

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

      set onspeechend(handler: (ev: Event) => any) {
        this.speechendHandler = handler;
      }
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 199..201
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 211..213
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 235..237

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

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

      set onsoundstart(handler: (ev: Event) => any) {
        this.soundstartHandler = handler;
      }
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 211..213
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 223..225
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 235..237

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

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

        this.internal.onaudioend = (e: Event) => {
          this.audioendHandler(e);
          this.ref.tick();
        };
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 69..72
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 73..76
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 77..80
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 81..84
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 85..88
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 93..96
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 97..100
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 101..104
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 105..108
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 109..112

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

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

        this.internal.onend = (e: Event) => {
          this.endHandler(e);
          this.ref.tick();
        };
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 69..72
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 73..76
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 77..80
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 81..84
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 85..88
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 89..92
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 93..96
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 97..100
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 101..104
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 105..108

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

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

        this.internal.onsoundstart = (e: Event) => {
          this.soundstartHandler(e);
          this.ref.tick();
        };
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 69..72
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 77..80
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 81..84
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 85..88
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 89..92
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 93..96
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 97..100
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 101..104
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 105..108
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 109..112

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

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

        this.internal.onspeechend = (e: Event) => {
          this.speechendHandler(e);
          this.ref.tick();
        };
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 69..72
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 73..76
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 77..80
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 85..88
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 89..92
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 93..96
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 97..100
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 101..104
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 105..108
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 109..112

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

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

        this.internal.onstart = (e: Event) => {
          this.startHandler(e);
          this.ref.tick();
        };
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 69..72
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 73..76
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 77..80
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 81..84
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 85..88
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 89..92
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 93..96
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 97..100
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 101..104
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 109..112

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

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

        this.internal.onspeechstart = (e: Event) => {
          this.speechstartHandler(e);
          this.ref.tick();
        };
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 69..72
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 73..76
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 81..84
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 85..88
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 89..92
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 93..96
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 97..100
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 101..104
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 105..108
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 109..112

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

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

        this.internal.onaudiostart = (e: Event) => {
          this.audiostartHandler(e);
          this.ref.tick();
        };
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 73..76
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 77..80
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 81..84
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 85..88
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 89..92
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 93..96
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 97..100
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 101..104
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 105..108
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 109..112

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

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

        this.internal.onresult = (e: SpeechRecognitionEvent) => {
          this.resultHandler(e);
          this.ref.tick();
        };
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 69..72
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 73..76
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 77..80
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 81..84
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 85..88
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 89..92
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 97..100
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 101..104
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 105..108
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 109..112

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

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

        this.internal.onsoundend = (e: Event) => {
          this.soundendHandler(e);
          this.ref.tick();
        };
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 69..72
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 73..76
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 77..80
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 81..84
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 89..92
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 93..96
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 97..100
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 101..104
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 105..108
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 109..112

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

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

        this.internal.onnomatch = (e: SpeechRecognitionEvent) => {
          this.nomatchHandler(e);
          this.ref.tick();
        };
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 69..72
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 73..76
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 77..80
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 81..84
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 85..88
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 89..92
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 93..96
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 101..104
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 105..108
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 109..112

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

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

        this.internal.onerror = (e: SpeechRecognitionError) => {
          this.errorHandler(e);
          this.ref.tick();
        };
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 69..72
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 73..76
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 77..80
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 81..84
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 85..88
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 89..92
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 93..96
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 97..100
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 105..108
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.service.ts on lines 109..112

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

    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