department-of-veterans-affairs/vets-website

View on GitHub

Showing 3,724 of 12,675 total issues

Function sanitizeKramesHtmlStr has 107 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const sanitizeKramesHtmlStr = htmlString => {
  const tempDiv = document.createElement('div');
  tempDiv.innerHTML = htmlString;

  // This section is to address removing <body> and <page> tags
Severity: Major
Found in src/applications/mhv-medications/util/helpers.js - About 4 hrs to fix

    File ResultsPage.jsx has 344 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    import React, { useEffect } from 'react';
    import { connect } from 'react-redux';
    import PropTypes from 'prop-types';
    import { waitForRenderThenFocus } from '@department-of-veterans-affairs/platform-utilities/ui';
    import { CONTACTS } from '@department-of-veterans-affairs/component-library/contacts';
    Severity: Minor
    Found in src/applications/income-limits/containers/ResultsPage.jsx - About 4 hrs to fix

      File communicationPreferences.js has 344 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import recordEvent from '~/platform/monitoring/record-event';
      import { apiRequest } from '~/platform/utilities/api';
      
      import { LOADING_STATES } from '../../common/constants';
      import { RX_TRACKING_SUPPORTING_FACILITIES } from '../constants';

        Function FieldTemplate has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
        Open

        export default function FieldTemplate(props) {
          const {
            id,
            schema,
            help,
        Severity: Minor
        Found in src/platform/forms-system/src/js/components/FieldTemplate.jsx - About 4 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 29 (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/definitions/address.js - About 4 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 AvailableDebtsAndCopays has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
        Open

        const AvailableDebtsAndCopays = ({ formContext }) => {
          const {
            debts,
            statements,
            pending,

        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 ProfilePageHeader has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
        Open

        const ProfilePageHeader = ({
          compare,
          dispatchAddCompareInstitution,
          dispatchRemoveCompareInstitution,
          institution,
        Severity: Minor
        Found in src/applications/gi/containers/ProfilePageHeader.jsx - About 4 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 HighestRankAutoSuggest has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
        Open

        function HighestRankAutoSuggest({ formData, formContext, idSchema, uiSchema }) {
          const dispatch = useDispatch();
          const [branchOfService, setBranchOfService] = useState('');
          const [rankOptions, setRankOptions] = useState([]);
          const [rank, setRank] = useState('');

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

        const InsurancePolicyInformation = props => {
          const { data, goToPath, setFormData } = props;
        
          const { providers = [] } = data;
          const search = new URLSearchParams(window.location.search);

          Function ConfirmationPage has 106 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export function ConfirmationPage(props) {
            const { form } = props;
            const { submission, data } = form;
            const submitDate = new Date(submission?.timestamp);
          
          
          Severity: Major
          Found in src/applications/ivc-champva/10-7959C/containers/ConfirmationPage.jsx - About 4 hrs to fix

            Function InsurancePolicyInformation has 106 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const InsurancePolicyInformation = props => {
              const { data, goToPath, setFormData } = props;
            
              const { providers = [] } = data;
              const search = new URLSearchParams(window.location.search);

              Function ReloadWrapper has 106 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              const ReloadWrapper = props => {
                const { children, router, app, reloadUpcoming = false } = props;
                const location = window.location.pathname;
                const { t } = useTranslation();
                const dispatch = useDispatch();
              Severity: Major
              Found in src/applications/check-in/components/layout/ReloadWrapper.jsx - About 4 hrs to fix

                Function createFormConfig781 has 106 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export function createFormConfig781(iterations) {
                  let configObj = {};
                  const formType = '781';
                  for (let index = 0; index < iterations; index++) {
                    configObj = {
                Severity: Major
                Found in src/applications/disability-benefits/all-claims/config/781/index.js - About 4 hrs to fix

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

                    render() {
                      const { route } = this.props;
                      const { formConfig, pageList } = route;
                  
                      return (

                    Function SelectAccreditedRepresentative has 106 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    const SelectAccreditedRepresentative = props => {
                      const { setFormData, formData, router, routes, location } = props;
                      const [query, setQuery] = useState('');
                      const [loading, setLoading] = useState(false);
                      const [error, setError] = useState(null);

                      File schemas.js has 343 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      import constants from 'vets-json-schema/dist/constants.json';
                      import currentOrPastDateUI from 'platform/forms-system/src/js/definitions/currentOrPastDate';
                      import addressUiSchema from 'platform/forms-system/src/js/definitions/profileAddress';
                      
                      const validateAtLeastOneSelected = (errors, fieldData, formData) => {

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

                        import footerContent from 'platform/forms/components/FormFooter';
                        import environment from '@department-of-veterans-affairs/platform-utilities/environment';
                        import manifest from '../manifest.json';
                        
                        import ITFStatusLoadingIndicatorPage from '../components/ITFStatusLoadingIndicatorPage';
                        Severity: Minor
                        Found in src/applications/simple-forms/21-0966/config/form.js - About 4 hrs to fix

                          Function Approved has 105 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          export function Approved(name) {
                            return (
                              <>
                                <div>
                                  <va-alert
                          Severity: Major
                          Found in src/applications/fry-dea/components/ConfirmationResponses.jsx - About 4 hrs to fix

                            Function MessageListItem has 105 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            const MessageListItem = props => {
                              const location = useLocation();
                              const {
                                senderName,
                                sentDate,

                              Function ReviewApproved has 105 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              export default function ReviewApproved() {
                                const [patientData, setPatientData] = useState({});
                                const [loading, setLoading] = useState(true);
                                const [error, setError] = useState(false);
                              
                              
                              Severity: Major
                              Found in src/applications/vaos/referral-appointments/ReviewApproved.jsx - About 4 hrs to fix
                                Severity
                                Category
                                Status
                                Source
                                Language