department-of-veterans-affairs/vets-website

View on GitHub

Showing 3,724 of 12,675 total issues

Function CustomResolutionOptionReview has 73 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const CustomResolutionOptionReview = props => {
  const formData = useSelector(state => state.form.data);
  const { selectedDebtsAndCopays = [] } = formData;

  const currentDebt = selectedDebtsAndCopays[props.pagePerItemIndex];

    Function fetchConfirmedAppointmentDetails has 73 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export function fetchConfirmedAppointmentDetails(id, type) {
      return async (dispatch, getState) => {
        try {
          const state = getState();
          const featureVAOSServiceVAAppointments = selectFeatureVAOSServiceVAAppointments(
    Severity: Major
    Found in src/applications/vaos/appointment-list/redux/actions.js - About 2 hrs to fix

      Function openFacilityPageV2 has 73 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export function openFacilityPageV2(page, uiSchema, schema) {
        return async (dispatch, getState) => {
          try {
            const initialState = getState();
            const featureFacilitiesServiceV2 = selectFeatureFacilitiesServiceV2(
      Severity: Major
      Found in src/applications/vaos/new-appointment/redux/actions.js - About 2 hrs to fix

        Function getCompareCalculatorState has 73 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export const getCompareCalculatorState = (
          calculator,
          institution,
          constants,
        ) => {
        Severity: Major
        Found in src/applications/gi/selectors/compare.js - About 2 hrs to fix

          Function ConnectedDevicesContainer has 73 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export const ConnectedDevicesContainer = () => {
            const [hasLoaded, setHasLoaded] = useState(false);
            const [connectionAvailable, setConnectionAvailable] = useState(false);
            const [connectedDevices, setConnectedDevices] = useState([]);
            const [successAlert, setSuccessAlert] = useState(false);

            Function onChangeEvent has 73 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              const onChangeEvent = option => {
                // title may be a React component
                const title = options.title?.props?.children || options.title || '';
                // this check isn't ideal since the message may exist and the question
                // may be dynamically toggled between being required or not

              Function removeDependents has 73 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export function removeDependents(state = initialState, action) {
                // schema, uiSchema, and formData are already extracted based on index (stateKey) here.
                if (action.type === FORM_DATA_UPDATED) {
                  const {
                    data: newFormData,

                Function makeUserObject has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export function makeUserObject(options = {}) {
                  const services = options.services || ['vet360'];
                  let claims = {
                    ch33_bank_accounts: true,
                    communication_preferences: true,
                Severity: Major
                Found in src/applications/personalization/common/helpers.js - About 2 hrs to fix

                  Function AllergyListItem has 73 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  const AllergyListItem = props => {
                    const { record } = props;
                  
                    return (
                      <va-card

                    Function generate has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                    Open

                    const generate = async data => {
                      validate(data);
                      const tocPageData = {};
                      const doc = createAccessibleDoc(data, config);
                    
                    
                    Severity: Minor
                    Found in src/platform/pdf/templates/blue_button_report.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 PreSubmitSection has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                    Open

                    export function PreSubmitSection(props) {
                      const {
                        form,
                        preSubmit = {},
                        setPreSubmit,
                    Severity: Minor
                    Found in src/platform/forms/components/review/PreSubmitSection.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 updateSchemaFromUiSchema has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                    Open

                    export function updateSchemaFromUiSchema(
                      schema,
                      uiSchema,
                      formData,
                      index = null,
                    Severity: Minor
                    Found in src/platform/forms-system/src/js/state/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 ReviewFieldTemplate has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                    Open

                    export default function ReviewFieldTemplate(props) {
                      const { children, uiSchema, schema, formContext } = props;
                      const label = uiSchema['ui:title'] || props.label;
                      const description = uiSchema['ui:description'];
                      const textDescription = typeof description === 'string' ? description : null;
                    Severity: Minor
                    Found in src/platform/forms-system/src/js/review/ReviewFieldTemplate.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 AuthApp has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                    Open

                    export default function AuthApp({ location }) {
                      const [
                        { auth, errorCode, returnUrl, loginType, state, requestId },
                        setAuthState,
                      ] = useState({
                    Severity: Minor
                    Found in src/applications/auth/containers/AuthApp.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 ApplicantRelationshipPage has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                    Open

                    export default function ApplicantRelationshipPage({
                      data,
                      genOp,
                      setFormData,
                      goBack,

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

                    export const SearchResultsHeader = props => {
                      const { searchResults, pagination, query } = props;
                      const {
                        inProgress,
                        context,

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

                    const BDDPage = ({ setPageState, state = '' }) => {
                      const [ariaDescribedby, setAriaDescribedby] = useState('');
                      const [isDirty, setIsDirty] = useState(false);
                      const [errorMessage, setErrorMessage] = useState(null);
                    
                    
                    Severity: Minor
                    Found in src/applications/disability-benefits/wizard/pages/bdd.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 ContactInfo has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
                    Open

                    const ContactInfo = ({
                      data,
                      goBack,
                      goForward,
                      onReviewPage,

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

                    const BankruptcyDetails = ({
                      data,
                      goBack,
                      goForward,
                      setFormData,

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

                    const SearchBenefits = ({
                      cumulativeService,
                      dispatchShowModal,
                      eligForPostGiBill,
                      enlistmentService,
                    Severity: Minor
                    Found in src/applications/gi/components/SearchBenefits.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

                    Severity
                    Category
                    Status
                    Source
                    Language