department-of-veterans-affairs/vets-website

View on GitHub

Showing 12,811 of 12,811 total issues

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

        <VaTextInput
          currency
          error={error}
          hint={null}
          id="cash"
src/applications/financial-status-report/components/monetary/CashOnHand.jsx on lines 132..146

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

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

    function getNames () {
        var i, out = [];

        for (i in names) {
            if (names.hasOwnProperty(i) && (zones[i] || zones[links[i]]) && names[i]) {
Severity: Major
Found in src/applications/vaos/lib/moment-tz.js and 1 other location - About 3 hrs to fix
src/applications/personalization/dashboard/lib/moment-tz.js on lines 453..468

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

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

              <div id="providerSelectionBlockedLocation">
                <InfoAlert
                  status="warning"
                  headline="Your browser is blocked from finding your current location."
                  className="vads-u-background-color--gold-lightest vads-u-font-size--base"
src/applications/vaos/new-appointment/components/CommunityCareProviderSelectionPage/ProviderSortVariant.jsx on lines 133..160

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

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

        <VaTextInput
          currency
          error={error}
          hint={null}
          id="cash"
src/applications/financial-status-report/components/monetary/CashInBank.jsx on lines 89..103

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

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

export const hasInvalidWorkPhoneNumberError = errors =>
  hasErrorCombos({
    errors,
    errorKeys: [
      LIGHTHOUSE_ERROR_KEYS.UNSPECIFIED_ERROR,
Severity: Major
Found in src/applications/personalization/profile/util/index.js and 1 other location - About 3 hrs to fix
src/applications/personalization/profile/util/index.js on lines 152..171

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

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 Alert = ({ children, title }) => (
  <div className="vads-l-grid-container vads-u-padding-left--0 vads-u-padding-bottom--5">
    <div className="usa-content">
      <h1>{title}</h1>
      <va-alert status="error" uswds>
src/applications/disability-benefits/all-claims/containers/MissingServices.jsx on lines 11..20

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

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

export function updateSchemaFromUiSchema(
  schema,
  uiSchema,
  formData,
  index = null,
Severity: Major
Found in src/platform/forms-system/src/js/state/helpers.js - About 3 hrs to fix

    Function OverviewPage has 76 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const OverviewPage = () => {
      const title = 'Your VA debt and bills';
      useHeaderPageTitle(title);
    
      useEffect(() => {

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

        render() {
          if (
            // Prevent RUM from running on local/CI environments.
            environment.BASE_URL.indexOf('localhost') < 0 &&
            // Prevent re-initializing the SDK.
      Severity: Major
      Found in src/applications/health-care-supply-reordering/containers/App.jsx - About 3 hrs to fix

        Function reasonStatement has 76 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const reasonStatement = formValues => {
          const reason = formValues['4_reason'];
          const dischargeType = formValues['5_dischargeType'];
        
          switch (reason) {

          Function reasonStatement has 76 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            const reasonStatement = () => {
              const reason = formResponses[SHORT_NAME_MAP.REASON];
              const dischargeType = formResponses[SHORT_NAME_MAP.DISCHARGE_TYPE];
          
              switch (reason) {

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

              render() {
                const { route } = this.props;
                const { formConfig, pageList } = route;
            
                return (
            Severity: Major
            Found in src/applications/edu-benefits/10215/containers/IntroductionPage.jsx - About 3 hrs to fix

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

                render() {
                  const { route } = this.props;
                  const { formConfig, pageList } = route;
              
                  return (
              Severity: Major
              Found in src/applications/edu-benefits/8794/containers/IntroductionPage.jsx - About 3 hrs to fix

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

                  render() {
                    const { route } = this.props;
                    const { formConfig, pageList } = route;
                
                    return (
                Severity: Major
                Found in src/applications/edu-benefits/1919/containers/IntroductionPage.jsx - About 3 hrs to fix

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

                    render() {
                      const { route } = this.props;
                      const { formConfig, pageList } = route;
                  
                      return (
                  Severity: Major
                  Found in src/applications/edu-benefits/10216/containers/IntroductionPage.jsx - About 3 hrs to fix

                    Function buildLevelOneLinks has 76 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      const buildLevelOneLinks = (sectionData, index) => {
                        if (sectionData.menuSections) {
                          return (
                            <Fragment key={index}>
                              <li className="vads-u-background-color--primary-dark vads-u-margin--0 vads-u-margin-bottom--0p5 vads-u-width--full vads-u-font-weight--bold">

                      Function ValidateVeteran has 76 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      const ValidateVeteran = props => {
                        const { router } = props;
                        const { t } = useTranslation();
                        const dispatch = useDispatch();
                        const { setPermissions } = useStorage(APP_NAMES.CHECK_IN);
                      Severity: Major
                      Found in src/applications/check-in/day-of/pages/ValidateVeteran.jsx - About 3 hrs to fix

                        Function SignatureCheckbox has 76 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        const SignatureCheckbox = props => {
                          const {
                            children,
                            fullName,
                            isRequired,

                          Function content has 76 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            const content = () => {
                              if (!isLoaded) {
                                return (
                                  <va-loading-indicator
                                    message="Loading your secure message..."
                          Severity: Major
                          Found in src/applications/mhv-secure-messaging/containers/ThreadDetails.jsx - About 3 hrs to fix

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

                              render() {
                                let content;
                            
                                if (this.props.loading) {
                                  content = (
                            Severity: Major
                            Found in src/applications/claims-status/containers/DocumentRequestPage.jsx - About 3 hrs to fix
                              Severity
                              Category
                              Status
                              Source
                              Language