department-of-veterans-affairs/vets-website

View on GitHub

Showing 12,847 of 12,847 total issues

Function prefillTransformer has 49 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function prefillTransformer(pages, formData, metadata, state) {
  const {
    user: {
      profile: {
        vapContactInfo: { residentialAddress, mailingAddress },
Severity: Minor
Found in src/applications/ezr/utils/helpers/prefill-transformer.js - About 1 hr to fix

    Function createDirectDepositChangePage has 49 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export default function createDirectDepositChangePage(schema) {
      const { bankAccountChange, bankAccount } = schema.definitions;
      return {
        title: 'Direct deposit',
        path: 'personal-information/direct-deposit',
    Severity: Minor
    Found in src/applications/edu-benefits/pages/directDepositChange.js - About 1 hr to fix

      Function contactInformation has 49 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        contactInformation: formData => {
          if (_.isEmpty(_.get(formData, 'view:phoneAndEmail.homePhone', {}))) {
            recordEvent({
              event: 'edu-0994--response-missing',
              'missing-field-question':
      Severity: Minor
      Found in src/applications/edu-benefits/0994/analytics-functions.js - About 1 hr to fix

        Function OMBInfo has 49 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const OMBInfo = () => {
          const expDate = '07/31/2027';
          const ombNum = '2900-0091';
          const resBurden = '27';
          return (
        Severity: Minor
        Found in src/applications/ezr/components/IntroductionPage/OMBInfo.jsx - About 1 hr to fix

          Function renderSearchSection has 49 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            const renderSearchSection = () => {
              return (
                <div className="row search-section">
                  <div className="title-section">
                    <h1>Find a VA accredited representative or VSO</h1>
          Severity: Minor
          Found in src/applications/representative-search/containers/SearchPage.jsx - About 1 hr to fix

            Function prefillTransformer has 49 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export function prefillTransformer(pages, formData, metadata, state) {
              const {
                user: {
                  profile: {
                    vapContactInfo: { residentialAddress, mailingAddress },

              Function OMBInfo has 49 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              const OMBInfo = () => {
                const expDate = '07/31/2027';
                const ombNum = '2900-0091';
                const resBurden = '27';
                return (

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

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

                  Function renderConfirmationMessage has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    const renderConfirmationMessage = () => {
                      return (
                        <Wrapper
                          pageTitle={t('youre-checked-in')}
                          testID="multiple-appointments-confirm"

                    Function Demographics has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    const Demographics = props => {
                      const dispatch = useDispatch();
                      const { router } = props;
                      const {
                        goToNextPage,
                    Severity: Minor
                    Found in src/applications/check-in/pre-check-in/pages/Demographics/index.jsx - About 1 hr to fix

                      Function generateFeatureToggles has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      const generateFeatureToggles = (toggles = {}) => {
                        const {
                          checkInExperienceEnabled = true,
                          preCheckInEnabled = true,
                          checkInExperienceTranslationDisclaimerSpanishEnabled = true,

                        Function convertCountryCode has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export default function convertCountryCode(savedData) {
                          const addressPaths = [
                            {
                              path: 'incident0.incidentLocation.country',
                              returnUrl: 'disabilities/ptsd-incident-location-0',

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

                            const updateFormData = e => {
                              e.preventDefault();
                          
                              if (!isValidCurrency(grossMonthlyIncome.value)) {
                                setIncomeError(true);

                            Function sendReply has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

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

                              Function MockAuth has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              export default function MockAuth() {
                                return (
                                  <section className="login">
                                    <va-banner
                                      type="warning"
                              Severity: Minor
                              Found in src/applications/login/containers/MockAuth.jsx - About 1 hr to fix

                                Function createAppealsSuccess has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                const createAppealsSuccess = (updatedDaysAgo = 10) => {
                                  const daysAgo = addDays(new Date(), -updatedDaysAgo);
                                  const formattedDaysAgo = format(daysAgo, 'yyyy-MM-dd');
                                
                                  return {
                                Severity: Minor
                                Found in src/applications/personalization/dashboard/mocks/appeals/index.js - About 1 hr to fix

                                  Function sharingModalContent has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    const sharingModalContent = () => {
                                      const title = `Opt ${
                                        isSharing ? 'out of' : 'back in to'
                                      } sharing your electronic health information?`;
                                      return (
                                  Severity: Minor
                                  Found in src/applications/mhv-medical-records/containers/SettingsPage.jsx - About 1 hr to fix

                                    Identical blocks of code found in 4 locations. Consider refactoring.
                                    Open

                                    export const schema = {
                                      type: 'object',
                                      properties: {
                                        application: {
                                          type: 'object',
                                    src/applications/pre-need-integration/config/pages/applicantMilitaryName.jsx on lines 13..31
                                    src/applications/pre-need-integration/config/pages/sponsorMilitaryName.jsx on lines 13..31
                                    src/applications/pre-need/config/pages/applicantMilitaryName.jsx on lines 11..29

                                    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 74.

                                    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

                                    Identical blocks of code found in 4 locations. Consider refactoring.
                                    Open

                                    export const schema = {
                                      type: 'object',
                                      properties: {
                                        application: {
                                          type: 'object',
                                    src/applications/pre-need-integration/config/pages/applicantMilitaryName.jsx on lines 13..31
                                    src/applications/pre-need-integration/config/pages/sponsorMilitaryName.jsx on lines 13..31
                                    src/applications/pre-need/config/pages/sponsorMilitaryName.jsx on lines 11..29

                                    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 74.

                                    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

                                    Identical blocks of code found in 4 locations. Consider refactoring.
                                    Open

                                    export const schema = {
                                      type: 'object',
                                      properties: {
                                        application: {
                                          type: 'object',
                                    src/applications/pre-need-integration/config/pages/applicantMilitaryName.jsx on lines 13..31
                                    src/applications/pre-need/config/pages/applicantMilitaryName.jsx on lines 11..29
                                    src/applications/pre-need/config/pages/sponsorMilitaryName.jsx on lines 11..29

                                    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 74.

                                    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