department-of-veterans-affairs/vets-website

View on GitHub

Showing 3,724 of 12,675 total issues

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

export default function VARequestLayout({ data: appointment }) {
  const { search } = useLocation();
  const {
    bookingNotes,
    email,
Severity: Minor
Found in src/applications/vaos/components/layout/VARequestLayout.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

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

export const ChooseDateAndTime = () => {
  const history = useHistory();
  const selectedDates = useSelector(state => getSelectedDate(state));
  const dispatch = useDispatch();
  const startMonth = format(startOfMonth(referral.preferredDate), 'yyyy-MM');
Severity: Minor
Found in src/applications/vaos/referral-appointments/ChooseDateAndTime.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 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 = [providerText, signinText];
          else data.additionalText = [signinText];
    Severity: Major
    Found in src/applications/vaos/services/appointment/index.js - About 45 mins to fix

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

        export const getCompareCalculatorState = (
          calculator,
          institution,
          constants,
        ) => {
        Severity: Minor
        Found in src/applications/gi/selectors/compare.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 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 useDirectDeposit has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

        export const useDirectDeposit = () => {
          const dispatch = useDispatch();
        
          const [formData, setFormData] = useState({});
        
        
        Severity: Minor
        Found in src/applications/personalization/profile/hooks/useDirectDeposit.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 handleAdd has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

          handleAdd() {
            const numberOfItems = this.props.formData.length;
            const lastIndex = numberOfItems - 1;
        
            if (errorSchemaIsValid(this.props.errorSchema[lastIndex])) {
        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

        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

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

        const NavCard = ({
          icon = null,
          iconClasses = 'vads-u-margin-right--1p5',
          introduction,
          title,
        Severity: Minor
        Found in src/applications/mhv-landing-page/components/NavCard.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