kamiazya/ngx-speech-recognition

View on GitHub

Showing 40 of 40 total issues

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

  static forRoot(config: SpeechRecognitionConfig): ModuleWithProviders {
    return {
      ngModule: SpeechRecognitionModule,
      providers: [
        // tslint:disable:max-line-length
Severity: Minor
Found in projects/ngx-speech-recognition/src/lib/speech-recognition.module.ts - 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 withConfig has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
Open

  static withConfig(config: SpeechRecognitionConfig): ModuleWithProviders {
    return {
      ngModule: SpeechRecognitionModule,
      providers: [
        // tslint:disable:max-line-length
Severity: Minor
Found in projects/ngx-speech-recognition/src/lib/speech-recognition.module.ts - 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 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;

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

      set grammars(grammars: SpeechGrammarListType) {
        this._grammars = grammars;
        if (this._grammars !== undefined && this._grammars != null && this.internal) {
          this.internal.grammars = this._grammars;
        }
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.common.ts on lines 57..62
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.common.ts on lines 73..78
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.common.ts on lines 91..96
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.common.ts on lines 108..113
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.common.ts on lines 128..133

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

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

      set serviceURI(serviceURI: string) {
        this._serviceURI = serviceURI;
        if (this._serviceURI !== undefined && this._serviceURI != null && this.internal) {
          this.internal.serviceURI = this._serviceURI;
        }
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.common.ts on lines 36..41
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.common.ts on lines 57..62
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.common.ts on lines 73..78
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.common.ts on lines 91..96
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.common.ts on lines 108..113

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

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

      set maxAlternatives(maxAlternatives: number) {
        this._maxAlternatives = maxAlternatives;
        if (this._maxAlternatives !== undefined && this._maxAlternatives != null && this.internal) {
          this.internal.maxAlternatives = this._maxAlternatives;
        }
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.common.ts on lines 36..41
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.common.ts on lines 57..62
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.common.ts on lines 73..78
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.common.ts on lines 91..96
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.common.ts on lines 128..133

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

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

      set lang(lang: string) {
        this._lang = lang;
        if (this._lang !== undefined && this._lang != null && this.internal) {
          this.internal.lang = this._lang;
        }
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.common.ts on lines 36..41
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.common.ts on lines 73..78
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.common.ts on lines 91..96
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.common.ts on lines 108..113
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.common.ts on lines 128..133

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

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

      set interimResults(interimResults: boolean) {
        this._interimResults = interimResults;
        if (this._interimResults !== undefined && this._interimResults != null && this.internal) {
          this.internal.interimResults = this._interimResults;
        }
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.common.ts on lines 36..41
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.common.ts on lines 57..62
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.common.ts on lines 73..78
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.common.ts on lines 108..113
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.common.ts on lines 128..133

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

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

      set continuous(continuous: boolean) {
        this._continuous = continuous;
        if (this._continuous !== undefined && this._continuous != null && this.internal) {
          this.internal.continuous = this._continuous;
        }
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.common.ts on lines 36..41
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.common.ts on lines 57..62
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.common.ts on lines 91..96
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.common.ts on lines 108..113
    projects/ngx-speech-recognition/src/lib/service/speech-recognition.common.ts on lines 128..133

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

    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.service.onresult = (e) => {
          this.message = e.results[0].item(0).transcript;
          console.log('SubComponent:onresult', this.message, e);
        };
    Severity: Major
    Found in src/demo/sub/components/sub/sub.component.ts and 1 other location - About 1 hr to fix
    src/demo/components/main/main.component.ts on lines 31..34

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

    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.service.onresult = (e) => {
          this.message = e.results[0].item(0).transcript;
          console.log('MainComponent:onresult', this.message, e);
        };
    Severity: Major
    Found in src/demo/components/main/main.component.ts and 1 other location - About 1 hr to fix
    src/demo/sub/components/sub/sub.component.ts on lines 55..58

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

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

      private initInternal() {
        // set handlers
        const handler = (e) => {
          this.proxy$.next(e);
          this.ref.tick();

      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

      Severity
      Category
      Status
      Source
      Language