department-of-veterans-affairs/vets-website

View on GitHub
src/applications/pre-need-integration/config/pages/servicePeriodsPages.jsx

Summary

Maintainability
F
5 days
Test Coverage

Function servicePeriodInformationPage has 302 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function servicePeriodInformationPage(isVet, isPrep) {
  return {
    uiSchema: {
      ...arrayBuilderItemFirstPageTitleUI({
        title: handleTitle(

    File servicePeriodsPages.jsx has 538 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import {
      arrayBuilderItemFirstPageTitleUI,
      arrayBuilderYesNoSchema,
      arrayBuilderYesNoUI,
      titleUI,

      Function handleTitle has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

      function handleTitle(isVet, isPrep, vetTitle, sponsorTitle, prepTitle) {

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

            servicePeriodsNonVeteran: pageBuilder.introPage({
              title: 'Service periods',
              path: 'service-periods-nonveteran',
              uiSchema: introPage.uiSchema,
              schema: introPage.schema,
        src/applications/pre-need-integration/config/pages/servicePeriodsPages.jsx on lines 528..534
        src/applications/pre-need-integration/config/pages/servicePeriodsPages.jsx on lines 535..541

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

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

            servicePeriodInformationPageNonVeteran: pageBuilder.itemPage({
              title: 'Service period',
              path: 'service-periods-nonveteran/:index/service-period',
              uiSchema: servicePeriodInformationPageNonVeteran.uiSchema,
              schema: servicePeriodInformationPageNonVeteran.schema,
        src/applications/pre-need-integration/config/pages/servicePeriodsPages.jsx on lines 521..527
        src/applications/pre-need-integration/config/pages/servicePeriodsPages.jsx on lines 528..534

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

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

            servicePeriodsSummaryNonVeteran: pageBuilder.summaryPage({
              title: 'Sponsor’s service period(s)',
              path: 'service-periods-summary-nonveteran',
              uiSchema: summaryPage.uiSchema,
              schema: summaryPage.schema,
        src/applications/pre-need-integration/config/pages/servicePeriodsPages.jsx on lines 521..527
        src/applications/pre-need-integration/config/pages/servicePeriodsPages.jsx on lines 535..541

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

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

            servicePeriodInformationPageVeteran: pageBuilder.itemPage({
              title: 'Service period',
              path: 'service-periods-veteran/:index/service-period',
              uiSchema: servicePeriodInformationPageVeteran.uiSchema,
              schema: servicePeriodInformationPageVeteran.schema,
        src/applications/pre-need-integration/config/pages/servicePeriodsPages.jsx on lines 467..473
        src/applications/pre-need-integration/config/pages/servicePeriodsPages.jsx on lines 474..480

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

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

            servicePeriodsPreparerNonVeteran: pageBuilder.introPage({
              title: 'Service periods',
              path: 'service-periods-preparer-nonveteran',
              uiSchema: introPage.uiSchema,
              schema: introPage.schema,
        src/applications/pre-need-integration/config/pages/servicePeriodsPages.jsx on lines 555..561
        src/applications/pre-need-integration/config/pages/servicePeriodsPages.jsx on lines 562..568

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

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

            servicePeriodsSummaryPreparerNonVeteran: pageBuilder.summaryPage({
              title: 'Applicant’s service period(s)',
              path: 'service-periods-summary-preparer-nonveteran',
              uiSchema: summaryPage.uiSchema,
              schema: summaryPage.schema,
        src/applications/pre-need-integration/config/pages/servicePeriodsPages.jsx on lines 548..554
        src/applications/pre-need-integration/config/pages/servicePeriodsPages.jsx on lines 562..568

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

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

            servicePeriodInformationPagePreparerNonVeteran: pageBuilder.itemPage({
              title: 'Service period',
              path: 'service-periods-preparer-nonveteran/:index/service-period',
              uiSchema: servicePeriodInformationPagePreparerNonVeteran.uiSchema,
              schema: servicePeriodInformationPagePreparerNonVeteran.schema,
        src/applications/pre-need-integration/config/pages/servicePeriodsPages.jsx on lines 548..554
        src/applications/pre-need-integration/config/pages/servicePeriodsPages.jsx on lines 555..561

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

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

            servicePeriodsVeteran: pageBuilder.introPage({
              title: 'Service periods',
              path: 'service-periods-veteran',
              uiSchema: introPage.uiSchema,
              schema: introPage.schema,
        src/applications/pre-need-integration/config/pages/servicePeriodsPages.jsx on lines 474..480
        src/applications/pre-need-integration/config/pages/servicePeriodsPages.jsx on lines 481..487

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

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

            servicePeriodsSummaryVeteran: pageBuilder.summaryPage({
              title: 'Your service period(s)',
              path: 'service-periods-summary-veteran',
              uiSchema: summaryPage.uiSchema,
              schema: summaryPage.schema,
        src/applications/pre-need-integration/config/pages/servicePeriodsPages.jsx on lines 467..473
        src/applications/pre-need-integration/config/pages/servicePeriodsPages.jsx on lines 481..487

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

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

            servicePeriodInformationPagePreparerVeteran: pageBuilder.itemPage({
              title: 'Service period',
              path: 'service-periods-preparer-veteran/:index/service-period',
              uiSchema: servicePeriodInformationPagePreparerVeteran.uiSchema,
              schema: servicePeriodInformationPagePreparerVeteran.schema,
        src/applications/pre-need-integration/config/pages/servicePeriodsPages.jsx on lines 494..500
        src/applications/pre-need-integration/config/pages/servicePeriodsPages.jsx on lines 501..507

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

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

            servicePeriodsPreparerVeteran: pageBuilder.introPage({
              title: 'Service periods',
              path: 'service-periods-preparer-veteran',
              uiSchema: introPage.uiSchema,
              schema: introPage.schema,
        src/applications/pre-need-integration/config/pages/servicePeriodsPages.jsx on lines 501..507
        src/applications/pre-need-integration/config/pages/servicePeriodsPages.jsx on lines 508..514

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

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

            servicePeriodsSummaryPreparerVeteran: pageBuilder.summaryPage({
              title: 'Applicant’s service period(s)',
              path: 'service-periods-summary-preparer-veteran',
              uiSchema: summaryPage.uiSchema,
              schema: summaryPage.schema,
        src/applications/pre-need-integration/config/pages/servicePeriodsPages.jsx on lines 494..500
        src/applications/pre-need-integration/config/pages/servicePeriodsPages.jsx on lines 508..514

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

        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

                  enumNames: [
                    'Alabama',
                    'Alaska',
                    'Arizona',
                    'Arkansas',
        src/applications/pre-need-integration/config/pages/servicePeriodsPages.jsx on lines 325..380

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

        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

                  enum: [
                    'AL',
                    'AK',
                    'AZ',
                    'AR',
        src/applications/pre-need-integration/config/pages/servicePeriodsPages.jsx on lines 381..436

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

        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

        const summaryPage = {
          uiSchema: {
            'view:hasServicePeriods': arrayBuilderYesNoUI(options),
          },
          schema: {
        src/applications/simple-forms/mock-simple-forms-patterns-v3/pages/treatmentRecords.js on lines 131..142

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

        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

                'ui:options': {
                  labels: {
                    1: 'Honorable',
                    2: 'General',
                    3: 'Entry Level Separation/Uncharacterized',
        src/applications/pre-need/utils/helpers.js on lines 709..719

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

        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

        There are no issues that match your filters.

        Category
        Status