department-of-veterans-affairs/vets-website

View on GitHub

Showing 12,846 of 12,846 total issues

Function lcsSingleVsMulti has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function lcsSingleVsMulti(
  userInput,
  disabilityLabels,
  threshold = THRESHOLD,
  splitreg = REGEX_SPLIT,

    Function handleChange has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      function handleChange(event) {
        if (props?.showMebEnhancements08) {
          if (props.email !== event) {
            props.setFormData({
              ...props?.formData,

      Function setupMap has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        const setupMap = () => {
          const mapContainerElement = document.getElementById(mapboxGlContainer);
          if (!mapContainerElement) {
            return null;
          }
      Severity: Minor
      Found in src/applications/facility-locator/containers/FacilitiesMap.jsx - About 1 hr to fix

        Function prefillTransformer has 26 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export default function prefillTransformer(pages, formData, metadata) {
          const newFormData = formData;
        
          for (const addressType of ['permanentAddress', 'temporaryAddress']) {
            if (newFormData[addressType]?.country) {

          Function mapBenefitFromFormInputData has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export const mapBenefitFromFormInputData = (benefit, formData) => {
            if (checkExtraConditions(benefit, formData) === false) return false;
          
            const mappingKeys = Object.keys(mappingTypes);
            // Each mapping type (i.e. GOALS).

            Function mainTransform has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              const mainTransform = formData => {
                const { benefitType, additionalDocuments } = formData;
            
                const attributes = {
                  // fall back to compensation; this will fix a few existing submission
            Severity: Minor
            Found in src/applications/appeals/995/config/submit-transformer.js - About 1 hr to fix

              Function mainTransform has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                const mainTransform = formData => {
                  const { benefitType, additionalDocuments } = formData;
              
                  const attributes = {
                    // fall back to compensation; this will fix a few existing submission
              Severity: Minor
              Found in src/applications/appeals/testing/sc/config/submit-transformer.js - About 1 hr to fix

                Function renderPhoneNumber has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export const renderPhoneNumber = (
                  title,
                  subTitle = null,
                  phone,
                  from,

                  Function VABenefitsCall has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export default function VABenefitsCall() {
                    return (
                      <div>
                        <p className="p1">
                          <strong>To check on the status of your claim or appeal</strong>, use our{' '}
                  Severity: Minor
                  Found in src/applications/facility-locator/components/VABenefitsCall.jsx - About 1 hr to fix

                    Function renderVenueWarnings has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      const renderVenueWarnings = () => {
                        const prevAppType = formResponses[SHORT_NAME_MAP.PREV_APPLICATION_TYPE];
                        const reason = formResponses[SHORT_NAME_MAP.REASON];
                        const dischargeYear = formResponses[SHORT_NAME_MAP.DISCHARGE_YEAR];
                        const dischargeMonth = formResponses[SHORT_NAME_MAP.DISCHARGE_MONTH] || 1;

                      Function prefillTransformer has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export function prefillTransformer(pages, formData, metadata) {
                        const { homePhone, mobilePhone, email, remainingEntitlement } = formData;
                      
                        const totalDays = remainingEntitlement
                          ? remainingEntitlement.months * 30 + remainingEntitlement.days
                      Severity: Minor
                      Found in src/applications/edu-benefits/10203/prefill-transformer.js - About 1 hr to fix

                        Function getPrimaryContact has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        function getPrimaryContact(data) {
                          // If a certification name is present, third party signer is the certifier
                          const useCert =
                            data?.certification?.firstName && data?.certification?.firstName !== '';
                        
                        
                        Severity: Minor
                        Found in src/applications/ivc-champva/10-10D/config/submitTransformer.js - About 1 hr to fix

                          Function deepEqual has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          function deepEqual(obj1, obj2) {
                            if (obj1 === obj2) return true;
                          
                            if (
                              typeof obj1 !== 'object' ||
                          Severity: Minor
                          Found in src/applications/verify-your-enrollment/helpers.jsx - About 1 hr to fix

                            Function onclick has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                    radio.onclick = e => {
                                      let title = e.target.attributes.name.value;
                                      if (hasVeteran && veteranLabelMap.has(title))
                                        title = veteranLabelMap.get(title);
                                      else if (nonVeteranMap.has(title)) title = nonVeteranMap.get(title);
                            Severity: Minor
                            Found in src/applications/pre-need/PreNeedApp.jsx - About 1 hr to fix

                              Function getCemeteries has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              export function getCemeteries() {
                                return fetch(`${environment.API_URL}/v0/preneeds/cemeteries`, {
                                  credentials: 'include',
                                  headers: {
                                    'X-Key-Inflection': 'camel',
                              Severity: Minor
                              Found in src/applications/pre-need/utils/helpers.js - About 1 hr to fix

                                Function SupportingFilesOrAffidavitInfo has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                const SupportingFilesOrAffidavitInfo = () => {
                                  return (
                                    <>
                                      <p>
                                        You can also upload supporting files or an affidavit (a written

                                  Function PaymentSelectionUI has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  const PaymentSelectionUI = () => {
                                    return radioUI({
                                      title: 'Tell us where to send the payment for this claim',
                                      description: (
                                        <>

                                    Function CustomSSNReviewPage has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    export function CustomSSNReviewPage(props) {
                                      const maskedSSN = maskSSN(props?.data?.veteranSocialSecurityNumber?.ssn);
                                      return props.data ? (
                                        <div className="form-review-panel-page">
                                          <div className="form-review-panel-page-header-row">
                                    Severity: Minor
                                    Found in src/applications/ivc-champva/10-7959f-1/helpers/CustomSSN.jsx - About 1 hr to fix

                                      Function AuthRegistrationOnlyPage has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                      const AuthRegistrationOnlyPage = props => {
                                        const { location, route, router } = props;
                                        const { data: formData } = useSelector(state => state.form);
                                        const goBack = () => {
                                          const { pathname } = location;
                                      Severity: Minor
                                      Found in src/applications/hca/containers/AuthRegistrationOnlyPage.jsx - About 1 hr to fix

                                        Function renderOldLandingContent has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                        const renderOldLandingContent = () => {
                                          return (
                                            <>
                                              <p>
                                                You can find an accredited attorney, claims agent, or VSO in 1 of these
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language