department-of-veterans-affairs/vets-website

View on GitHub

Showing 4,231 of 14,884 total issues

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

    export const MemoryUsage = () => {
      const [memoryUsage, setMemoryUsage] = useState(null);
    
      useEffect(() => {
        // Function to get browser tab's memory usage

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

          async () => {
            try {
              updateDevLoading(true);
      
              const response = await fetch(

        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).
        Severity: Minor
        Found in src/applications/discover-your-benefits/reducers/actions.js - About 1 hr to fix

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

            const getChapterPagesFromChapterIndex = chapterIndex => {
              const chapterKey = chapterKeys[chapterIndex];
              const chapter = formConfig.chapters[chapterKey];
              // ideally this would filter out visibility using the page depends function
              return Object.keys(chapter.pages || {}).map((page, index) => {

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

                render() {
                  if (this.props.loading) {
                    return <va-loading-indicator message="Loading facility..." />;
                  }
              
              

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

                const DemographicViewField = props => {
                  const { formContext, uiSchema, schema, formData, registry } = props;
                  const { ObjectField } = registry.fields;
                
                  if (formContext.reviewMode) {
                Severity: Minor
                Found in src/applications/hca/components/FormFields/DemographicViewField.jsx - About 1 hr to fix

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

                    function handleChange(event) {
                      if (props?.toeDupContactInfoCall) {
                        if (props.email !== event) {
                          props.setFormData({
                            ...props?.formData,
                  Severity: Minor
                  Found in src/applications/toe/components/CustomEmailField.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

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

                        postTravelOnlyClaim: async (startTime, uuid, timeToComplete) => {
                          const url = '/check_in/v0/travel_claims/';
                          const headers = { 'Content-Type': 'application/json' };
                          const travelClaimData = {
                            travelClaims: {
                      Severity: Minor
                      Found in src/applications/check-in/api/versions/v2.js - About 1 hr to fix

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

                        export const isBDD = formData => {
                          const isBddDataFlag = Boolean(formData?.['view:isBddData']);
                          const servicePeriods = formData?.serviceInformation?.servicePeriods || [];
                        
                          // separation date entered in the wizard
                        Severity: Minor
                        Found in src/applications/disability-benefits/all-claims/utils/index.jsx - About 1 hr to fix

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

                          const IdentityNotVerified = () => {
                            const content = (
                              <>
                                <p className="vads-u-font-size--base">
                                  We need to make sure you’re you — and not someone pretending to be you —

                            Function ui:validations has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                      (errors, city, formData, _schema, _uiSchema, _index) => {
                                        // This variable represents whether a veteran checked the "I live on a military base outside of the U.S." checkbox on the page
                                        // running this validation. This is stored within `formData` as `view:livesOnMilitaryBase` (`MILITARY_BASE_PATH`), but the path
                                        // thereto differs depending on the page running the validation.
                                        let livesOnMilitaryBase =

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

                                const prefillContactInformation = data => {
                                  const newData = _.omit(['veteran'], data);
                                  const { veteran } = data;
                              
                                  if (veteran) {

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

                                export const submitErrorContent = props => {
                                  const submissionIdContent = props.submissionId
                                    ? ` and provide this reference number ${props.submissionId}`
                                    : '';
                                
                                

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

                                  const FinancialHardshipViewField = props => {
                                    const { defaultEditButton, formData } = props;
                                    const { financialHardshipDocuments } = formData;
                                  
                                    return (

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

                                    export function makePages() {
                                      const pagesList = Object.keys(ADDITIONAL_EXPOSURES)
                                        .filter(itemId => itemId !== 'none' && itemId !== 'notsure')
                                        .map(itemId => {
                                          const pageName = `additional-exposure-${itemId}`;

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

                                      const TerminalIllnessViewField = props => {
                                        const { defaultEditButton, formData } = props;
                                        const { terminalIllnessDocuments } = formData;
                                      
                                        return (

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

                                            .map(chapterName => {
                                              const pages = pagesByChapter[chapterName];
                                              const expandedPages = getActiveExpandedPages(pages, formData);
                                              const chapterFormConfig = getChapterFormConfigAskVa(
                                                modifiedFormConfig,
                                        Severity: Minor
                                        Found in src/applications/ask-va/containers/ReviewPage.jsx - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language