department-of-veterans-affairs/vets-website

View on GitHub

Showing 14,709 of 14,709 total issues

File inboxMessages.js has 1256 lines of code (exceeds 250 allowed). Consider refactoring.
Open

const { sub, formatISO } = require('date-fns');
const {
  senderInfo,
  categoryInfo,
  triageGroupNames,
Severity: Major
Found in src/platform/mhv/api/mocks/secure-messaging/messages/inboxMessages.js - About 3 days to fix

    File countryList.js has 1243 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    const countryList = [
      {
        key: 'AFG',
        label: 'Afghanistan',
        value: 'AFG',
    Severity: Major
    Found in src/applications/check-in/utils/appConstants/countryList.js - About 3 days to fix

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

      export const uiSchema = {
        'ui:objectViewField': LoanReviewField,
        relevantPriorLoans: {
          'ui:description': 'Tell us about all your VA-backed loans',
          'ui:options': {
      src/applications/lgy/coe/form/config/chapters/loans/loanHistory.js on lines 96..192

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

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

      export const uiSchema = {
        'ui:objectViewField': LoanReviewField,
        relevantPriorLoans: {
          'ui:description': 'Tell us about all your VA-backed loans',
          'ui:options': {
      src/applications/_mock-form-ae-design-patterns/patterns/pattern2/TaskGray/form/config/chapters/loans/loanHistory.js on lines 96..192

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

      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

      File full-example.js has 1234 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      const all = {
        resourceType: 'Bundle',
        type: 'searchset',
        link: [
          {
      Severity: Major
      Found in src/platform/mhv/api/mocks/medical-records/allergies/full-example.js - About 3 days to fix

        File form.js has 1230 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import React from 'react';
        import { createSelector } from 'reselect';
        
        import fullSchema5490 from 'vets-json-schema/dist/22-5490-schema.json';
        import commonDefinitions from 'vets-json-schema/dist/definitions.json';
        Severity: Major
        Found in src/applications/fry-dea/config/form.js - About 3 days to fix

          File form.js has 1213 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import React from 'react';
          import { createSelector } from 'reselect';
          import { Link } from 'react-router';
          
          import fullSchema1990e from 'vets-json-schema/dist/22-1990E-schema.json';
          Severity: Major
          Found in src/applications/toe/config/form.js - About 3 days to fix

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

              {
                foodJournalId: 16453527,
                oplock: null,
                glassesOfWater: 5,
                createdDate: 1575402827000,
            src/platform/mhv/api/mocks/medical-records/self-entered/seiFoodJournal.js on lines 312..431
            src/platform/mhv/api/mocks/medical-records/self-entered/seiFoodJournal.js on lines 552..671
            src/platform/mhv/api/mocks/medical-records/self-entered/seiFoodJournal.js on lines 792..913

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

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

              {
                foodJournalId: 16956769,
                oplock: null,
                glassesOfWater: 8,
                createdDate: 1585940446000,
            src/platform/mhv/api/mocks/medical-records/self-entered/seiFoodJournal.js on lines 312..431
            src/platform/mhv/api/mocks/medical-records/self-entered/seiFoodJournal.js on lines 672..791
            src/platform/mhv/api/mocks/medical-records/self-entered/seiFoodJournal.js on lines 792..913

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

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

              {
                foodJournalId: 16219172,
                oplock: null,
                glassesOfWater: 8,
                createdDate: 1572983929000,
            src/platform/mhv/api/mocks/medical-records/self-entered/seiFoodJournal.js on lines 312..431
            src/platform/mhv/api/mocks/medical-records/self-entered/seiFoodJournal.js on lines 552..671
            src/platform/mhv/api/mocks/medical-records/self-entered/seiFoodJournal.js on lines 672..791

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

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

              {
                foodJournalId: 17112716,
                oplock: null,
                glassesOfWater: 10,
                createdDate: 1588345105000,
            src/platform/mhv/api/mocks/medical-records/self-entered/seiFoodJournal.js on lines 552..671
            src/platform/mhv/api/mocks/medical-records/self-entered/seiFoodJournal.js on lines 672..791
            src/platform/mhv/api/mocks/medical-records/self-entered/seiFoodJournal.js on lines 792..913

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

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

            export const MobileOfficialGovtWebsite = () => {
              const [expanded, setExpanded] = useState(false);
            
              const onToggle = () => {
                if (expanded) {
            src/applications/accredited-representative-portal/components/common/Header/MobileHeader/MobileOfficialGovtWebsite.jsx on lines 4..94

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

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

            export const MobileOfficialGovtWebsite = () => {
              const [expanded, setExpanded] = useState(false);
            
              const onToggle = () => {
                if (expanded) {
            src/applications/accredited-representative-portal/accreditation/21a/components/common/Header/MobileHeader/MobileOfficialGovtWebsite.jsx on lines 4..94

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

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

            export const getMissingInfo = ({ data, keys, content, requiredKeys = [] }) => {
              const missingInfo = [];
              // If both home & mobile selected, make only one phone required
              const phones = [keys.homePhone, '|', keys.mobilePhone];
              const eitherPhone =
            src/applications/_mock-form-ae-design-patterns/utils/data/task-gray/profile.js on lines 362..403
            src/applications/_mock-form-ae-design-patterns/utils/data/task-purple/profile.js on lines 362..402
            src/platform/forms-system/src/js/utilities/data/profile.js on lines 362..402

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

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

            class IntroductionPage extends React.Component {
              componentDidMount() {
                focusElement('.va-nav-breadcrumbs-list');
              }
            
            
            src/applications/edu-benefits/10215/containers/IntroductionPage.jsx on lines 6..90
            src/applications/edu-benefits/10216/containers/IntroductionPage.jsx on lines 7..91
            src/applications/edu-benefits/1919/containers/IntroductionPage.jsx on lines 7..91

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

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

            export const getMissingInfo = ({ data, keys, content, requiredKeys = [] }) => {
              const missingInfo = [];
              // If both home & mobile selected, make only one phone required
              const phones = [keys.homePhone, '|', keys.mobilePhone];
              const eitherPhone =
            Severity: Major
            Found in src/platform/forms-system/src/js/utilities/data/profile.js and 3 other locations - About 3 days to fix
            src/applications/_mock-form-ae-design-patterns/utils/data/task-blue/profile.js on lines 350..390
            src/applications/_mock-form-ae-design-patterns/utils/data/task-gray/profile.js on lines 362..403
            src/applications/_mock-form-ae-design-patterns/utils/data/task-purple/profile.js on lines 362..402

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

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

            export const getMissingInfo = ({ data, keys, content, requiredKeys = [] }) => {
              const missingInfo = [];
              // If both home & mobile selected, make only one phone required
              const phones = [keys.homePhone, '|', keys.mobilePhone];
              const eitherPhone =
            src/applications/_mock-form-ae-design-patterns/utils/data/task-blue/profile.js on lines 350..390
            src/applications/_mock-form-ae-design-patterns/utils/data/task-purple/profile.js on lines 362..402
            src/platform/forms-system/src/js/utilities/data/profile.js on lines 362..402

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

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

            class IntroductionPage extends React.Component {
              componentDidMount() {
                focusElement('.va-nav-breadcrumbs-list');
              }
            
            
            src/applications/edu-benefits/10216/containers/IntroductionPage.jsx on lines 7..91
            src/applications/edu-benefits/1919/containers/IntroductionPage.jsx on lines 7..91
            src/applications/edu-benefits/8794/containers/IntroductionPage.jsx on lines 7..91

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

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

            class IntroductionPage extends React.Component {
              componentDidMount() {
                focusElement('.va-nav-breadcrumbs-list');
              }
            
            
            src/applications/edu-benefits/10215/containers/IntroductionPage.jsx on lines 6..90
            src/applications/edu-benefits/10216/containers/IntroductionPage.jsx on lines 7..91
            src/applications/edu-benefits/8794/containers/IntroductionPage.jsx on lines 7..91

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

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

            class IntroductionPage extends React.Component {
              componentDidMount() {
                focusElement('.va-nav-breadcrumbs-list');
              }
            
            
            src/applications/edu-benefits/10215/containers/IntroductionPage.jsx on lines 6..90
            src/applications/edu-benefits/1919/containers/IntroductionPage.jsx on lines 7..91
            src/applications/edu-benefits/8794/containers/IntroductionPage.jsx on lines 7..91

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

            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