department-of-veterans-affairs/vets-website

View on GitHub
src/applications/discharge-wizard/helpers/index.jsx

Summary

Maintainability
F
1 wk
Test Coverage

File index.jsx has 626 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import React from 'react';
import moment from 'moment';
import { differenceInYears } from 'date-fns';
import * as options from 'platform/static-data/options-for-select';
import {
Severity: Major
Found in src/applications/discharge-wizard/helpers/index.jsx - About 1 day to fix

    Function determineVenueAddress has 115 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export const determineVenueAddress = (formResponses, noDRB) => {
      if (!formResponses) return null;
    
      const boardData = determineBoardObj(formResponses);
    
    
    Severity: Major
    Found in src/applications/discharge-wizard/helpers/index.jsx - About 4 hrs to fix

      Function venueAddress has 115 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export const venueAddress = (formValues, noDRB) => {
        if (!formValues) return null;
      
        const boardData = board(formValues);
      
      
      Severity: Major
      Found in src/applications/discharge-wizard/helpers/index.jsx - About 4 hrs to fix

        Function getBoardExplanation has 59 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export const getBoardExplanation = formResponses => {
          const reason = formResponses[SHORT_NAME_MAP.REASON];
          const noPrevApp =
            formResponses[SHORT_NAME_MAP.PREV_APPLICATION] === RESPONSES.NO;
          const prevAppType = formResponses[SHORT_NAME_MAP.PREV_APPLICATION_TYPE];
        Severity: Major
        Found in src/applications/discharge-wizard/helpers/index.jsx - About 2 hrs to fix

          Function determineBoardObj has 57 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export const determineBoardObj = (formResponses, noDRB) => {
            if (!formResponses) {
              return null;
            }
          
          
          Severity: Major
          Found in src/applications/discharge-wizard/helpers/index.jsx - About 2 hrs to fix

            Function getBoardExplanation has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
            Open

            export const getBoardExplanation = formResponses => {
              const reason = formResponses[SHORT_NAME_MAP.REASON];
              const noPrevApp =
                formResponses[SHORT_NAME_MAP.PREV_APPLICATION] === RESPONSES.NO;
              const prevAppType = formResponses[SHORT_NAME_MAP.PREV_APPLICATION_TYPE];
            Severity: Minor
            Found in src/applications/discharge-wizard/helpers/index.jsx - About 2 hrs to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

            Function board has 43 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export const board = (formValues, noDRB) => {
              if (!formValues) return null;
            
              const prevAppType =
                ['1', '4'].indexOf(formValues['10_prevApplicationType']) > -1;
            Severity: Minor
            Found in src/applications/discharge-wizard/helpers/index.jsx - About 1 hr to fix

              Function answerReview has 41 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export const answerReview = (key, formValues) => {
                const ans = formValues[key];
                const dischargeYearLabel = prevApplicationYearCutoff[formValues['4_reason']];
                const monthObj = options.months.find(
                  m => String(m.value) === formValues['3_dischargeMonth'],
              Severity: Minor
              Found in src/applications/discharge-wizard/helpers/index.jsx - About 1 hr to fix

                Function answerReviewLabel has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export const answerReviewLabel = (key, formValues) => {
                  const answer = formValues[key];
                
                  const dischargeMonth =
                    monthLabelMap[formValues[SHORT_NAME_MAP.DISCHARGE_MONTH]] || '';
                Severity: Minor
                Found in src/applications/discharge-wizard/helpers/index.jsx - About 1 hr to fix

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

                  export const answerReview = (key, formValues) => {
                    const ans = formValues[key];
                    const dischargeYearLabel = prevApplicationYearCutoff[formValues['4_reason']];
                    const monthObj = options.months.find(
                      m => String(m.value) === formValues['3_dischargeMonth'],
                  Severity: Minor
                  Found in src/applications/discharge-wizard/helpers/index.jsx - 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 answerReviewLabel has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export const answerReviewLabel = (key, formValues) => {
                    const answer = formValues[key];
                  
                    const dischargeMonth =
                      monthLabelMap[formValues[SHORT_NAME_MAP.DISCHARGE_MONTH]] || '';
                  Severity: Minor
                  Found in src/applications/discharge-wizard/helpers/index.jsx - 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 determineVenueAddress has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export const determineVenueAddress = (formResponses, noDRB) => {
                    if (!formResponses) return null;
                  
                    const boardData = determineBoardObj(formResponses);
                  
                  
                  Severity: Minor
                  Found in src/applications/discharge-wizard/helpers/index.jsx - About 55 mins 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 venueAddress has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export const venueAddress = (formValues, noDRB) => {
                    if (!formValues) return null;
                  
                    const boardData = board(formValues);
                  
                  
                  Severity: Minor
                  Found in src/applications/discharge-wizard/helpers/index.jsx - About 55 mins 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 board has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export const board = (formValues, noDRB) => {
                    if (!formValues) return null;
                  
                    const prevAppType =
                      ['1', '4'].indexOf(formValues['10_prevApplicationType']) > -1;
                  Severity: Minor
                  Found in src/applications/discharge-wizard/helpers/index.jsx - About 55 mins 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 determineBoardObj has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                  Open

                  export const determineBoardObj = (formResponses, noDRB) => {
                    if (!formResponses) {
                      return null;
                    }
                  
                  
                  Severity: Minor
                  Found in src/applications/discharge-wizard/helpers/index.jsx - About 55 mins 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

                  Avoid too many return statements within this function.
                  Open

                      return handleDRBExplanation(boardToSubmit, serviceBranch, prevAppType);
                  Severity: Major
                  Found in src/applications/discharge-wizard/helpers/index.jsx - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                          return answer;
                    Severity: Major
                    Found in src/applications/discharge-wizard/helpers/index.jsx - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                        return '';
                      Severity: Major
                      Found in src/applications/discharge-wizard/helpers/index.jsx - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                            return { name: 'Discharge Review Board (DRB)', abbr: DRB };
                        Severity: Major
                        Found in src/applications/discharge-wizard/helpers/index.jsx - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                              return { name: 'Discharge Review Board (DRB)', abbr: 'DRB' };
                          Severity: Major
                          Found in src/applications/discharge-wizard/helpers/index.jsx - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                  return answer;
                            Severity: Major
                            Found in src/applications/discharge-wizard/helpers/index.jsx - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                return boardObj;
                              Severity: Major
                              Found in src/applications/discharge-wizard/helpers/index.jsx - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                  return boardObj;
                                Severity: Major
                                Found in src/applications/discharge-wizard/helpers/index.jsx - About 30 mins to fix

                                  Avoid too many return statements within this function.
                                  Open

                                          return `I'm not sure if my discharge was the outcome of a general court-martial.`;
                                  Severity: Major
                                  Found in src/applications/discharge-wizard/helpers/index.jsx - About 30 mins to fix

                                    Avoid too many return statements within this function.
                                    Open

                                        return `the ${abbr} for the ${serviceBranch}. This is because the Board handles all cases from 15 or more years ago.`;
                                    Severity: Major
                                    Found in src/applications/discharge-wizard/helpers/index.jsx - About 30 mins to fix

                                      Avoid too many return statements within this function.
                                      Open

                                            return questionLabels[key][ans];
                                      Severity: Major
                                      Found in src/applications/discharge-wizard/helpers/index.jsx - About 30 mins to fix

                                        Avoid too many return statements within this function.
                                        Open

                                              return answer;
                                        Severity: Major
                                        Found in src/applications/discharge-wizard/helpers/index.jsx - About 30 mins to fix

                                          Avoid too many return statements within this function.
                                          Open

                                              return `the ${abbr} for the ${serviceBranch}. This is because your discharge was the result of a general court-martial.`;
                                          Severity: Major
                                          Found in src/applications/discharge-wizard/helpers/index.jsx - About 30 mins to fix

                                            Avoid too many return statements within this function.
                                            Open

                                                return `the ${abbr} for the ${serviceBranch}. This is because you want to change information other than your characterization of discharge, re-enlistment code, separation code, and narrative reason for discharge.`;
                                            Severity: Major
                                            Found in src/applications/discharge-wizard/helpers/index.jsx - About 30 mins to fix

                                              Avoid too many return statements within this function.
                                              Open

                                                      return `I'm not sure what kind of discharge upgrade application I previously made.`;
                                              Severity: Major
                                              Found in src/applications/discharge-wizard/helpers/index.jsx - About 30 mins to fix

                                                Avoid too many return statements within this function.
                                                Open

                                                    return `the ${abbr}. If you’ve applied before, you must re-apply to the ${abbr} for reconsideration.`;
                                                Severity: Major
                                                Found in src/applications/discharge-wizard/helpers/index.jsx - About 30 mins to fix

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

                                                        case RESPONSES.COAST_GUARD:
                                                          return (
                                                            <p className="va-address-block">
                                                              Commandant (CG-133)
                                                              <br />
                                                  Severity: Major
                                                  Found in src/applications/discharge-wizard/helpers/index.jsx and 1 other location - About 1 hr to fix
                                                  src/applications/discharge-wizard/helpers/index.jsx on lines 122..136

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

                                                  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

                                                  export const determineIsAirForceAFRBAPortal = formResponses =>
                                                    formResponses[SHORT_NAME_MAP.SERVICE_BRANCH] === RESPONSES.AIR_FORCE &&
                                                    determineBoardObj(formResponses).abbr === BCMR &&
                                                    determineFormData(formResponses).num === 149;
                                                  Severity: Major
                                                  Found in src/applications/discharge-wizard/helpers/index.jsx and 1 other location - About 1 hr to fix
                                                  src/applications/discharge-wizard/helpers/index.jsx on lines 547..550

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

                                                  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 'coastGuard':
                                                          return (
                                                            <p className="va-address-block">
                                                              Commandant (CG-133)
                                                              <br />
                                                  Severity: Major
                                                  Found in src/applications/discharge-wizard/helpers/index.jsx and 1 other location - About 1 hr to fix
                                                  src/applications/discharge-wizard/helpers/index.jsx on lines 445..459

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

                                                  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

                                                  export const determineAirForceAFRBAPortal = formResponses =>
                                                    formResponses[SHORT_NAME_MAP.SERVICE_BRANCH] === RESPONSES.AIR_FORCE &&
                                                    determineBoardObj(formResponses).abbr === BCMR &&
                                                    determineFormData(formResponses).num === 149;
                                                  Severity: Major
                                                  Found in src/applications/discharge-wizard/helpers/index.jsx and 1 other location - About 1 hr to fix
                                                  src/applications/discharge-wizard/helpers/index.jsx on lines 565..568

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

                                                  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

                                                        case RESPONSES.AIR_FORCE:
                                                          return (
                                                            <p className="va-address-block">
                                                              Air Force Discharge Review Board
                                                              <br />
                                                  Severity: Major
                                                  Found in src/applications/discharge-wizard/helpers/index.jsx and 3 other locations - About 1 hr to fix
                                                  src/applications/discharge-wizard/helpers/index.jsx on lines 419..431
                                                  src/applications/discharge-wizard/helpers/index.jsx on lines 477..489
                                                  src/applications/discharge-wizard/helpers/index.jsx on lines 501..513

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

                                                  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

                                                        case RESPONSES.ARMY:
                                                          return (
                                                            <p className="va-address-block">
                                                              Army Review Boards Agency
                                                              <br />
                                                  Severity: Major
                                                  Found in src/applications/discharge-wizard/helpers/index.jsx and 3 other locations - About 1 hr to fix
                                                  src/applications/discharge-wizard/helpers/index.jsx on lines 419..431
                                                  src/applications/discharge-wizard/helpers/index.jsx on lines 432..444
                                                  src/applications/discharge-wizard/helpers/index.jsx on lines 501..513

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

                                                  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

                                                        case RESPONSES.ARMY:
                                                          return (
                                                            <p className="va-address-block">
                                                              Army Review Boards Agency
                                                              <br />
                                                  Severity: Major
                                                  Found in src/applications/discharge-wizard/helpers/index.jsx and 3 other locations - About 1 hr to fix
                                                  src/applications/discharge-wizard/helpers/index.jsx on lines 432..444
                                                  src/applications/discharge-wizard/helpers/index.jsx on lines 477..489
                                                  src/applications/discharge-wizard/helpers/index.jsx on lines 501..513

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

                                                  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

                                                        case RESPONSES.COAST_GUARD:
                                                          return (
                                                            <p className="va-address-block">
                                                              DHS Office of the General Counsel
                                                              <br />
                                                  Severity: Major
                                                  Found in src/applications/discharge-wizard/helpers/index.jsx and 3 other locations - About 1 hr to fix
                                                  src/applications/discharge-wizard/helpers/index.jsx on lines 419..431
                                                  src/applications/discharge-wizard/helpers/index.jsx on lines 432..444
                                                  src/applications/discharge-wizard/helpers/index.jsx on lines 477..489

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

                                                  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

                                                        case 'army':
                                                          return (
                                                            <p className="va-address-block">
                                                              Army Review Boards Agency
                                                              <br />
                                                  Severity: Major
                                                  Found in src/applications/discharge-wizard/helpers/index.jsx and 3 other locations - About 1 hr to fix
                                                  src/applications/discharge-wizard/helpers/index.jsx on lines 96..108
                                                  src/applications/discharge-wizard/helpers/index.jsx on lines 109..121
                                                  src/applications/discharge-wizard/helpers/index.jsx on lines 178..190

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

                                                  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

                                                        case 'army':
                                                          return (
                                                            <p className="va-address-block">
                                                              Army Review Boards Agency
                                                              <br />
                                                  Severity: Major
                                                  Found in src/applications/discharge-wizard/helpers/index.jsx and 3 other locations - About 1 hr to fix
                                                  src/applications/discharge-wizard/helpers/index.jsx on lines 109..121
                                                  src/applications/discharge-wizard/helpers/index.jsx on lines 154..166
                                                  src/applications/discharge-wizard/helpers/index.jsx on lines 178..190

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

                                                  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

                                                        case 'coastGuard':
                                                          return (
                                                            <p className="va-address-block">
                                                              DHS Office of the General Counsel
                                                              <br />
                                                  Severity: Major
                                                  Found in src/applications/discharge-wizard/helpers/index.jsx and 3 other locations - About 1 hr to fix
                                                  src/applications/discharge-wizard/helpers/index.jsx on lines 96..108
                                                  src/applications/discharge-wizard/helpers/index.jsx on lines 109..121
                                                  src/applications/discharge-wizard/helpers/index.jsx on lines 154..166

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

                                                  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

                                                        case 'airForce':
                                                          return (
                                                            <p className="va-address-block">
                                                              Air Force Discharge Review Board
                                                              <br />
                                                  Severity: Major
                                                  Found in src/applications/discharge-wizard/helpers/index.jsx and 3 other locations - About 1 hr to fix
                                                  src/applications/discharge-wizard/helpers/index.jsx on lines 96..108
                                                  src/applications/discharge-wizard/helpers/index.jsx on lines 154..166
                                                  src/applications/discharge-wizard/helpers/index.jsx on lines 178..190

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

                                                  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

                                                        default:
                                                          // Navy or Marines
                                                          return (
                                                            <p className="va-address-block">
                                                              Secretary of the Navy Council of Review Boards
                                                  Severity: Major
                                                  Found in src/applications/discharge-wizard/helpers/index.jsx and 1 other location - About 1 hr to fix
                                                  src/applications/discharge-wizard/helpers/index.jsx on lines 137..150

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

                                                  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

                                                        default:
                                                          // Navy or Marines
                                                          return (
                                                            <p className="va-address-block">
                                                              Secretary of the Navy Council of Review Boards
                                                  Severity: Major
                                                  Found in src/applications/discharge-wizard/helpers/index.jsx and 1 other location - About 1 hr to fix
                                                  src/applications/discharge-wizard/helpers/index.jsx on lines 460..473

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

                                                  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

                                                        default:
                                                          // Navy or Marines
                                                          return (
                                                            <p className="va-address-block">
                                                              Board for Correction of Naval Records (BCNR)
                                                  Severity: Minor
                                                  Found in src/applications/discharge-wizard/helpers/index.jsx and 1 other location - About 35 mins to fix
                                                  src/applications/discharge-wizard/helpers/index.jsx on lines 514..525

                                                  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

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

                                                        default:
                                                          // Navy or Marines
                                                          return (
                                                            <p className="va-address-block">
                                                              Board for Correction of Naval Records (BCNR)
                                                  Severity: Minor
                                                  Found in src/applications/discharge-wizard/helpers/index.jsx and 1 other location - About 35 mins to fix
                                                  src/applications/discharge-wizard/helpers/index.jsx on lines 191..202

                                                  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