department-of-veterans-affairs/vets-website

View on GitHub

Showing 3,736 of 12,815 total issues

Function IdentityVerificationAlert has 53 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const IdentityVerificationAlert = () => {
  const onVerify = () => recordEvent({ event: AUTH_EVENTS.VERIFY });
  return (
    <va-alert status="continue" data-testid="hca-identity-alert" uswds>
      <h2 slot="headline">

    Function data has 53 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      data: (state = initialState, action) => {
        switch (action.type) {
          case FETCH_PERSONAL_INFORMATION:
            return {
              ...state,

      Function itemsList has 53 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

            items.map((item, index) => {
              const itemIsSelected = !!get(
                selectedPropName || this.defaultSelectedPropName,
                item,
              );

        Function getPtsdClassification has 53 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export const getPtsdClassification = (formData, formType) => {
          const isCombat = _.get(
            'view:selectablePtsdTypes.view:combatPtsdType',
            formData,
            false,

          File DashboardCards.jsx has 255 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import {
            VaPagination,
            VaSelect,
          } from '@department-of-veterans-affairs/component-library/dist/react-bindings';
          import { apiRequest } from '@department-of-veterans-affairs/platform-utilities/api';
          Severity: Minor
          Found in src/applications/ask-va/containers/DashboardCards.jsx - About 2 hrs to fix

            Function DashboardUnreadMessages has 53 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const DashboardUnreadMessages = props => {
              const { inbox } = props;
            
              const { noAssociations, allTriageGroupsBlocked } = useSelector(
                state => state.sm.recipients,

              Function perTermSections has 53 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                const perTermSections = () => {
                  const { perTerm } = outputs;
              
                  const sections = Object.keys(perTerm).map(section => {
                    const {
              Severity: Major
              Found in src/applications/gi/components/profile/EstimatedBenefits.jsx - About 2 hrs to fix

                File index.js has 254 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                const all = {
                  id: '868a0f70-f920-4483-9be4-fa64f65d2e85',
                  meta: {
                    lastUpdated: '2023-07-21T12:22:25.721-04:00',
                  },
                Severity: Minor
                Found in src/platform/mhv/api/mocks/medical-records/vaccines/index.js - About 2 hrs to fix

                  File ResponseInboxPageMock.jsx has 254 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  import {
                    VaAlert,
                    VaButton,
                    VaFileInputMultiple,
                    VaIcon,
                  Severity: Minor
                  Found in src/applications/ask-va/containers/ResponseInboxPageMock.jsx - About 2 hrs to fix

                    Function waitForRenderThenFocus has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                    Open

                    export function waitForRenderThenFocus(
                      selector,
                      root = document,
                      timeInterval = defaultTime,
                      // added because we first need to wait for a component to be rendered, then we
                    Severity: Minor
                    Found in src/platform/utilities/ui/focus.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 ProfileInformationView has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                    Open

                    const ProfileInformationView = props => {
                      const { data, fieldName, title, id } = props;
                    
                      const titleLower = title.toLowerCase();
                    
                    

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

                      componentDidUpdate(prevProps) {
                        const {
                          fieldName,
                          forceEditView,
                          successCallback,

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

                    export const InformalConference = ({
                      data,
                      goBack,
                      goForward,
                      onReviewPage,
                    Severity: Minor
                    Found in src/applications/appeals/996/components/InformalConference.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 ReviewPage has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                    Open

                    const ReviewPage = ({
                      dependentsInput,
                      editMode,
                      pastMode,
                      router,
                    Severity: Minor
                    Found in src/applications/income-limits/containers/ReviewPage.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 getBoardExplanation has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                    Open

                    export const getBoardExplanation = formResponses => {
                      const reason = formResponses[SHORT_NAME_MAP.REASON];
                      const noPrevApp =
                        formResponses[SHORT_NAME_MAP.PREV_APPLICATION] === RESPONSES.NO;
                      const prevAppType = formResponses[SHORT_NAME_MAP.PREV_APPLICATION_TYPE];
                    Severity: Minor
                    Found in src/applications/discharge-wizard/helpers/index.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 componentDidUpdate has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                    Open

                      componentDidUpdate(prevProps) {
                        const {
                          fieldName,
                          forceEditView,
                          successCallback,

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

                    export function prefillTransformerV2(pages, formData, metadata, state) {
                      const bankInformation = state.data?.bankInformation || {};
                      const claimant = state.data?.formData?.data?.attributes?.claimant || {};
                      const contactInfo = claimant?.contactInfo || {};
                      const sponsors = state.data?.formData?.attributes?.sponsors;
                    Severity: Minor
                    Found in src/applications/toe/helpers.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 useFormRouting has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                    Open

                    const useFormRouting = (router = {}) => {
                      const selectForm = useMemo(makeSelectForm, []);
                      const { pages, data } = useSelector(selectForm);
                    
                      const selectApp = useMemo(makeSelectApp, []);
                    Severity: Minor
                    Found in src/applications/check-in/hooks/useFormRouting.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 IntroductionPage has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                    Open

                    const IntroductionPage = props => {
                      const dispatch = useDispatch();
                      const { hasVaFileNumber, isLoading } = useSelector(
                        state => state?.vaFileNumber,
                      );

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

                    export function AdditionalInformation({ title, id, formData }) {
                      return (
                        <>
                          <h2
                            id={id}
                    Severity: Minor
                    Found in src/applications/pensions/components/SectionField.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