department-of-veterans-affairs/vets-website

View on GitHub

Showing 12,848 of 12,848 total issues

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

        <div>
          Requires 2 doses
          <br />
          Plan to return{' '}
          <strong>
src/applications/vaos/covid-19-vaccine/components/SecondDosePage.jsx on lines 51..61

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

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 2 locations. Consider refactoring.
Open

  {
    title: {
      heading: CTRatingsHeaders.m4,
      m4Avg: '0',
    },
Severity: Major
Found in src/applications/gi/constants.js and 1 other location - About 1 hr to fix
src/applications/gi/constants.js on lines 313..330

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

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 2 locations. Consider refactoring.
Open

              <ul className="vads-u-padding-bottom--1">
                <li className="vads-u-margin-bottom--0">
                  We’re not sure when you’ll need to fill this prescription,{' '}
                  <strong>or</strong>
                </li>
src/applications/gi/components/profile/GettingStartedWithBenefits.jsx on lines 75..88

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

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 2 locations. Consider refactoring.
Open

            <p className="vads-u-margin-bottom--2">
              {phase0p5Flag ? (
                <va-link
                  href="/my-health/secure-messages/new-message/"
                  text="Start a new message"
src/applications/mhv-medical-records/containers/LandingPage.jsx on lines 314..329

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

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 2 locations. Consider refactoring.
Open

        <ul className="va-list--disc">
          {failedMeds?.map((item, idx) => (
            <li
              className="vads-u-padding-y--0 vads-u-font-weight--bold"
              data-testid="medication-requested-failed"
src/applications/mhv-medications/components/RefillPrescriptions/RefillNotification.jsx on lines 119..129

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

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 2 locations. Consider refactoring.
Open

    if (
      e.errors &&
      (e.errors[0].code === Constants.Errors.Code.BLOCKED_USER ||
        e.errors[0].code === Constants.Errors.Code.BLOCKED_USER2)
    ) {
Severity: Major
Found in src/applications/mhv-secure-messaging/actions/messages.js and 1 other location - About 1 hr to fix
src/applications/mhv-secure-messaging/actions/messages.js on lines 160..190

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

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

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

const generateResultsContent = async (doc, parent, data, config) => {
  const results = doc.struct('Sect', {
    title: 'Results',
  });
  parent.add(results);
Severity: Minor
Found in src/platform/pdf/templates/medical_records.js - About 1 hr to fix

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

    const createDetailItem = async (doc, config, x, item) => {
      const paragraphOptions = { lineGap: 6 };
      let titleText = item.title ?? '';
      const content = [];
      const monospaceFont = config.text.monospaceFont || config.text.font;
    Severity: Minor
    Found in src/platform/pdf/templates/utils.js - About 1 hr to fix

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

        render() {
          const alertContent = (
            <div>
              <p>
                This will remove your {toLower(this.props.title)} across many VA

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

        export default function NeedHelp() {
          const isIntro = window.location.pathname.endsWith('/introduction');
          return isIntro ? (
            <>
              <p>
        Severity: Minor
        Found in src/applications/appeals/testing/hlr/content/NeedHelp.jsx - About 1 hr to fix

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

          export default function BenefitsSelection(props) {
            const state = useFormikContext();
          
            return (
              <>
          Severity: Minor
          Found in src/applications/burial-poc-v6/pages/BenefitsSelection.jsx - About 1 hr to fix

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

            export const board = (formValues, noDRB) => {
              if (!formValues) return null;
            
              const prevAppType =
                ['1', '4'].indexOf(formValues['10_prevApplicationType']) > -1;
            Severity: Minor
            Found in src/applications/discharge-wizard/helpers/index.jsx - About 1 hr to fix

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

              export default function createOldSchoolPage(schema) {
                const { trainingEndDate, reasonForChange } = schema.properties;
                const { school, date } = schema.definitions;
                return {
                  path: 'school-selection/old-school',
              Severity: Minor
              Found in src/applications/edu-benefits/pages/oldSchool.js - About 1 hr to fix

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

                export function schema(currentSchema, userOptions) {
                  const options = {
                    fields: ['serviceBranch', 'dateRange'],
                    required: [],
                    ...userOptions,
                Severity: Minor
                Found in src/applications/edu-benefits/definitions/toursOfDuty.jsx - About 1 hr to fix

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

                    export async function onDownloadLinkClick(event, reduxStore) {
                      // This function purpose is to determine if the PDF is valid on click.
                      // Once it's done, it passes information to DownloadHandler() which determines what to render.
                      event.preventDefault();
                    
                    

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

                      export default function transformForSubmit(formConfig, form) {
                        const transformedData = JSON.parse(
                          formsSystemTransformForSubmit(formConfig, form),
                        );
                      
                      
                      Severity: Minor
                      Found in src/applications/ivc-champva/10-7959a/config/submitTransformer.js - About 1 hr to fix

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

                          const onUpdateClicked = async () => {
                            const addressState = {
                              ...stateAndZip,
                              state: stateAndZip.stateCode,
                            };

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

                          const WarningStatus = () => {
                            const {
                              statusCode,
                              applicationDate,
                              enrollmentDate,

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

                            const IdentityVerificationForm = props => {
                              const { data, onLogin, onChange, onSubmit } = props;
                              const {
                                vesRecordFound,
                                hasServerError,
                            Severity: Minor
                            Found in src/applications/hca/components/IdentityPage/VerificationForm.jsx - About 1 hr to fix
                              Severity
                              Category
                              Status
                              Source
                              Language