department-of-veterans-affairs/vets-website

View on GitHub

Showing 3,732 of 12,811 total issues

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

  render() {
    const { form } = this.props;
    const { formId, data } = form;

    const { fullName } = data;

    Function OtherTextField has 32 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export default function OtherTextField(props) {
      let { inputType } = props.options;
      if (!inputType) {
        inputType = numberTypes.has(props.schema.type) ? 'number' : props.type;
      }
    Severity: Minor
    Found in src/platform/user/profile/vap-svc/components/OtherTextField.jsx - About 1 hr to fix

      Function formatServiceName has 32 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export const formatServiceName = service => {
        if (!service) return null;
        const lowerCaseService = service
          .replace(/([A-Z])/g, ' $1')
          .replace(/\s+/g, ' ')
      Severity: Minor
      Found in src/applications/facility-locator/utils/formatServiceName.js - About 1 hr to fix

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

          render() {
            return (
              <div className="schemaform-intro">
                <br />
                <FormTitle title="Sign up to get a COVID-19 vaccine at VA" />

          Function strongCaseTips has 32 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            const strongCaseTips = () => {
              if (specReason) {
                return (
                  <div>
                    <span>
          Severity: Minor
          Found in src/applications/discharge-wizard/components/gpSteps/StepOne.jsx - About 1 hr to fix

            Function submitForm has 32 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const submitForm = (form, formConfig) => {
              const body = formConfig.transformForSubmit
                ? formConfig.transformForSubmit(formConfig, form)
                : transformForSubmit(formConfig, form);
              const benefits = form.data['view:benefit'];
            Severity: Minor
            Found in src/applications/edu-benefits/10203/submitForm.js - About 1 hr to fix

              Function activateInjectedAssets has 32 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function activateInjectedAssets() {
                fetch(`${getContentHostName()}/generated/headerFooter.json`)
                  .then(resp => {
                    if (resp.ok) {
                      return resp.json();
              Severity: Minor
              Found in src/applications/proxy-rewrite/proxy-rewrite-entry.jsx - About 1 hr to fix

                Function getDateRangesBetween has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export const getDateRangesBetween = (date1, date2) => {
                  const [year1, month1] = date1.split('-').map(str => parseInt(str, 10));
                  const [year2, month2] = date2.split('-').map(str => parseInt(str, 10));
                
                  const ranges = [];
                Severity: Minor
                Found in src/applications/verify-your-enrollment/helpers.jsx - About 1 hr to fix

                  Function TrainingAndWebinar has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  const TrainingAndWebinar = () => {
                    return (
                      <MainContentSubDiv
                        id="trainings-and-webinars"
                        header="Trainings and webinars"

                    Function bankInfo has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    const bankInfo = (state = initialState, action) => {
                      switch (action.type) {
                        case UPDATE_BANK_INFO:
                          return {
                            ...state,
                    Severity: Minor
                    Found in src/applications/verify-your-enrollment/reducers/bankInfo.js - About 1 hr to fix

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

                        render() {
                          const { lat, long, address } = this.state;
                          const { multiError, multiLoading, facilityID } = this.props;
                          const loading = multiLoading ? multiLoading[facilityID] : false;
                          const error = multiError ? multiError[facilityID] : false;

                        Function LoadingPage has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        const LoadingPage = props => {
                          const { router } = props;
                          const { t } = useTranslation();
                        
                          const { goToNextPage } = useFormRouting(router);
                        Severity: Minor
                        Found in src/applications/check-in/travel-claim/pages/LoadingPage/index.jsx - About 1 hr to fix

                          Function onSearch has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            const onSearch = (event, filterList, dropdownValue) => {
                              const incomingValue = event?.target?.filterBy?.value || dropdownValue;
                          
                              const newSelectedOption = filterByOptions.find(
                                option => option?.value === incomingValue,
                          Severity: Minor
                          Found in src/applications/static-pages/events/components/Events/index.js - About 1 hr to fix

                            Function getRepresentativeStatus has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              static getRepresentativeStatus() {
                                const requestUrl = `${
                                  environment.API_URL
                                }/representation_management/v0/power_of_attorney`;
                                const apiSettings = {

                              Function displayContent has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              const displayContent = (title, form526RequiredIdentifers) => {
                                const missingIdentifiers = filterMissingIdentifiers(
                                  form526RequiredIdentifers,
                                );
                              
                              

                                Function fixTreatedDisabilityNamesKey has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                export default function fixTreatedDisabilityNamesKey(savedData) {
                                  const formData = clone(savedData.formData);
                                  const facilities = formData.vaTreatmentFacilities || [];
                                  const powDisabilities = formData['view:isPow']?.powDisabilities;
                                  if (facilities) {

                                  Function DisagreeFileClaimPage has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  const DisagreeFileClaimPage = () => {
                                    recordEvent({
                                      event: 'howToWizard-alert-displayed',
                                      'reason-for-alert': 'disagree with VA decision, needs a decision review',
                                    });

                                    Function updateSchema has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                              updateSchema: formData => {
                                                let mailingAddress;
                                                const veteransAddress =
                                                  formData[veteranFields.parentObject][veteranFields.address];
                                                if (
                                    Severity: Minor
                                    Found in src/applications/simple-forms/21-4142/pages/preparerAddress1.js - About 1 hr to fix

                                      Function addServicePeriod has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                      export const addServicePeriod = (formData, separationDate, setFormData) => {
                                        const updateData = newData => {
                                          window.sessionStorage.removeItem(SAVED_SEPARATION_DATE);
                                          setFormData({
                                            ...newData,

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

                                          const updateFormData = event => {
                                            event.preventDefault();
                                        
                                            const inputValue = homeAcreageValue.value;
                                        
                                        
                                        Severity: Minor
                                        Found in src/applications/pensions/components/HomeAcreageValueInput.jsx - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language