department-of-veterans-affairs/vets-website

View on GitHub

Showing 4,231 of 14,884 total issues

Function ThreadListSort has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

const ThreadListSort = props => {
  const { sortOrder, sortCallback } = props;
  const location = useLocation();
  const [sortOrderValue, setSortOrderValue] = useState(sortOrder);

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

const BlockedTriageGroupAlert = props => {
  const {
    alertStyle,
    parentComponent,
    currentRecipient,

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

export default function UpcomingAppointmentsDetailsPage() {
  const dispatch = useDispatch();
  const { id } = useParams();
  const {
    appointment,

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

const CernerTransitioningFacilityAlert = ({ t5, t30, facilityId }) => {
  const user = useSelector(selectUser);
  const transitioningFacilityId = facilityId;
  const userFacilities = user.profile.facilities;
  const ehrFacilities = useSelector(selectEhrDataByVhaId);

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

export default function VideoLayoutVA({ data: appointment }) {
  const {
    clinicName,
    clinicPhysicalLocation,
    clinicPhone,
Severity: Minor
Found in src/applications/vaos/components/layouts/VideoLayoutVA.jsx - About 45 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 StatusAlert has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

export default function StatusAlert({ appointment, facility }) {
  const dispatch = useDispatch();

  const { search } = useLocation();
  const { root, typeOfCare } = useSelector(getNewAppointmentFlow);
Severity: Minor
Found in src/applications/vaos/components/StatusAlert.jsx - About 45 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 CalendarCell has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

const CalendarCell = ({
  availableSlots,
  currentlySelectedDate,
  date,
  disabled,
Severity: Minor
Found in src/applications/vaos/components/calendar/CalendarCell.jsx - About 45 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 PhoneLayout has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

export default function PhoneLayout({ data: appointment }) {
  const {
    clinicName,
    clinicPhone,
    clinicPhoneExtension,
Severity: Minor
Found in src/applications/vaos/components/layouts/PhoneLayout.jsx - About 45 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 ProviderSortVariant has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

export default function ProviderSortVariant({
  currentlyShownProvidersList,
  notLoading,
}) {
  const dispatch = useDispatch();

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 deeply nested control flow statements.
Open

      if (providerName) data.additionalText = [providerText, signinText];
      else data.additionalText = [signinText];
Severity: Major
Found in src/applications/vaos/services/appointment/index.js - About 45 mins to fix

    Function ReviewPage has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    export default function ReviewPage() {
      const pageTitle = useSelector(state => getPageTitle(state, pageKey));
    
      const dispatch = useDispatch();
      const {
    Severity: Minor
    Found in src/applications/vaos/new-appointment/components/ReviewPage/index.jsx - About 45 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 deeply nested control flow statements.
    Open

        } else if (videoKind === VIDEO_TYPES.gfe) {
          data = {
            summary: 'VA Video Connect appointment using a VA device',
            location: '',
            text: 'Join this video meeting using a device provided by VA.',
    Severity: Major
    Found in src/applications/vaos/services/appointment/index.js - About 45 mins to fix

      Function ClaimStatusHeader has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

      export default function ClaimStatusHeader({ claim }) {
        const { closeDate, status, trackedItems, claimPhaseDates } = claim.attributes;
        const getTrackedItemDates = () => {
          return trackedItems
            ? trackedItems.map(item => getTrackedItemDateFromStatus(item))
      Severity: Minor
      Found in src/applications/claims-status/components/ClaimStatusHeader.jsx - About 45 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 deeply nested control flow statements.
      Open

              if (providerName)
                data.additionalText.push(`You'll be meeting with ${providerName}`);
      Severity: Major
      Found in src/applications/vaos/services/appointment/index.js - About 45 mins to fix

        Function NameSearchForm has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

        export function NameSearchForm({
          autocomplete,
          dispatchFetchNameAutocompleteSuggestions,
          dispatchFetchSearchByNameResults,
          dispatchUpdateAutocompleteName,
        Severity: Minor
        Found in src/applications/gi/containers/search/NameSearchForm.jsx - About 45 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 CheckboxGroup has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

        const CheckboxGroup = ({
          errorMessage,
          label,
          onChange,
          onFocus,
        Severity: Minor
        Found in src/applications/gi/components/CheckboxGroup.jsx - About 45 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 CompareGrid has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

        export function CompareGrid({
          className,
          showDifferences,
          fieldData,
          institutions,
        Severity: Minor
        Found in src/applications/gi/components/CompareGrid.jsx - About 45 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 calculateTuition has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

        function calculateTuition(constant, eligibility, institution, derived) {
          if (derived.oldGiBill) {
            return { qualifier: 'per year', value: 0, ratedQualifier: '/ year' };
          }
          if (institution.type === 'ojt') {
        Severity: Minor
        Found in src/applications/gi/selectors/estimator.js - About 45 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 DevicesToConnectSection has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

        export const DevicesToConnectSection = ({
          connectedDevices,
          connectionAvailable,
          hasLoaded,
        }) => {

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

          render() {
            const {
              uiSchema,
              errorSchema,
              idSchema,
        Severity: Minor
        Found in src/applications/pre-need-integration/components/DeceasedPersons.jsx - About 45 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

        Severity
        Category
        Status
        Source
        Language