department-of-veterans-affairs/vets-website

View on GitHub

Showing 12,811 of 12,811 total issues

Function claimsReducer has 69 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export default function claimsReducer(state = initialState, action) {
  switch (action.type) {
    case FETCH_CLAIMS_PENDING:
      return set(state, true, 'claimsLoading');
    case FETCH_CLAIMS_SUCCESS:
Severity: Major
Found in src/applications/personalization/dashboard/reducers/claims.js - About 2 hrs to fix

    Function arrayBuilderYesNoUI has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
    Open

    export const arrayBuilderYesNoUI = (
      arrayBuilderOptions,
      yesNoOptions,
      yesNoOptionsMore,
    ) => {

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function addressUiSchema has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
    Open

    export default function addressUiSchema(
      path = 'address',
      checkBoxTitle = 'I live on a United States military base outside of the U.S.',
      uiRequiredCallback = () => false,
      newSchemaKeys = {},
    Severity: Minor
    Found in src/platform/forms-system/src/js/definitions/profileAddress.js - About 2 hrs to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function createStringifyFormReplacer has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
    Open

    export function createStringifyFormReplacer(options) {
      const replacerFn = (key, value) => {
        if (!options?.allowPartialAddress && isPartialAddress(value)) {
          return undefined;
        }
    Severity: Minor
    Found in src/platform/forms-system/src/js/helpers.js - About 2 hrs to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function getNonArraySchema has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
    Open

    export function getNonArraySchema(schema, uiSchema = {}) {
      if (
        schema.type === 'array' &&
        !get('ui:options.keepInPageOnReview', uiSchema)
      ) {
    Severity: Minor
    Found in src/platform/forms-system/src/js/helpers.js - About 2 hrs to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function Balances has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
    Open

    const Balances = () => {
      // get balances from redux
      const { debtLetters, mcp } = useSelector(
        ({ combinedPortal }) => combinedPortal,
      );

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function validateLogin has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
    Open

    const validateLogin = async (
      lastName,
      dob,
      dobError,
      setLastNameError,
    Severity: Minor
    Found in src/applications/check-in/utils/validateVeteran/index.js - About 2 hrs to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function MoveMessageToFolderBtn has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
    Open

    const MoveMessageToFolderBtn = props => {
      const {
        threadId,
        allFolders,
        isVisible,

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function FilterBox has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
    Open

    const FilterBox = forwardRef((props, ref) => {
      const {
        category,
        setCategory,
        dateRange,
    Severity: Minor
    Found in src/applications/mhv-secure-messaging/components/Search/FilterBox.jsx - About 2 hrs to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function uiSchema has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
    Open

    export function uiSchema(
      label = 'Address',
      useStreet3 = false,
      isRequired = null,
      ignoreRequired = false,
    Severity: Minor
    Found in src/applications/pre-need-integration/definitions/address.js - About 2 hrs to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function SuggestedAddress has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
    Open

    const SuggestedAddress = ({
      formData,
      address,
      handleAddNewClick,
      setAddressToUI,

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function NextStepsPage has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
    Open

    export default function NextStepsPage() {
      const { data: formData } = useSelector(state => state.form);
      const repType =
        formData['view:selectedRepresentative'].attributes?.individualType;
      const address = {
    Severity: Minor
    Found in src/applications/representative-appoint/containers/NextStepsPage.jsx - About 2 hrs to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    Function VaPrescription has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
    Open

    const VaPrescription = prescription => {
      const showRefillContent = useSelector(selectRefillContentFlag);
      const isDisplayingDocumentation = useSelector(
        state =>
          state.featureToggles[

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

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

    const single = (req, res) => {
      const { id } = req.params;
      const response = all.entry.find(item => {
        return +item.resource.id === +id;
      });
    src/platform/mhv/api/mocks/medical-records/allergies/index.js on lines 312..318
    src/platform/mhv/api/mocks/medical-records/health-conditions/index.js on lines 277..283
    src/platform/mhv/api/mocks/medical-records/labs-and-tests/index.js on lines 4375..4381

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

    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

    const single = (req, res) => {
      const { id } = req.params;
      const response = all.entry.find(item => {
        return +item.resource.id === +id;
      });
    src/platform/mhv/api/mocks/medical-records/health-conditions/index.js on lines 277..283
    src/platform/mhv/api/mocks/medical-records/labs-and-tests/index.js on lines 4375..4381
    src/platform/mhv/api/mocks/medical-records/vaccines/index.js on lines 245..251

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

    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

    const single = (req, res) => {
      const { id } = req.params;
      const response = all.entry.find(item => {
        return +item.resource.id === +id;
      });
    src/platform/mhv/api/mocks/medical-records/allergies/index.js on lines 312..318
    src/platform/mhv/api/mocks/medical-records/labs-and-tests/index.js on lines 4375..4381
    src/platform/mhv/api/mocks/medical-records/vaccines/index.js on lines 245..251

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

    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

    const single = (req, res) => {
      const { id } = req.params;
      const response = all.entry.find(item => {
        return +item.resource.id === +id;
      });
    src/platform/mhv/api/mocks/medical-records/allergies/index.js on lines 312..318
    src/platform/mhv/api/mocks/medical-records/health-conditions/index.js on lines 277..283
    src/platform/mhv/api/mocks/medical-records/vaccines/index.js on lines 245..251

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

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

                  <ul>
                    <li>
                      <strong>Refill VA Prescriptions</strong>
                    </li>
                    <li>
    src/applications/combined-debt-portal/medical-copays/components/FinancialHelp.jsx on lines 16..31
    src/applications/financial-status-report/containers/IntroductionPage.jsx on lines 63..78
    src/applications/hca/components/FormPages/FinancialInformation.jsx on lines 28..43
    src/applications/pre-need-integration/components/IntroductionPage.jsx on lines 67..92
    src/applications/pre-need/components/IntroductionPage.jsx on lines 75..97
    src/applications/static-pages/health-care-manage-benefits/refill-track-prescriptions-page/components/UnauthContent/index.js on lines 69..79

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

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

              <ul>
                <li>
                  <strong>Work history for the past 2 years.</strong> You’ll need
                  the employer’s name, start and end dates, and monthly income for
                  each job.
    src/applications/combined-debt-portal/medical-copays/components/FinancialHelp.jsx on lines 16..31
    src/applications/hca/components/FormPages/FinancialInformation.jsx on lines 28..43
    src/applications/pre-need-integration/components/IntroductionPage.jsx on lines 67..92
    src/applications/pre-need/components/IntroductionPage.jsx on lines 75..97
    src/applications/static-pages/health-care-manage-benefits/refill-track-prescriptions-page/components/AuthContent/index.js on lines 146..156
    src/applications/static-pages/health-care-manage-benefits/refill-track-prescriptions-page/components/UnauthContent/index.js on lines 69..79

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

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

            <ul>
              <li>
                <strong>Repayment plan.</strong> This would allow you to repay the
                debt in smaller monthly amounts over time.
              </li>
    src/applications/financial-status-report/containers/IntroductionPage.jsx on lines 63..78
    src/applications/hca/components/FormPages/FinancialInformation.jsx on lines 28..43
    src/applications/pre-need-integration/components/IntroductionPage.jsx on lines 67..92
    src/applications/pre-need/components/IntroductionPage.jsx on lines 75..97
    src/applications/static-pages/health-care-manage-benefits/refill-track-prescriptions-page/components/AuthContent/index.js on lines 146..156
    src/applications/static-pages/health-care-manage-benefits/refill-track-prescriptions-page/components/UnauthContent/index.js on lines 69..79

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

    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