department-of-veterans-affairs/vets-website

View on GitHub

Showing 3,724 of 12,672 total issues

Function SSNWidget has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export default function SSNWidget(props) {
  const [val, setVal] = useState(props.value);
  const [displayVal, setDisplayVal] = useState(props.value);

  const handleChange = value => {
Severity: Minor
Found in src/platform/forms-system/src/js/widgets/VAFileNumberWidget.jsx - About 1 hr to fix

    Function validatePages has 30 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export function validatePages(orderedPageTypes) {
      const pageTypes = {};
      for (const pageType of orderedPageTypes) {
        if (pageType === 'intro') {
          if (pageTypes.intro || pageTypes.summary || pageTypes.item) {

      Function accessibleFieldContent has 30 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              {this.orderedProperties.map((objectFields, index) => {
                if (objectFields.length > 1) {
                  const [first, ...rest] = objectFields;
                  const visible = rest.filter(
                    prop => !schema.properties[prop]['ui:collapsed'],
      Severity: Minor
      Found in src/platform/forms-system/src/js/fields/ObjectField.jsx - About 1 hr to fix

        Function Submitted has 30 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export default function Submitted(props) {
          const { formConfig, onBack, onSubmit } = props;
          let ariaDescribedBy = null;
          // If no ariaDescribedBy is passed down from form.js,
          // a null value will properly not render the aria label.
        Severity: Minor
        Found in src/platform/forms-system/src/js/review/submit-states/Submitted.jsx - About 1 hr to fix

          Function recordPanEvent has 30 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export const recordPanEvent = (mapCenter, currentQuery) => {
            const { searchCoords, searchArea } = currentQuery;
          
            return new Promise((resolve, _) => {
              let distanceMoved;
          Severity: Minor
          Found in src/applications/facility-locator/utils/analytics.js - About 1 hr to fix

            Function formatReadableDate has 30 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export const formatReadableDate = (rawDate, minimumDateDigits = 1) => {
              const months = [
                'January',
                'February',
                'March',
            Severity: Minor
            Found in src/applications/my-education-benefits/helpers.js - About 1 hr to fix

              Function CustomPhoneNumberField has 30 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function CustomPhoneNumberField(props) {
                function handleChange(event) {
                  if (props?.showMebEnhancements08) {
                    props?.updateGlobalPhoneNumber(event);
                    if (event?.length > 9) {

                Function DebtCardsList has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                const DebtCardsList = () => {
                  const { debts } = useSelector(
                    ({ combinedPortal }) => combinedPortal.debtLetters,
                  );
                
                

                  Function ContestableIssuesWidget has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  const ContestableIssuesWidget = props => {
                    const {
                      getContestableIssues,
                      contestableIssues,
                      setFormData,

                    Function transform has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export function transform(formConfig, form) {
                      // https://developer.va.gov/explore/appeals/docs/decision_reviews?version=current
                      // match supplemental claims schema here
                      const mainTransform = formData => {
                        const { benefitType, additionalDocuments } = formData;
                    Severity: Minor
                    Found in src/applications/appeals/testing/sc/config/submit-transformer.js - About 1 hr to fix

                      Function transform has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export function transform(formConfig, form) {
                        // https://developer.va.gov/explore/appeals/docs/decision_reviews?version=current
                        // match supplemental claims schema here
                        const mainTransform = formData => {
                          const { benefitType, additionalDocuments } = formData;
                      Severity: Minor
                      Found in src/applications/appeals/995/config/submit-transformer.js - About 1 hr to fix

                        Function processContestableIssues has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export const processContestableIssues = contestableIssues => {
                          const processDate = entry =>
                            (entry.attributes?.approxDecisionDate || '').replace(REGEXP.DASH, '');
                          // remove issues with no title & sort by date - see
                          // https://dsva.slack.com/archives/CSKKUL36K/p1623956682119300
                        Severity: Minor
                        Found in src/applications/appeals/shared/utils/issues.jsx - About 1 hr to fix

                          Function contestableIssuesReducer has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          const contestableIssuesReducer = getEligibleContestableIssues => (
                            state = initialState,
                            action,
                          ) => {
                            switch (action?.type) {
                          Severity: Minor
                          Found in src/applications/appeals/shared/reducers/contestableIssues.js - About 1 hr to fix

                            Function DependentListLoopForm has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            const DependentListLoopForm = props => {
                              const { children, data, page, onChange, onSubmit } = props;
                              const { fullName = {} } = data || {};
                            
                              // build the uiSchema title attribute based on form & page data

                              Function DependentListLoopForm has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              const DependentListLoopForm = props => {
                                const { children, data, page, onChange, onSubmit } = props;
                                const { fullName = {} } = data || {};
                              
                                // build the uiSchema title attribute based on form & page data

                                Function LastUpdated has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                const LastUpdated = () => {
                                  const feedbackButtonClicked = () => {
                                    window.KAMPYLE_ONSITE_SDK?.showForm('17');
                                  };
                                
                                
                                Severity: Minor
                                Found in src/applications/sco/components/MainContent/LastUpdated.jsx - About 1 hr to fix

                                  Function getEmptyState has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    getEmptyState(props) {
                                      const {
                                        onEdit,
                                        hideTitle,
                                        title,

                                    Function libraryPagerGen has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    export function libraryPagerGen() {
                                      const numCardsCount = libraryNumActiveCards();
                                      numCards = libraryNumCards();
                                      pages = Math.ceil(numCardsCount / itemsPerPage);
                                      if (document.getElementById('pager-nums-insert')) {

                                      Function ConfirmationPage has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                      const ConfirmationPage = () => {
                                        const { submission, data } = useSelector(state => state.form);
                                        const { userFullName } = useSelector(selectProfile);
                                        const loggedIn = useSelector(isLoggedIn);
                                        const { response } = submission;
                                      Severity: Minor
                                      Found in src/applications/hca/containers/ConfirmationPage.jsx - About 1 hr to fix

                                        Function labResults has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                        const labResults = avs => {
                                          if (avs.labResults?.length > 0) {
                                            const labResultItems = avs.labResults.map((item, idx) => (
                                              <div key={idx}>
                                                {labResultValues(item.values)}
                                        Severity: Minor
                                        Found in src/applications/avs/components/YourHealthInformation.jsx - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language