department-of-veterans-affairs/vets-website

View on GitHub

Showing 12,745 of 12,745 total issues

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

const currentOrPastDateRangeUI = (fromOptions, toOptions, errorMessage) => {
  let fromLabel = 'From date';
  let toLabel = 'To date';
  let fromCustomOptions = {};
  let toCustomOptions = {};

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

      render() {
        const { terms, topContent } = this.props;
        const enabled =
          this.props.isDataAvailable === true ||
          typeof this.props.isDataAvailable === 'undefined';

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

      export function expandArrayPages(pageList, data) {
        const result = pageList.reduce(
          (acc, nextPage) => {
            const { lastArrayPath, arrayPages, currentList } = acc;
            // If we see an array page and we’re starting a section or in the middle of one, just add it
      Severity: Minor
      Found in src/platform/forms-system/src/js/helpers.js - About 1 hr to fix

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

            static deselectBasedOnValue(name, value, formData, properties) {
              // derive the notListedTextKey by looking at the form schema properties for a 'string' field type
              // be aware this logic limits the usage to a single text field for a 'write in' style field
              const notListedTextKey = Object.entries(properties).reduce(
                (previous, [propertyKey, { type }]) => {

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

                                        const displayContent = (title, form526RequiredIdentifers) => {
                                          const missingIdentifiers = filterMissingIdentifiers(
                                            form526RequiredIdentifers,
                                          );
                                        
                                        
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language