bullhorn/career-portal

View on GitHub
src/app/apply-modal/apply-modal.component.ts

Summary

Maintainability
D
2 days
Test Coverage

Function setupForm has 120 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  public setupForm(): void {
    this.firstName = new TextBoxControl({
      key: 'firstName',
      label: this.translate.instant('FIRST_NAME'),
      required: true,
Severity: Major
Found in src/app/apply-modal/apply-modal.component.ts - About 4 hrs to fix

    File apply-modal.component.ts has 254 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import { Component, OnInit } from '@angular/core';
    import {
      NovoFormGroup,
      FormUtils,
      NovoModalRef,
    Severity: Minor
    Found in src/app/apply-modal/apply-modal.component.ts - About 2 hrs to fix

      Function save has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

        public save(): void {
          if (this.form.valid) {
            this.applying = true;
            this.analytics.trackEvent(`Apply to Job: ${this.job.id}`);
            let requestParams: any = {
      Severity: Minor
      Found in src/app/apply-modal/apply-modal.component.ts - 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

      Function save has 29 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        public save(): void {
          if (this.form.valid) {
            this.applying = true;
            this.analytics.trackEvent(`Apply to Job: ${this.job.id}`);
            let requestParams: any = {
      Severity: Minor
      Found in src/app/apply-modal/apply-modal.component.ts - About 1 hr to fix

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

          public viewPrivacyPolicy(): void {
            const url: string = SettingsService.settings.privacyConsent.privacyPolicyUrl;
            if (url === '/privacy') {
              this.router.navigate([url]);
            } else {
        Severity: Major
        Found in src/app/apply-modal/apply-modal.component.ts and 1 other location - About 2 hrs to fix
        src/app/sidebar/sidebar.component.ts on lines 89..97

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

        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

                options: [
                  { value: 'M', label: this.translate.instant('EEOC.GENDER_MALE') },
                  { value: 'F', label: this.translate.instant('EEOC.GENDER_FEMALE')},
                  { value: 'D', label: this.translate.instant('EEOC.GENDER_ND')},
                ],
        Severity: Major
        Found in src/app/apply-modal/apply-modal.component.ts and 1 other location - About 2 hrs to fix
        src/app/apply-modal/apply-modal.component.ts on lines 149..153

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

        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

                options: [
                  { value: 'Y', label: this.translate.instant('EEOC.DISABILITY_Y') },
                  { value: 'N', label: this.translate.instant('EEOC.DISABILITY_N')},
                  { value: 'D', label: this.translate.instant('EEOC.DISABILITY_D')},
                ],
        Severity: Major
        Found in src/app/apply-modal/apply-modal.component.ts and 1 other location - About 2 hrs to fix
        src/app/apply-modal/apply-modal.component.ts on lines 102..106

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

        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.phoneNumber = new TextBoxControl({
              key: 'phone',
              label: this.translate.instant('PHONE'),
              type: 'tel',
              required: false,
        Severity: Major
        Found in src/app/apply-modal/apply-modal.component.ts and 1 other location - About 1 hr to fix
        src/app/apply-modal/apply-modal.component.ts on lines 80..87

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

        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.email = new TextBoxControl({
              key: 'email',
              label: this.translate.instant('EMAIL'),
              type: 'email',
              required: true,
        Severity: Major
        Found in src/app/apply-modal/apply-modal.component.ts and 1 other location - About 1 hr to fix
        src/app/apply-modal/apply-modal.component.ts on lines 88..95

        Duplicated Code

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

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

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

        Tuning

        This issue has a mass of 58.

        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.firstName = new TextBoxControl({
              key: 'firstName',
              label: this.translate.instant('FIRST_NAME'),
              required: true,
              hidden: false,
        Severity: Minor
        Found in src/app/apply-modal/apply-modal.component.ts and 1 other location - About 55 mins to fix
        src/app/apply-modal/apply-modal.component.ts on lines 73..79

        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

            this.lastName = new TextBoxControl({
              key: 'lastName',
              label: this.translate.instant('LAST_NAME'),
              required: true,
              hidden: false,
        Severity: Minor
        Found in src/app/apply-modal/apply-modal.component.ts and 1 other location - About 55 mins to fix
        src/app/apply-modal/apply-modal.component.ts on lines 66..72

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

              if (this.form.value.disability) {
                requestParams.disability = encodeURIComponent(this.form.value.disability);
              }
        Severity: Major
        Found in src/app/apply-modal/apply-modal.component.ts and 3 other locations - About 35 mins to fix
        src/app/apply-modal/apply-modal.component.ts on lines 213..215
        src/app/apply-modal/apply-modal.component.ts on lines 216..218
        src/app/apply-modal/apply-modal.component.ts on lines 219..221

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

        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

              if (this.form.value.gender) {
                requestParams.gender = encodeURIComponent(this.form.value.gender);
              }
        Severity: Major
        Found in src/app/apply-modal/apply-modal.component.ts and 3 other locations - About 35 mins to fix
        src/app/apply-modal/apply-modal.component.ts on lines 216..218
        src/app/apply-modal/apply-modal.component.ts on lines 219..221
        src/app/apply-modal/apply-modal.component.ts on lines 222..224

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

        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

              if (this.form.value.ethnicity) {
                requestParams.ethnicity = encodeURIComponent(this.form.value.ethnicity);
              }
        Severity: Major
        Found in src/app/apply-modal/apply-modal.component.ts and 3 other locations - About 35 mins to fix
        src/app/apply-modal/apply-modal.component.ts on lines 213..215
        src/app/apply-modal/apply-modal.component.ts on lines 219..221
        src/app/apply-modal/apply-modal.component.ts on lines 222..224

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

        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

              if (this.form.value.veteran) {
                requestParams.veteran = encodeURIComponent(this.form.value.veteran);
              }
        Severity: Major
        Found in src/app/apply-modal/apply-modal.component.ts and 3 other locations - About 35 mins to fix
        src/app/apply-modal/apply-modal.component.ts on lines 213..215
        src/app/apply-modal/apply-modal.component.ts on lines 216..218
        src/app/apply-modal/apply-modal.component.ts on lines 222..224

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

        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