department-of-veterans-affairs/vets-website

View on GitHub
src/applications/auth/components/RenderErrorContainer.jsx

Summary

Maintainability
F
3 days
Test Coverage

File RenderErrorContainer.jsx has 560 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import React from 'react';
import PropTypes from 'prop-types';
import { AUTH_ERRORS, AUTH_LEVEL } from 'platform/user/authentication/errors';
import ContactCenterInformation from 'platform/user/authentication/components/ContactCenterInformation';

Severity: Major
Found in src/applications/auth/components/RenderErrorContainer.jsx - About 1 day to fix

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

                <li>
                  <p>
                    If you’re using Internet Explorer or Microsoft Edge, and
                    clearing your cookies and cache doesn’t fix the problem, try
                    using Google Chrome or Mozilla Firefox as your browser instead.
    Severity: Major
    Found in src/applications/auth/components/RenderErrorContainer.jsx and 1 other location - About 3 hrs to fix
    src/applications/gi/components/content/modals/VeteranSuccessModalContent.jsx on lines 5..31

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 97.

    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

        case AUTH_ERRORS.SESSION_EXPIRED.errorCode:
          alertContent = (
            <p className="vads-u-margin-top--0">
              We take your privacy very seriously. You didn’t take any action on
              VA.gov for 30 minutes, so we signed you out of the site to protect
    Severity: Major
    Found in src/applications/auth/components/RenderErrorContainer.jsx and 1 other location - About 2 hrs to fix
    src/applications/auth/components/RenderErrorContainer.jsx on lines 447..461

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

    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

        case AUTH_ERRORS.OAUTH_STATE_MISMATCH.errorCode:
          alertContent = (
            <p className="vads-u-margin-top--0">
              We’re having trouble signing you in to VA.gov right now because of a
              network error.
    Severity: Major
    Found in src/applications/auth/components/RenderErrorContainer.jsx and 1 other location - About 2 hrs to fix
    src/applications/auth/components/RenderErrorContainer.jsx on lines 91..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 84.

    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

              <p>
                For problems with your Login.gov account, please review{' '}
                <a
                  href="https://www.login.gov/help/"
                  target="_blank"
    Severity: Major
    Found in src/applications/auth/components/RenderErrorContainer.jsx and 1 other location - About 2 hrs to fix
    src/applications/terms-of-use/touData.jsx on lines 34..55

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

    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

        case AUTH_ERRORS.ICN_MISMATCH.errorCode:
          alertContent = (
            <p className="vads-u-margin-top--0">
              We’re having trouble signing you in right now because your My
              HealtheVet account number doesn’t match the account number on your
    Severity: Major
    Found in src/applications/auth/components/RenderErrorContainer.jsx and 2 other locations - About 2 hrs to fix
    src/applications/auth/components/RenderErrorContainer.jsx on lines 202..215
    src/applications/auth/components/RenderErrorContainer.jsx on lines 235..248

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

        case AUTH_ERRORS.MULTIPLE_EDIPIS.errorCode:
          alertContent = (
            <p className="vads-u-margin-top--0">
              We’re having trouble signing you in to VA.gov right now because we
              found more than one DoD ID number for you.
    Severity: Major
    Found in src/applications/auth/components/RenderErrorContainer.jsx and 2 other locations - About 2 hrs to fix
    src/applications/auth/components/RenderErrorContainer.jsx on lines 218..232
    src/applications/auth/components/RenderErrorContainer.jsx on lines 235..248

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

        case AUTH_ERRORS.UUID_MISSING.errorCode:
          alertContent = (
            <p className="vads-u-margin-top--0">
              We’re having trouble signing you in right now because one of your
              account numbers is missing for your VA.gov account.
    Severity: Major
    Found in src/applications/auth/components/RenderErrorContainer.jsx and 2 other locations - About 2 hrs to fix
    src/applications/auth/components/RenderErrorContainer.jsx on lines 202..215
    src/applications/auth/components/RenderErrorContainer.jsx on lines 218..232

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

                  <p>
                    Fill out a{' '}
                    <a
                      href="https://www.myhealth.va.gov/mhv-portal-web/contact-us"
                      target="_blank"
    Severity: Major
    Found in src/applications/auth/components/RenderErrorContainer.jsx and 6 other locations - About 35 mins to fix
    src/applications/disability-benefits/all-claims/content/claimExamsInfo.jsx on lines 20..26
    src/applications/gi/components/content/modals/AccreditationModalContent.jsx on lines 25..36
    src/applications/gi/components/content/modals/EightKeysModalContent.jsx on lines 19..30
    src/applications/gi/containers/Modals.jsx on lines 544..554
    src/platform/forms-system/src/js/definitions/content/directDeposit.jsx on lines 50..62
    src/platform/user/profile/vap-svc/components/base/VAPServiceTransactionErrorBanner.jsx on lines 45..55

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

    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