department-of-veterans-affairs/vets-website

View on GitHub

Showing 12,848 of 12,848 total issues

Function IntroductionPage has 43 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const IntroductionPage = props => {
  const { route, router } = props;

  const startForm = useCallback(
    () => {
Severity: Minor
Found in src/applications/caregivers/containers/IntroductionPage.jsx - About 1 hr to fix

    Function formatAddress has 43 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export function formatAddress(address) {
      /* eslint-disable prefer-template */
      const {
        country,
        postalCode,
    Severity: Minor
    Found in src/applications/ask-va/utils/helpers.js - About 1 hr to fix

      Function confirmationPageNextStepsParagraph has 43 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export const confirmationPageNextStepsParagraph = formData => {
        if (
          hasActiveCompensationITF({ formData }) &&
          hasActivePensionITF({ formData })
        ) {
      Severity: Minor
      Found in src/applications/simple-forms/21-0966/config/helpers.js - About 1 hr to fix

        Function VetTec has 43 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const VetTec = () => {
          useEffect(() => {
            recordEvent({
              event: 'howToWizard-alert-displayed',
              'reason-for-alert': 'help with VET TEC program debt',
        Severity: Minor
        Found in src/applications/financial-status-report/wizard/pages/VetTec.jsx - About 1 hr to fix

          Function LandingPageAuth has 43 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const LandingPageAuth = () => {
            const dispatch = useDispatch();
            const fullState = useSelector(state => state);
            const inbox = useSelector(state => state.sm.folders?.folder);
            const [prefLink, setPrefLink] = useState('');

            Function sendMessage has 43 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export const sendMessage = (message, attachments) => async dispatch => {
              try {
                await createMessage(message, attachments);
                dispatch(
                  addAlert(
            Severity: Minor
            Found in src/applications/mhv-secure-messaging/actions/messages.js - About 1 hr to fix

              Function sortMessages has 43 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  data => {
                    return data.sort((a, b) => {
                      if (
                        [SENT_DATE_DESCENDING.value, DRAFT_DATE_DESCENDING.value].includes(
                          sortOrder,

                Function fetchRequestDetails has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export function fetchRequestDetails(id) {
                  return async (dispatch, getState) => {
                    try {
                      const state = getState();
                      let request = selectAppointmentById(state, id, [
                Severity: Minor
                Found in src/applications/vaos/appointment-list/redux/actions.js - About 1 hr to fix

                  Function updateFacilitySortMethod has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export function updateFacilitySortMethod(sortMethod, uiSchema) {
                    return async (dispatch, getState) => {
                      let location = null;
                      const { facilities } = selectCovid19VaccineNewBooking(getState());
                      const calculatedDistanceFromCurrentLocation = facilities.some(
                  Severity: Minor
                  Found in src/applications/vaos/covid-19-vaccine/redux/actions.js - About 1 hr to fix

                    Function mapStateToProps has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function mapStateToProps(state) {
                      const claimsState = state.disability.status;
                      const claimsV2Root = claimsState.claimsV2; // this is where all the meat is for v2
                    
                      const services = getBackendServices(state);
                    Severity: Minor
                    Found in src/applications/claims-status/containers/YourClaimsPageV2.jsx - About 1 hr to fix

                      Function getPageContent has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        getPageContent() {
                          const { claim } = this.props;
                      
                          // Return null if the claim/ claim.attributes dont exist
                          if (!claimAvailable(claim)) {
                      Severity: Minor
                      Found in src/applications/claims-status/containers/OverviewPage.jsx - About 1 hr to fix

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

                          render() {
                            const { events, missingEvents } = this.props;
                            const { expanded } = this.state;
                            let pastEventsList = [];
                            if (events.length) {
                        Severity: Minor
                        Found in src/applications/claims-status/components/appeals-v2/Timeline.jsx - About 1 hr to fix

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

                            render() {
                              if (isEmpty(this.props.calculated)) {
                                return (
                                  <VaLoadingIndicator
                                    data-testid="loading-indicator"
                          Severity: Minor
                          Found in src/applications/gi/containers/VetTecEstimateYourBenefits.jsx - About 1 hr to fix

                            Function RatingsAbout has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            const RatingsAbout = () => {
                              return (
                                <div className="vads-u-padding-top--4 about-ratings">
                                  <div className="mobile-lg:vads-u-font-size--h3 vads-u-padding-bottom--1p5 vads-u-font-weight--bold vads-u-font-family--serif small-screen-font">
                                    About ratings

                              Function CollapsibleList has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              const CollapsibleList = () => {
                                return (
                                  <div id="SupportingFiles-collapsiblePanel">
                                    <div className="input-section">
                                      <div

                                Function ViewDependentsList has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                function ViewDependentsList(props) {
                                  let mainContent;
                                  const manageDependentsToggle = props?.manageDependentsToggle ?? null;
                                  if (props.loading) {
                                    mainContent = (

                                  Function generateRows has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  const generateRows = signInServiceName => {
                                    const { link, label: buttonText } =
                                      SERVICE_PROVIDERS[signInServiceName] || {};
                                    return [
                                      {

                                    Similar blocks of code found in 10 locations. Consider refactoring.
                                    Open

                                          <va-accordion-item header="Auto allowance">
                                            <ul>
                                              <li>
                                                Application for Automobile or Other Conveyance and Adaptive
                                                Equipment (VA Form 21-4502)
                                    src/applications/simple-forms/21-0972/containers/ConfirmationPage.jsx on lines 28..39
                                    src/applications/simple-forms/21-0972/containers/ConfirmationPage.jsx on lines 78..89
                                    src/applications/simple-forms/21-0972/containers/ConfirmationPage.jsx on lines 90..101
                                    src/applications/simple-forms/21-0972/containers/ConfirmationPage.jsx on lines 102..113
                                    src/applications/simple-forms/21-0972/containers/ConfirmationPage.jsx on lines 114..125
                                    src/applications/simple-forms/21-0972/containers/ConfirmationPage.jsx on lines 126..136
                                    src/applications/simple-forms/21-0972/containers/ConfirmationPage.jsx on lines 137..148
                                    src/applications/simple-forms/21-0972/containers/ConfirmationPage.jsx on lines 238..248
                                    src/applications/simple-forms/21-0972/containers/ConfirmationPage.jsx on lines 249..260

                                    Duplicated Code

                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                    Tuning

                                    This issue has a mass of 69.

                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                    Refactorings

                                    Further Reading

                                    Similar blocks of code found in 10 locations. Consider refactoring.
                                    Open

                                          <va-accordion-item header="School-age children (ages 18 to 23 and in school)">
                                            <ul>
                                              <li>
                                                Request for Approval of School Attendance (VA Form 21-674)
                                                <br />
                                    src/applications/simple-forms/21-0972/containers/ConfirmationPage.jsx on lines 28..39
                                    src/applications/simple-forms/21-0972/containers/ConfirmationPage.jsx on lines 66..77
                                    src/applications/simple-forms/21-0972/containers/ConfirmationPage.jsx on lines 78..89
                                    src/applications/simple-forms/21-0972/containers/ConfirmationPage.jsx on lines 90..101
                                    src/applications/simple-forms/21-0972/containers/ConfirmationPage.jsx on lines 102..113
                                    src/applications/simple-forms/21-0972/containers/ConfirmationPage.jsx on lines 114..125
                                    src/applications/simple-forms/21-0972/containers/ConfirmationPage.jsx on lines 126..136
                                    src/applications/simple-forms/21-0972/containers/ConfirmationPage.jsx on lines 137..148
                                    src/applications/simple-forms/21-0972/containers/ConfirmationPage.jsx on lines 249..260

                                    Duplicated Code

                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                    Tuning

                                    This issue has a mass of 69.

                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                    Refactorings

                                    Further Reading

                                    Similar blocks of code found in 10 locations. Consider refactoring.
                                    Open

                                          <va-accordion-item header="Accrued benefits">
                                            <ul>
                                              <li>
                                                Application for Accrued Amounts Due a Deceased Beneficiary (VA Form
                                                21P-601)
                                    src/applications/simple-forms/21-0972/containers/ConfirmationPage.jsx on lines 66..77
                                    src/applications/simple-forms/21-0972/containers/ConfirmationPage.jsx on lines 78..89
                                    src/applications/simple-forms/21-0972/containers/ConfirmationPage.jsx on lines 90..101
                                    src/applications/simple-forms/21-0972/containers/ConfirmationPage.jsx on lines 102..113
                                    src/applications/simple-forms/21-0972/containers/ConfirmationPage.jsx on lines 114..125
                                    src/applications/simple-forms/21-0972/containers/ConfirmationPage.jsx on lines 126..136
                                    src/applications/simple-forms/21-0972/containers/ConfirmationPage.jsx on lines 137..148
                                    src/applications/simple-forms/21-0972/containers/ConfirmationPage.jsx on lines 238..248
                                    src/applications/simple-forms/21-0972/containers/ConfirmationPage.jsx on lines 249..260

                                    Duplicated Code

                                    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                    Tuning

                                    This issue has a mass of 69.

                                    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                    Refactorings

                                    Further Reading

                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language