department-of-veterans-affairs/vets-website

View on GitHub
src/applications/static-pages/cta-widget/ctaWidgets.js

Summary

Maintainability
F
4 days
Test Coverage

File ctaWidgets.js has 374 lines of code (exceeds 250 allowed). Consider refactoring.
Open

// Relative imports.
import backendServices from '~/platform/user/profile/constants/backendServices';
import featureFlagNames from '~/platform/utilities/feature-toggles/featureFlagNames';
import { mhvUrl } from '~/platform/site-wide/mhv/utilities';
import { getAppUrl } from '~/platform/utilities/registry-helpers';
Severity: Minor
Found in src/applications/static-pages/cta-widget/ctaWidgets.js - About 5 hrs to fix

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

      [CTA_WIDGET_TYPES.VIEW_APPOINTMENTS]: {
        id: CTA_WIDGET_TYPES.VIEW_APPOINTMENTS,
        deriveToolUrlDetails: authenticatedWithSSOe => ({
          url: mhvUrl(authenticatedWithSSOe, 'appointments'),
          redirect: false,
    Severity: Major
    Found in src/applications/static-pages/cta-widget/ctaWidgets.js and 1 other location - About 2 hrs to fix
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 270..281

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

    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

      [CTA_WIDGET_TYPES.SCHEDULE_APPOINTMENTS]: {
        id: CTA_WIDGET_TYPES.SCHEDULE_APPOINTMENTS,
        deriveToolUrlDetails: authenticatedWithSSOe => ({
          url: mhvUrl(authenticatedWithSSOe, 'appointments'),
          redirect: false,
    Severity: Major
    Found in src/applications/static-pages/cta-widget/ctaWidgets.js and 1 other location - About 2 hrs to fix
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 319..330

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

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

      [CTA_WIDGET_TYPES.GI_BILL_BENEFITS]: {
        id: CTA_WIDGET_TYPES.GI_BILL_BENEFITS,
        deriveToolUrlDetails: () => ({
          url: '/education/gi-bill/post-9-11/ch-33-benefit/status',
          redirect: false,
    Severity: Major
    Found in src/applications/static-pages/cta-widget/ctaWidgets.js and 4 other locations - About 1 hr to fix
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 108..119
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 218..229
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 294..305
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 306..318

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

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

      [CTA_WIDGET_TYPES.VETERAN_ID_CARD]: {
        id: CTA_WIDGET_TYPES.VETERAN_ID_CARD,
        deriveToolUrlDetails: () => ({
          url: '/records/get-veteran-id-cards/apply',
          redirect: false,
    Severity: Major
    Found in src/applications/static-pages/cta-widget/ctaWidgets.js and 4 other locations - About 1 hr to fix
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 108..119
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 132..143
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 218..229
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 306..318

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

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

      [CTA_WIDGET_TYPES.VET_TEC]: {
        id: CTA_WIDGET_TYPES.VET_TEC,
        deriveToolUrlDetails: () => ({
          url:
            '/education/about-gi-bill-benefits/how-to-use-benefits/vettec-high-tech-program/apply-for-vettec-form-22-0994',
    Severity: Major
    Found in src/applications/static-pages/cta-widget/ctaWidgets.js and 4 other locations - About 1 hr to fix
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 108..119
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 132..143
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 218..229
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 294..305

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

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

      [CTA_WIDGET_TYPES.LETTERS]: {
        id: CTA_WIDGET_TYPES.LETTERS,
        deriveToolUrlDetails: () => ({
          url: '/records/download-va-letters/letters',
          redirect: false,
    Severity: Major
    Found in src/applications/static-pages/cta-widget/ctaWidgets.js and 4 other locations - About 1 hr to fix
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 108..119
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 132..143
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 294..305
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 306..318

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

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

      [CTA_WIDGET_TYPES.DISABILITY_BENEFITS]: {
        id: CTA_WIDGET_TYPES.DISABILITY_BENEFITS,
        deriveToolUrlDetails: () => ({
          url: '/disability/how-to-file-claim',
          redirect: false,
    Severity: Major
    Found in src/applications/static-pages/cta-widget/ctaWidgets.js and 4 other locations - About 1 hr to fix
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 132..143
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 218..229
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 294..305
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 306..318

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

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

      [CTA_WIDGET_TYPES.HEARING_AID_SUPPLIES]: {
        id: CTA_WIDGET_TYPES.HEARING_AID_SUPPLIES,
        deriveToolUrlDetails: () => ({
          url: disabilityBenefitsUrls['2346'],
          redirect: false,
    Severity: Major
    Found in src/applications/static-pages/cta-widget/ctaWidgets.js and 2 other locations - About 1 hr to fix
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 48..59
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 343..354

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

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

      [CTA_WIDGET_TYPES.VIEW_PAYMENT_HISTORY]: {
        id: CTA_WIDGET_TYPES.VIEW_PAYMENT_HISTORY,
        deriveToolUrlDetails: () => ({
          url: disabilityBenefitsUrls['view-payments'],
          redirect: false,
    Severity: Major
    Found in src/applications/static-pages/cta-widget/ctaWidgets.js and 2 other locations - About 1 hr to fix
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 48..59
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 170..181

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

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

      [CTA_WIDGET_TYPES.ADD_REMOVE_DEPENDENTS]: {
        id: CTA_WIDGET_TYPES.ADD_REMOVE_DEPENDENTS,
        deriveToolUrlDetails: () => ({
          url: disabilityBenefitsUrls['686c'],
          redirect: false,
    Severity: Major
    Found in src/applications/static-pages/cta-widget/ctaWidgets.js and 2 other locations - About 1 hr to fix
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 170..181
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 343..354

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

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

      [CTA_WIDGET_TYPES.UPDATE_HEALTH_BENEFITS_INFO]: {
        id: CTA_WIDGET_TYPES.UPDATE_HEALTH_BENEFITS_INFO,
        deriveToolUrlDetails: () => ({
          url: '/my-health/update-benefits-information-form-10-10ezr',
          redirect: true,
    Severity: Major
    Found in src/applications/static-pages/cta-widget/ctaWidgets.js and 8 other locations - About 1 hr to fix
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 60..71
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 84..95
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 96..107
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 120..131
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 193..204
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 230..241
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 355..366
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 367..378

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

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

      [CTA_WIDGET_TYPES.DISABILITY_RATINGS]: {
        id: CTA_WIDGET_TYPES.DISABILITY_RATINGS,
        deriveToolUrlDetails: () => ({
          url: '/disability/view-disability-rating/rating',
          redirect: false,
    Severity: Major
    Found in src/applications/static-pages/cta-widget/ctaWidgets.js and 8 other locations - About 1 hr to fix
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 60..71
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 84..95
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 96..107
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 193..204
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 230..241
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 282..293
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 355..366
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 367..378

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

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

      [CTA_WIDGET_TYPES.CHANGE_ADDRESS]: {
        id: CTA_WIDGET_TYPES.CHANGE_ADDRESS,
        deriveToolUrlDetails: () => ({
          url: '/profile/contact-information',
          redirect: false,
    Severity: Major
    Found in src/applications/static-pages/cta-widget/ctaWidgets.js and 8 other locations - About 1 hr to fix
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 84..95
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 96..107
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 120..131
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 193..204
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 230..241
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 282..293
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 355..366
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 367..378

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

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

      [CTA_WIDGET_TYPES.COMBINED_DEBT_PORTAL]: {
        id: CTA_WIDGET_TYPES.COMBINED_DEBT_PORTAL,
        deriveToolUrlDetails: () => ({
          url: '/manage-va-debt/summary',
          redirect: true,
    Severity: Major
    Found in src/applications/static-pages/cta-widget/ctaWidgets.js and 8 other locations - About 1 hr to fix
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 60..71
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 96..107
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 120..131
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 193..204
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 230..241
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 282..293
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 355..366
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 367..378

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

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

      [CTA_WIDGET_TYPES.ENROLLMENT_VERIFICATION]: {
        id: CTA_WIDGET_TYPES.ENROLLMENT_VERIFICATION,
        deriveToolUrlDetails: () => ({
          url: 'education/verify-school-enrollment',
          redirect: false,
    Severity: Major
    Found in src/applications/static-pages/cta-widget/ctaWidgets.js and 8 other locations - About 1 hr to fix
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 60..71
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 84..95
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 96..107
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 120..131
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 193..204
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 230..241
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 282..293
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 355..366

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

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

      [CTA_WIDGET_TYPES.MANAGE_VA_DEBT]: {
        id: CTA_WIDGET_TYPES.MANAGE_VA_DEBT,
        deriveToolUrlDetails: () => ({
          url: '/manage-va-debt/summary/debt-balances',
          redirect: false,
    Severity: Major
    Found in src/applications/static-pages/cta-widget/ctaWidgets.js and 8 other locations - About 1 hr to fix
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 60..71
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 84..95
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 96..107
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 120..131
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 193..204
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 282..293
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 355..366
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 367..378

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

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

      [CTA_WIDGET_TYPES.DIRECT_DEPOSIT]: {
        id: CTA_WIDGET_TYPES.DIRECT_DEPOSIT,
        deriveToolUrlDetails: () => ({
          url: '/profile/direct-deposit',
          redirect: true,
    Severity: Major
    Found in src/applications/static-pages/cta-widget/ctaWidgets.js and 8 other locations - About 1 hr to fix
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 60..71
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 84..95
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 120..131
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 193..204
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 230..241
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 282..293
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 355..366
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 367..378

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

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

      [CTA_WIDGET_TYPES.HOME_LOAN_COE_STATUS]: {
        id: CTA_WIDGET_TYPES.HOME_LOAN_COE_STATUS,
        deriveToolUrlDetails: () => ({
          url: '/housing-assistance/home-loans/check-coe-status/your-coe/',
          redirect: true,
    Severity: Major
    Found in src/applications/static-pages/cta-widget/ctaWidgets.js and 8 other locations - About 1 hr to fix
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 60..71
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 84..95
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 96..107
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 120..131
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 230..241
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 282..293
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 355..366
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 367..378

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

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

      [CTA_WIDGET_TYPES.EDUCATION_LETTERS]: {
        id: CTA_WIDGET_TYPES.EDUCATION_LETTERS,
        deriveToolUrlDetails: () => ({
          url: 'education/download-letters',
          redirect: false,
    Severity: Major
    Found in src/applications/static-pages/cta-widget/ctaWidgets.js and 8 other locations - About 1 hr to fix
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 60..71
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 84..95
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 96..107
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 120..131
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 193..204
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 230..241
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 282..293
    src/applications/static-pages/cta-widget/ctaWidgets.js on lines 367..378

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

    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