department-of-veterans-affairs/vets-website

View on GitHub

Showing 4,231 of 14,884 total issues

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

const ConfirmationPage = ({ form, isLoggedIn, route }) => {
  const { useToggleValue, TOGGLE_NAMES } = useFeatureToggle();
  const burialsConfirmationPage = useToggleValue(
    TOGGLE_NAMES.burialConfirmationPage,
  );
Severity: Minor
Found in src/applications/burials-ez/containers/ConfirmationPage.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 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

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

const DependentCount = ({
  data,
  goBack,
  goToPath,
  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 AddAsset has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

const AddAsset = ({ data, goToPath, setFormData }) => {
  const { assets } = data;
  const { otherAssets = [] } = assets;

  // Borrowed from 995 AddIssue

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

export function selectModalityText(appointment, isPendingAppointment = false) {
  const isCommunityCare = selectIsCommunityCare(appointment);
  const isInPerson = selectIsInPerson(appointment);
  const isPhone = selectIsPhone(appointment);
  const isVideoAtlas = selectIsAtlasVideo(appointment);
Severity: Minor
Found in src/applications/vaos/appointment-list/redux/selectors.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 VAFacilityPage has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

function VAFacilityPage({
  address,
  canScheduleAtChosenFacility,
  facilitiesStatus,
  initialData,

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

export function selectAppointmentLocality(
  appointment,
  isPendingAppointment = false,
) {
  const practitioner = selectPractitionerName(appointment);
Severity: Minor
Found in src/applications/vaos/appointment-list/redux/selectors.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 RecentActivity has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

export default function RecentActivity({ claim }) {
  const { TOGGLE_NAMES, useToggleValue } = useFeatureToggle();
  const cst5103UpdateEnabled = useToggleValue(
    TOGGLE_NAMES.cst5103UpdateEnabled,
  );

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

export function SearchPage({
  dispatchChangeSearchTab,
  search,
  preview,
  filters,
Severity: Minor
Found in src/applications/gi/containers/SearchPage.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 CompareDrawer has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

export function CompareDrawer({
  compare,
  dispatchRemoveCompareInstitution,
  displayed,
  alwaysDisplay = false,
Severity: Minor
Found in src/applications/gi/containers/CompareDrawer.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 careSummariesAndNotesReducer has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

export const careSummariesAndNotesReducer = (state = initialState, action) => {
  switch (action.type) {
    case Actions.CareSummariesAndNotes.GET: {
      return {
        ...state,

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

const AllergiesPrintOnly = props => {
  const { allergies } = props;

  const content = () => {
    return (

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

  render() {
    const { renderChildItems } = this;
    const { navItemsLookup } = this.props;

    // Derive the parent-most nav item. This is O(n), which isn't great but I'm assuming there won't be 1000s of side nav items.
Severity: Major
Found in src/platform/site-wide/side-nav/components/SideNav.js - About 2 hrs to fix

    Function renderVerifiedContent has 52 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      const renderVerifiedContent = () => {
        if (shouldVerify()) {
          return (
            <va-loading-indicator set-focus message="Redirecting to verify..." />
          );
    Severity: Major
    Found in src/platform/user/authorization/components/RequiredLoginView.jsx - About 2 hrs to fix

      Function focusReview has 52 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export const focusReview = (name, editing, reviewEditFocusOnHeaders) => {
        setTimeout(() => {
          const scrollName = `${name}${SCROLL_ELEMENT_SUFFIX}`;
          const scrollElement = document.querySelector(`[name="${scrollName}"]`);
      
      
      Severity: Major
      Found in src/platform/forms-system/src/js/utilities/ui/focus-review.js - About 2 hrs to fix

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

        const mapStateToProps = state => {
          const { featureToggles } = state;
          const selectedAddress = state.form?.data['view:currentAddress'];
          const shippingAddress = state.form?.data[selectedAddress];
          const { fullName, vetEmail, order, supplies } = state.form?.data;

          Function combineEnrollmentsWithStartMonthDGIB has 52 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export const combineEnrollmentsWithStartMonthDGIB = enrollmentPeriods => {
            const isArray = Array.isArray(enrollmentPeriods);
          
            const trackDate = [];
            const combineMonths = {};
          Severity: Major
          Found in src/applications/verify-your-enrollment/helpers.jsx - About 2 hrs to fix

            Function EnrollmentVerificationBreadcrumbs has 52 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export default function EnrollmentVerificationBreadcrumbs() {
              const breadcrumbsArray = [
                {
                  href: '/',
                  label: 'Home',

              Function transformForSubmit has 52 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export default function transformForSubmit(formConfig, form) {
                const transformedData = JSON.parse(
                  formsSystemTransformForSubmit(formConfig, form),
                );
              
              
              Severity: Major
              Found in src/applications/ivc-champva/10-7959f-2/config/submitTransformer.js - About 2 hrs to fix
                Severity
                Category
                Status
                Source
                Language