department-of-veterans-affairs/vets-website

View on GitHub

Showing 12,761 of 12,761 total issues

Function validateSearchTermSubmit has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const validateSearchTermSubmit = (
  searchTerm,
  dispatchError,
  error,
  filters,
Severity: Minor
Found in src/applications/gi/utils/helpers.js - About 1 hr to fix

    Function addMapMarker has 29 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      const addMapMarker = (institution, index, locationBounds, mapMarkers) => {
        const { latitude, longitude, name } = institution;
        const lngLat = new mapboxgl.LngLat(longitude, latitude);
    
        const markerElement = document.createElement('div');
    Severity: Minor
    Found in src/applications/gi/containers/search/LocationSearchResults.jsx - About 1 hr to fix

      Function constructor has 29 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        constructor(props) {
          super(props);
      
          // Throw an error if there’s no viewField (should be React component)
          if (!isReactComponent(this.props.uiSchema['ui:options'].viewField)) {

        Function fileUploadUi has 29 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export function fileUploadUi(content) {
          return {
            ...fileUiSchema(content.label, {
              buttonText: 'Upload file',
              addAnotherLabel: 'Upload another file',
        Severity: Minor
        Found in src/applications/pre-need-integration/utils/upload.js - About 1 hr to fix

          Function prepareAddressData has 29 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export const prepareAddressData = formData => {
            let addressData = {
              veteranName: formData.fullName,
              addressLine1: formData.addressLine1,
              addressLine2: formData.addressLine2,

            Function validateAddress has 29 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function validateAddress(errors, address, formData, currentSchema) {
              // Adds error message for state if it is blank and one of the following countries:
              // USA, Canada
              if (
                countriesWithStateCodes.has(address.country) &&
            Severity: Minor
            Found in src/applications/pre-need-integration/definitions/address.js - About 1 hr to fix

              Function HealthcareError has 29 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                const HealthcareError = () => {
                  // status will be 'warning' if toggle is on
                  const status = useToggleValue(TOGGLE_NAMES.myVaUpdateErrorsWarnings)
                    ? 'warning'
                    : 'error';

                Function idcard has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function idcard(state = initialState, action) {
                  switch (action.type) {
                    case ATTRS_FETCHING:
                      return {
                        ...state,
                Severity: Minor
                Found in src/applications/veteran-id-card/reducers/idcard.js - About 1 hr to fix

                  Function ContactInfoNeeded has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export const ContactInfoNeeded = () => {
                    const email = useSelector(state =>
                      selectVAPContactInfoField(state, FIELD_NAMES.EMAIL),
                    );
                    const mailingAddress = useSelector(state =>

                    Function mapStateToProps has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export const mapStateToProps = state => {
                      const mailingFieldName = VAP_SERVICE.FIELD_NAMES.MAILING_ADDRESS;
                    
                      const {
                        apiRoute,

                      Function EditConfirmCancelModal has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export const EditConfirmCancelModal = props => {
                        const { activeSection, onHide, isVisible } = props;
                      
                        const { onCancel } = useContext(EditContext);
                      
                      

                        Function sharingReducer has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export const sharingReducer = (state = initialState, action) => {
                          switch (action.type) {
                            case Actions.Sharing.STATUS: {
                              const { consentStatus } = action.response;
                              return {
                        Severity: Minor
                        Found in src/applications/mhv-medical-records/reducers/sharing.js - About 1 hr to fix

                          Function generateTxt has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              async () => {
                                setDownloadStarted(true);
                                setDownloadType('txt');
                                setBlueButtonRequested(true);
                                dispatch(clearAlerts());

                            Function failedMsg has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              const failedMsg = () => {
                                return (
                                  <va-alert
                                    status="warning"
                                    visible

                              Function getRecordType has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              const getRecordType = record => {
                                if (record.resourceType === fhirResourceTypes.DIAGNOSTIC_REPORT) {
                                  if (record.code?.text === 'CH') return labTypes.CHEM_HEM;
                                  if (
                                    record.code?.coding?.some(
                              Severity: Minor
                              Found in src/applications/mhv-medical-records/reducers/labsAndTests.js - About 1 hr to fix

                                Function benefitEndDateExplanation has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                export function benefitEndDateExplanation(condition, delimitingDate) {
                                  switch (condition) {
                                    case 'activeDuty':
                                      return (
                                        <div className="section benefit-end-date">
                                Severity: Minor
                                Found in src/applications/post-911-gib-status/utils/helpers.jsx - About 1 hr to fix

                                  Function buildNonVAPrescriptionTXT has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                  export const buildNonVAPrescriptionTXT = prescription => {
                                    return `
                                  ---------------------------------------------------------------------------------
                                  
                                  
                                  
                                  Severity: Minor
                                  Found in src/applications/mhv-medications/util/txtConfigs.js - About 1 hr to fix

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

                                              {
                                                resourceType: 'Organization',
                                                id: 'OrgPerformer-989',
                                                meta: {
                                                  profile: [
                                    src/platform/mhv/api/mocks/medical-records/labs-and-tests/index.js on lines 86..103
                                    src/platform/mhv/api/mocks/medical-records/labs-and-tests/index.js on lines 579..596
                                    src/platform/mhv/api/mocks/medical-records/labs-and-tests/index.js on lines 2221..2238
                                    src/platform/mhv/api/mocks/medical-records/labs-and-tests/index.js on lines 2463..2480
                                    src/platform/mhv/api/mocks/medical-records/labs-and-tests/index.js on lines 2981..2998
                                    src/platform/mhv/api/mocks/medical-records/labs-and-tests/index.js on lines 3242..3259
                                    src/platform/mhv/api/mocks/medical-records/labs-and-tests/index.js on lines 3845..3862
                                    src/platform/mhv/api/mocks/medical-records/labs-and-tests/index.js on lines 4111..4128

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

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

                                              {
                                                resourceType: 'Organization',
                                                id: 'OrgPerformer-989',
                                                meta: {
                                                  profile: [
                                    src/platform/mhv/api/mocks/medical-records/labs-and-tests/index.js on lines 86..103
                                    src/platform/mhv/api/mocks/medical-records/labs-and-tests/index.js on lines 579..596
                                    src/platform/mhv/api/mocks/medical-records/labs-and-tests/index.js on lines 1463..1480
                                    src/platform/mhv/api/mocks/medical-records/labs-and-tests/index.js on lines 2221..2238
                                    src/platform/mhv/api/mocks/medical-records/labs-and-tests/index.js on lines 2463..2480
                                    src/platform/mhv/api/mocks/medical-records/labs-and-tests/index.js on lines 2981..2998
                                    src/platform/mhv/api/mocks/medical-records/labs-and-tests/index.js on lines 3845..3862
                                    src/platform/mhv/api/mocks/medical-records/labs-and-tests/index.js on lines 4111..4128

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

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

                                              {
                                                resourceType: 'Organization',
                                                id: 'OrgPerformer-989',
                                                meta: {
                                                  profile: [
                                    src/platform/mhv/api/mocks/medical-records/labs-and-tests/index.js on lines 86..103
                                    src/platform/mhv/api/mocks/medical-records/labs-and-tests/index.js on lines 579..596
                                    src/platform/mhv/api/mocks/medical-records/labs-and-tests/index.js on lines 1463..1480
                                    src/platform/mhv/api/mocks/medical-records/labs-and-tests/index.js on lines 2221..2238
                                    src/platform/mhv/api/mocks/medical-records/labs-and-tests/index.js on lines 2463..2480
                                    src/platform/mhv/api/mocks/medical-records/labs-and-tests/index.js on lines 3242..3259
                                    src/platform/mhv/api/mocks/medical-records/labs-and-tests/index.js on lines 3845..3862
                                    src/platform/mhv/api/mocks/medical-records/labs-and-tests/index.js on lines 4111..4128

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

                                    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