department-of-veterans-affairs/vets-website

View on GitHub

Showing 3,724 of 12,675 total issues

Function DirectDeposit has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export const DirectDeposit = () => {
  const directDepositHookResult = useDirectDeposit();

  const {
    ui,

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

export const getAllPayments = () => async dispatch => {
  dispatch({ type: PAYMENTS_RECEIVED_STARTED });
  const response = await retrievePayments();
  if (response.errors) {
    const error = response.errors[0];
Severity: Minor
Found in src/applications/personalization/dashboard/actions/payments.js - About 35 mins 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 mapStateToProps has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

const mapStateToProps = state => {
  const { isReady: hasLoadedScheduledDowntime } = state.scheduledDowntime;
  const isLOA3 = isLOA3Selector(state);
  const isLOA1 = isLOA1Selector(state);
  const isVAPatient = isVAPatientSelector(state);
Severity: Minor
Found in src/applications/personalization/dashboard/components/Dashboard.jsx - About 35 mins 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 MilitaryInformationContent has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

const MilitaryInformationContent = ({ militaryInformation, veteranStatus }) => {
  useEffect(() => {
    focusElement('[data-focus-target]');
  }, []);

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

export default function prescriptions(state = initialState, action) {
  switch (action.type) {
    case 'LOADING_ACTIVE':
      return set('active.loading', true, state);

Severity: Minor
Found in src/applications/personalization/dashboard/reducers/prescriptions.js - About 35 mins 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 LabAndTestDetails has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

const LabAndTestDetails = () => {
  const dispatch = useDispatch();
  const labAndTestDetails = useSelector(
    state => state.mr.labsAndTests.labsAndTestsDetails,
  );
Severity: Minor
Found in src/applications/mhv-medical-records/containers/LabAndTestDetails.jsx - About 35 mins 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 ViewDependentsLayout has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function ViewDependentsLayout(props) {
  let mainContent;

  if (props.loading) {
    mainContent = (

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

  renderResults() {
    const { searchGovMaintenance } = this.props;
    const {
      loading,
      errors,
Severity: Minor
Found in src/applications/search/containers/SearchApp.jsx - About 35 mins 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 SearchResult has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

const SearchResult = ({
  representativeName,
  addressLine1,
  addressLine2,
  addressLine3,
Severity: Minor
Found in src/applications/representative-appoint/components/SearchResult.jsx - About 35 mins 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 convertAdmissionAndDischargeDetails has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export const convertAdmissionAndDischargeDetails = record => {
  const summary = getNote(record);

  const admissionDate = getAdmissionDate(record, summary);
  const dischargeDate = getDischargeDate(record, summary);
Severity: Minor
Found in src/applications/mhv-medical-records/reducers/careSummariesAndNotes.js - About 35 mins 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 MedicationsListCard has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

const MedicationsListCard = ({ rx }) => {
  const dispatch = useDispatch();
  const showRefillContent = useSelector(selectRefillContentFlag);
  const latestTrackingStatus = rx?.trackingList?.[0];
  let showRefillRemaining = false;

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

function UserInfoSection({ enrollmentData = {}, showCurrentAsOfAlert }) {
  // Get today’s date to show information current as of
  const todayFormatted = formatDateShort(new Date());
  const percentageBenefit =
    formatPercent(enrollmentData.percentageBenefit) || 'unavailable';
Severity: Minor
Found in src/applications/post-911-gib-status/components/UserInfoSection.jsx - About 35 mins 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

Avoid too many return statements within this function.
Open

        return b.attributes.senderName.localeCompare(a.attributes.senderName);
Severity: Major
Found in src/platform/mhv/api/mocks/secure-messaging/threads/index.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

          return <Down {...this.props} appType={appType} headerLevel={2} />;

      Avoid too many return statements within this function.
      Open

              return b.attributes.recipientName.localeCompare(
                a.attributes.recipientName,
              );
      Severity: Major
      Found in src/platform/mhv/api/mocks/secure-messaging/threads/index.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                return a.attributes.recipientName.localeCompare(
                  b.attributes.recipientName,
                );
        Severity: Major
        Found in src/platform/mhv/api/mocks/secure-messaging/threads/index.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

              return children;

            Avoid too many return statements within this function.
            Open

                return 0;
            Severity: Major
            Found in src/platform/mhv/api/mocks/secure-messaging/threads/index.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                  return content;
              Severity: Major
              Found in src/platform/forms/save-in-progress/SaveInProgressIntro.jsx - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                    return null;
                Severity: Major
                Found in src/platform/forms/save-in-progress/ApplicationStatus.jsx - About 30 mins to fix
                  Severity
                  Category
                  Status
                  Source
                  Language