department-of-veterans-affairs/vets-website

View on GitHub

Showing 3,724 of 12,675 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 updateFormDataAddress has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export const updateFormDataAddress = (
      oldFormData,
      formData,
      path,
      index = null, // this is included in the path, but added as
    Severity: Minor
    Found in src/platform/forms-system/src/js/definitions/profileAddress.js - About 1 hr to fix

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

          (state, page) => {
            const definitions = {
              ...(formConfig.defaultDefinitions || {}),
              ...page.schema.definitions,
            };
      Severity: Minor
      Found in src/platform/forms-system/src/js/state/helpers.js - About 1 hr to fix

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

        export function createStringifyFormReplacer(options) {
          const replacerFn = (key, value) => {
            if (!options?.allowPartialAddress && isPartialAddress(value)) {
              return undefined;
            }
        Severity: Minor
        Found in src/platform/forms-system/src/js/helpers.js - About 1 hr to fix

          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 mapBenefitFromFormInputData has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

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

              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 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 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 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 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 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 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 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 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 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 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: (
                                              <>
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language