department-of-veterans-affairs/vets-website

View on GitHub

Showing 12,840 of 12,840 total issues

Function createRichTextDetailItem has 54 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const createRichTextDetailItem = async (doc, config, x, item) => {
  let titleText = item.title ?? '';
  const content = [];

  if (titleText) {
Severity: Major
Found in src/platform/pdf/templates/utils.js - About 2 hrs to fix

    Function vaTextInputFieldMapping has 54 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export default function vaTextInputFieldMapping(props) {
      const {
        description,
        textDescription,
        DescriptionField,

      Function refreshTransaction has 54 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export function refreshTransaction(
        transaction,
        analyticsSectionName,
        _route = null,
      ) {
      Severity: Major
      Found in src/platform/user/profile/vap-svc/actions/transactions.js - About 2 hrs to fix

        Function renderServiceTypeDropdown has 54 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          const renderServiceTypeDropdown = () => {
            const { facilityType, serviceType, serviceTypeChanged } = currentQuery;
            const disabled = ![
              LocationType.HEALTH,
              LocationType.URGENT_CARE,
        Severity: Major
        Found in src/applications/facility-locator/components/SearchControls.jsx - About 2 hrs to fix

          Function listItems has 54 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            const listItems = providers.map((item, index) => {
              const { insuranceName, insurancePolicyHolderName } = item;
              const srLabel = getInsuranceSrLabel(item);
              const modalDescription = replaceStrValues(
                content['insurance-modal-remove-description'],
          Severity: Major
          Found in src/applications/ezr/components/FormFields/InsurancePolicyList.jsx - About 2 hrs to fix

            Function render has 54 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              render() {
                const {
                  route,
                  params,
                  form,
            Severity: Major
            Found in src/applications/edu-benefits/0993/containers/FormPage.jsx - About 2 hrs to fix

              Function UploadFileToVa has 54 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              const UploadFileToVa = () => {
                return (
                  <div>
                    <MainContentSubDiv id="upload-files-to-va" header="Upload files to VA">
                      <LiSpanAndVaLinkAndPTag
              Severity: Major
              Found in src/applications/sco/components/MainContent/Update/UploadFileToVa.jsx - About 2 hrs to fix

                Function personalInfo has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                const personalInfo = (state = initialState, action) => {
                  switch (action.type) {
                    case FETCH_PERSONAL_INFO:
                      return {
                        ...state,
                Severity: Major
                Found in src/applications/verify-your-enrollment/reducers/personalInfo.js - About 2 hrs to fix

                  Function listItems has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    const listItems = providers.map((item, index) => {
                      const { insuranceName, insurancePolicyHolderName } = item;
                      const srLabel = getInsuranceSrLabel(item);
                      const modalDescription = replaceStrValues(
                        content['insurance-modal-remove-description'],

                    Function OMBInfo has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    const OMBInfo = () => {
                      const expDate = '07/31/2027';
                      const ombNum = '2900-0091';
                      const resBurden = '35';
                      return (

                      Function HouseholdFinancialOnboarding has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      const HouseholdFinancialOnboarding = props => {
                        const {
                          goBack,
                          goForward,
                          contentBeforeButtons,
                      Severity: Major
                      Found in src/applications/hca/components/FormPages/FinancialInformation.jsx - About 2 hrs to fix

                        Function NextOfKin has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        const NextOfKin = props => {
                          const { router } = props;
                          const { t } = useTranslation();
                        
                          const selectVeteranData = useMemo(makeSelectVeteranData, []);
                        Severity: Major
                        Found in src/applications/check-in/pre-check-in/pages/NextOfKin/index.jsx - About 2 hrs to fix

                          Function useSendDemographicsFlags has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          const useSendDemographicsFlags = () => {
                            const selectApp = useMemo(makeSelectApp, []);
                            const { app } = useSelector(selectApp);
                            const [isLoading, setIsLoading] = useState(false);
                            const [isComplete, setIsComplete] = useState(false);
                          Severity: Major
                          Found in src/applications/check-in/hooks/useSendDemographicsFlags.jsx - About 2 hrs to fix

                            Function updateFormData has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              const updateFormData = e => {
                                e.preventDefault();
                            
                                const errorList = selectedDeductions
                                  .filter(

                              Function updateFormData has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                const updateFormData = e => {
                                  e.preventDefault();
                              
                                  const errorList = selectedDeductions
                                    .filter(

                                Function MessageThread has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                const MessageThread = props => {
                                  const { messageHistory, isDraftThread } = props;
                                  const accordionRef = useRef();
                                  const [expanded, setExpanded] = useState('');
                                

                                  Function processUl has 54 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    const processUl = ul => {
                                      const nestedUls = ul.querySelectorAll('ul');
                                  
                                      // This section is to address nested <ul> tags
                                      nestedUls.forEach(nestedUl => {
                                  Severity: Major
                                  Found in src/applications/mhv-medications/util/helpers.js - About 2 hrs to fix

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

                                    Orange22A.propTypes = {
                                      formResponses: PropTypes.object.isRequired,
                                      router: PropTypes.shape({
                                        push: PropTypes.func,
                                      }).isRequired,
                                    src/applications/pact-act/containers/questions/ServicePeriod.jsx on lines 68..75
                                    src/applications/pact-act/containers/questions/agent-orange/AgentOrange-2-2-1-A.jsx on lines 79..86
                                    src/applications/pact-act/containers/questions/agent-orange/AgentOrange-2-2-1-B.jsx on lines 75..82
                                    src/applications/pact-act/containers/questions/agent-orange/AgentOrange-2-2-2.jsx on lines 67..74
                                    src/applications/pact-act/containers/questions/agent-orange/AgentOrange-2-2-3.jsx on lines 67..74
                                    src/applications/pact-act/containers/questions/agent-orange/AgentOrange-2-2-B.jsx on lines 72..79
                                    src/applications/pact-act/containers/questions/burn-pit/BurnPit-2-1-1.jsx on lines 82..89
                                    src/applications/pact-act/containers/questions/burn-pit/BurnPit-2-1-2.jsx on lines 79..86
                                    src/applications/pact-act/containers/questions/burn-pit/BurnPit-2-1-3.jsx on lines 82..89
                                    src/applications/pact-act/containers/questions/burn-pit/BurnPit-2-1.jsx on lines 79..86
                                    src/applications/pact-act/containers/questions/camp-lejeune/Lejeune-2-4.jsx on lines 75..82
                                    src/applications/pact-act/containers/questions/main-flow/Main-Flow-2-5.jsx on lines 94..101
                                    src/applications/pact-act/containers/questions/radiation/Radiation-2-3-A.jsx on lines 76..83
                                    src/applications/pact-act/containers/questions/radiation/Radiation-2-3-B.jsx on lines 72..79

                                    Duplicated Code

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

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

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

                                    Tuning

                                    This issue has a mass of 78.

                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                    Refactorings

                                    Further Reading

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

                                    Orange221B.propTypes = {
                                      formResponses: PropTypes.object.isRequired,
                                      router: PropTypes.shape({
                                        push: PropTypes.func,
                                      }).isRequired,
                                    src/applications/pact-act/containers/questions/ServicePeriod.jsx on lines 68..75
                                    src/applications/pact-act/containers/questions/agent-orange/AgentOrange-2-2-1-A.jsx on lines 79..86
                                    src/applications/pact-act/containers/questions/agent-orange/AgentOrange-2-2-2.jsx on lines 67..74
                                    src/applications/pact-act/containers/questions/agent-orange/AgentOrange-2-2-3.jsx on lines 67..74
                                    src/applications/pact-act/containers/questions/agent-orange/AgentOrange-2-2-A.jsx on lines 83..90
                                    src/applications/pact-act/containers/questions/agent-orange/AgentOrange-2-2-B.jsx on lines 72..79
                                    src/applications/pact-act/containers/questions/burn-pit/BurnPit-2-1-1.jsx on lines 82..89
                                    src/applications/pact-act/containers/questions/burn-pit/BurnPit-2-1-2.jsx on lines 79..86
                                    src/applications/pact-act/containers/questions/burn-pit/BurnPit-2-1-3.jsx on lines 82..89
                                    src/applications/pact-act/containers/questions/burn-pit/BurnPit-2-1.jsx on lines 79..86
                                    src/applications/pact-act/containers/questions/camp-lejeune/Lejeune-2-4.jsx on lines 75..82
                                    src/applications/pact-act/containers/questions/main-flow/Main-Flow-2-5.jsx on lines 94..101
                                    src/applications/pact-act/containers/questions/radiation/Radiation-2-3-A.jsx on lines 76..83
                                    src/applications/pact-act/containers/questions/radiation/Radiation-2-3-B.jsx on lines 72..79

                                    Duplicated Code

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

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

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

                                    Tuning

                                    This issue has a mass of 78.

                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                    Refactorings

                                    Further Reading

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

                                    ServicePeriod.propTypes = {
                                      formResponses: PropTypes.object.isRequired,
                                      router: PropTypes.shape({
                                        push: PropTypes.func,
                                      }).isRequired,
                                    src/applications/pact-act/containers/questions/agent-orange/AgentOrange-2-2-1-A.jsx on lines 79..86
                                    src/applications/pact-act/containers/questions/agent-orange/AgentOrange-2-2-1-B.jsx on lines 75..82
                                    src/applications/pact-act/containers/questions/agent-orange/AgentOrange-2-2-2.jsx on lines 67..74
                                    src/applications/pact-act/containers/questions/agent-orange/AgentOrange-2-2-3.jsx on lines 67..74
                                    src/applications/pact-act/containers/questions/agent-orange/AgentOrange-2-2-A.jsx on lines 83..90
                                    src/applications/pact-act/containers/questions/agent-orange/AgentOrange-2-2-B.jsx on lines 72..79
                                    src/applications/pact-act/containers/questions/burn-pit/BurnPit-2-1-1.jsx on lines 82..89
                                    src/applications/pact-act/containers/questions/burn-pit/BurnPit-2-1-2.jsx on lines 79..86
                                    src/applications/pact-act/containers/questions/burn-pit/BurnPit-2-1-3.jsx on lines 82..89
                                    src/applications/pact-act/containers/questions/burn-pit/BurnPit-2-1.jsx on lines 79..86
                                    src/applications/pact-act/containers/questions/camp-lejeune/Lejeune-2-4.jsx on lines 75..82
                                    src/applications/pact-act/containers/questions/main-flow/Main-Flow-2-5.jsx on lines 94..101
                                    src/applications/pact-act/containers/questions/radiation/Radiation-2-3-A.jsx on lines 76..83
                                    src/applications/pact-act/containers/questions/radiation/Radiation-2-3-B.jsx on lines 72..79

                                    Duplicated Code

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

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

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

                                    Tuning

                                    This issue has a mass of 78.

                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                    Refactorings

                                    Further Reading

                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language