department-of-veterans-affairs/vets-website

View on GitHub

Showing 12,848 of 12,848 total issues

Function foldersReducer has 35 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const foldersReducer = (state = initialState, action) => {
  switch (action.type) {
    case Actions.Folder.GET_LIST:
      return {
        ...state,
Severity: Minor
Found in src/applications/mhv-secure-messaging/reducers/folders.js - About 1 hr to fix

    Function ActionButtons has 35 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function ActionButtons(props) {
      const { eligibleForRequests, facilityId } = props;
      const history = useHistory();
      const dispatch = useDispatch();
      const { requestDateTime } = useSelector(getNewAppointmentFlow);

      Function makeHeaderLabel has 35 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        const makeHeaderLabel = () => {
          const removed = [];
          const added = [];
      
          loaded.forEach(loadedCode => {
      Severity: Minor
      Found in src/applications/gi/containers/CompareDrawer.jsx - About 1 hr to fix

        Function programLabel has 35 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          const programLabel = programKey => {
            const program = programs[programKey];
            const showLink = program.link && program.link.href;
        
            const link =

          Function AccreditationModalContent has 35 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export default function AccreditationModalContent() {
            return (
              <>
                <p>
                  The goal of accreditation is to ensure the education provided by

            Function aboutTheSchool has 35 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export function aboutTheSchool(
              onChangeCheckbox,
              options,
              smallScreen,
              automatedTest = false,
            Severity: Minor
            Found in src/applications/gi/containers/search/FilterBeforeResults.jsx - About 1 hr to fix

              Function MockAuthButton has 35 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export default function MockAuthButton() {
                const [authType, setAuthType] = useState(CSP_IDS.LOGIN_GOV);
                const [mockLoginError, setMockLoginError] = useState('');
                return [environments.LOCALHOST, environments.VAGOVDEV].includes(
                  environment.getRawBuildtype(),
              Severity: Minor
              Found in src/applications/login/components/MockAuthButton.jsx - About 1 hr to fix

                Function BenefitsProfileWrapper has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                const BenefitsProfileWrapper = () => {
                  const { loading, latestAddress } = useData();
                  const applicantName = latestAddress?.veteranName;
                  const { profile } = useSelector(state => state.user || {});
                  const {

                  Function SignInEmailAlert has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export const SignInEmailAlert = () => {
                    const { label } = useSignInServiceProvider();
                  
                    const [dismissed, setDismissed] = useSessionStorage(
                      'dismissedCredentialAlerts',

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

                      if (!pathname.endsWith('/start') && !hasSupportedBenefitType) {
                        router.push('/start');
                        content = wrapInH1(
                          <va-loading-indicator
                            set-focus
                    src/applications/appeals/995/containers/App.jsx on lines 154..162
                    src/applications/appeals/996/containers/Form0996App.jsx on lines 168..176

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

                    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

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

                      if (!pathname.endsWith('/start') && !hasSupportedBenefitType) {
                        router.push('/start');
                        content = wrapInH1(
                          <va-loading-indicator
                            set-focus
                    Severity: Major
                    Found in src/applications/appeals/995/containers/App.jsx and 2 other locations - About 1 hr to fix
                    src/applications/appeals/996/containers/Form0996App.jsx on lines 168..176
                    src/applications/appeals/testing/hlr/containers/Form0996App.jsx on lines 147..155

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

                    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

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

                      const {
                        enableShortWorkflow,
                        errorSchema,
                        formContext,
                        formData = [],
                    Severity: Major
                    Found in src/platform/forms-system/src/js/fields/FileField.jsx and 2 other locations - About 1 hr to fix
                    src/applications/pre-need/components/FileField.jsx on lines 76..87
                    src/applications/simple-forms/40-0247/components/FileField.jsx on lines 78..89

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

                    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

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

                      if (!pathname.endsWith('/start') && !hasSupportedBenefitType) {
                        router.push('/start');
                        content = wrapInH1(
                          <va-loading-indicator
                            set-focus
                    Severity: Major
                    Found in src/applications/appeals/996/containers/Form0996App.jsx and 2 other locations - About 1 hr to fix
                    src/applications/appeals/995/containers/App.jsx on lines 154..162
                    src/applications/appeals/testing/hlr/containers/Form0996App.jsx on lines 147..155

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

                    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

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

                      const {
                        enableShortWorkflow,
                        errorSchema,
                        formContext,
                        formData = [],
                    Severity: Major
                    Found in src/applications/pre-need/components/FileField.jsx and 2 other locations - About 1 hr to fix
                    src/applications/simple-forms/40-0247/components/FileField.jsx on lines 78..89
                    src/platform/forms-system/src/js/fields/FileField.jsx on lines 79..90

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

                    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

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

                      const {
                        enableShortWorkflow,
                        errorSchema,
                        formContext,
                        formData = [],
                    src/applications/pre-need/components/FileField.jsx on lines 76..87
                    src/platform/forms-system/src/js/fields/FileField.jsx on lines 79..90

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

                    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

                      getTitle = () => {
                        const { uiSchema, formData } = this.props;
                        return typeof uiSchema['ui:title'] === 'function'
                          ? uiSchema['ui:title'](formData)
                          : uiSchema['ui:title'];
                    src/applications/disability-benefits/2346/components/ReviewCardField.jsx on lines 144..149
                    src/applications/disability-benefits/2346/components/ReviewCardField.jsx on lines 151..156
                    src/applications/health-care-supply-reordering/components/ReviewCardField.jsx on lines 144..149
                    src/applications/health-care-supply-reordering/components/ReviewCardField.jsx on lines 151..156
                    src/platform/forms-system/src/js/components/ReviewCardField.jsx on lines 100..105

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

                    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

                      getSubtitle = () => {
                        const { uiSchema, formData } = this.props;
                        return typeof uiSchema['ui:subtitle'] === 'function'
                          ? uiSchema['ui:subtitle'](formData)
                          : uiSchema['ui:subtitle'];
                    src/applications/disability-benefits/2346/components/ReviewCardField.jsx on lines 144..149
                    src/applications/health-care-supply-reordering/components/ReviewCardField.jsx on lines 144..149
                    src/applications/health-care-supply-reordering/components/ReviewCardField.jsx on lines 151..156
                    src/platform/forms-system/src/js/components/ReviewCardField.jsx on lines 93..98
                    src/platform/forms-system/src/js/components/ReviewCardField.jsx on lines 100..105

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

                    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

                      getSubtitle = () => {
                        const { uiSchema, formData } = this.props;
                        return typeof uiSchema['ui:subtitle'] === 'function'
                          ? uiSchema['ui:subtitle'](formData)
                          : uiSchema['ui:subtitle'];
                    src/applications/disability-benefits/2346/components/ReviewCardField.jsx on lines 144..149
                    src/applications/disability-benefits/2346/components/ReviewCardField.jsx on lines 151..156
                    src/applications/health-care-supply-reordering/components/ReviewCardField.jsx on lines 144..149
                    src/platform/forms-system/src/js/components/ReviewCardField.jsx on lines 93..98
                    src/platform/forms-system/src/js/components/ReviewCardField.jsx on lines 100..105

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

                    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

                      getTitle = () => {
                        const { uiSchema, formData } = this.props;
                        return typeof uiSchema['ui:title'] === 'function'
                          ? uiSchema['ui:title'](formData)
                          : uiSchema['ui:title'];
                    src/applications/disability-benefits/2346/components/ReviewCardField.jsx on lines 151..156
                    src/applications/health-care-supply-reordering/components/ReviewCardField.jsx on lines 144..149
                    src/applications/health-care-supply-reordering/components/ReviewCardField.jsx on lines 151..156
                    src/platform/forms-system/src/js/components/ReviewCardField.jsx on lines 93..98
                    src/platform/forms-system/src/js/components/ReviewCardField.jsx on lines 100..105

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

                    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

                      getSubtitle = () => {
                        const { uiSchema, formData } = this.props;
                        return typeof uiSchema['ui:subtitle'] === 'function'
                          ? uiSchema['ui:subtitle'](formData)
                          : uiSchema['ui:subtitle'];
                    src/applications/disability-benefits/2346/components/ReviewCardField.jsx on lines 144..149
                    src/applications/disability-benefits/2346/components/ReviewCardField.jsx on lines 151..156
                    src/applications/health-care-supply-reordering/components/ReviewCardField.jsx on lines 144..149
                    src/applications/health-care-supply-reordering/components/ReviewCardField.jsx on lines 151..156
                    src/platform/forms-system/src/js/components/ReviewCardField.jsx on lines 93..98

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

                    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