department-of-veterans-affairs/vets-website

View on GitHub

Showing 4,177 of 14,709 total issues

Function VetCenterInfoSection has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function VetCenterInfoSection(props) {
  const attrs = {
    opStatus: props.vetCenter.fieldOperatingStatusFacility,
    opStatusExtra: props.vetCenter.fieldOperatingStatusMoreInfo,
  };

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

export function FacilityPatientSatisfactionScoresWidget(props) {
  if (props.loading || !Object.keys(props.facility).length) {
    return (
      <va-loading-indicator message="Loading facility patient satisfaction scores..." />
    );

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 6 (exceeds 5 allowed). Consider refactoring.
Open

export const ConfirmationPage = ({
  getClaimStatus,
  claimStatus,
  user,
  userEmail,
Severity: Minor
Found in src/applications/toe/containers/ConfirmationPage.jsx - About 25 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 DuplicateContactInfoModal has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function DuplicateContactInfoModal(props) {
  useEffect(
    () => {
      const allPotentialDuplicates = props?.duplicateEmail?.concat(
        props?.duplicatePhone,
Severity: Minor
Found in src/applications/toe/components/DuplicateContactInfoModal.jsx - About 25 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 6 (exceeds 5 allowed). Consider refactoring.
Open

  render() {
    if (this.state.loading) {
      return <va-loading-indicator message="Loading facilities..." />;
    }

Severity: Minor
Found in src/applications/static-pages/facilities/OtherFacilityListWidget.jsx - About 25 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 TravelReview has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const TravelReview = props => {
  const { router } = props;
  const { t } = useTranslation();
  const selectForm = useMemo(makeSelectForm, []);
  const { data } = useSelector(selectForm);
Severity: Minor
Found in src/applications/check-in/travel-claim/pages/travel-review/index.jsx - About 25 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 deriveEndsAtUnix has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export const deriveEndsAtUnix = (
  startsAtUnix,
  endDateMonth,
  endDateDay,
  endDateYear,
Severity: Minor
Found in src/applications/static-pages/events/helpers/index.js - About 25 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 ActionLink has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const ActionLink = props => {
  const { action, appointmentId, app, startTime } = props;
  const { t } = useTranslation();
  const { getPreCheckinComplete } = useStorage(app);

Severity: Minor
Found in src/applications/check-in/components/ActionLink.jsx - About 25 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 TravelClaimDetails has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export default function TravelClaimDetails() {
  const { id } = useParams();
  const location = useLocation();
  const { claimDetailsProps = null } = location.state ?? {};
  const [claimDetails, setClaimDetails] = useState(claimDetailsProps);
Severity: Minor
Found in src/applications/travel-pay/components/TravelClaimDetails.jsx - About 25 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 updateFormPages has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const updateFormPages = (
  patientDemographicsStatus,
  pages,
  URLS,
  isTravelReimbursementEnabled = false,
Severity: Minor
Found in src/applications/check-in/utils/navigation/index.js - About 25 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 DuplicateContactInfoModal has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function DuplicateContactInfoModal(props) {
  useEffect(
    () => {
      const allPotentialDuplicates = props?.duplicateEmail?.concat(
        props?.duplicatePhone,

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

        (errors, value, formData) => {
          if (formData.burialDate && formData.deathDate) {
            const death = new Date(formData.deathDate);
            const burial = new Date(formData.burialDate);

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 6 (exceeds 5 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;

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

export default function IndividualsInvolvedCard({ formData }) {
  const { name } = formData;
  let displayTitle;
  if (name.first || name.last) {
    displayTitle = `${name.first || ''} ${name.last || ''}`;

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

export const verifyVaFileNumber = () => async dispatch => {
  dispatch({ type: VERIFY_VA_FILE_NUMBER_STARTED, response: true });
  let response = await getVaFileNumber();
  if (response.errors) {
    Sentry.captureMessage('disability-file-number-gate-failed');
Severity: Minor
Found in src/applications/disability-benefits/686c-674/actions/index.js - About 25 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 FileBDDClaim has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const FileBDDClaim = ({ getPageStateFromPageName, setWizardStatus }) => {
  const stateBDD = getPageStateFromPageName('bdd');

  const label = 'File a BDD disability claim online';
  const linkText = 'Learn more about the BDD program';
Severity: Minor
Found in src/applications/disability-benefits/wizard/pages/file-bdd.jsx - About 25 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 validateZipCode has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export const validateZipCode = (zipCode, stateCode, errors) => {
  if (stateCode in MILITARY_BASE_ZIP_REGEX) {
    if (!zipCode.match(MILITARY_BASE_ZIP_REGEX[stateCode])) {
      errors.addError(INVALID_ZIP_ERROR);
      return false;
Severity: Minor
Found in src/applications/disability-benefits/686c-674/config/address-schema.js - About 25 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 FileBDDClaim has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const FileBDDClaim = ({ data = {} }) => {
  const { radDate } = data;

  const differenceBetweenDatesInDays = getDiffInDays(radDate) + 1;

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

export const addServicePeriod = (formData, separationDate, setFormData) => {
  const updateData = newData => {
    window.sessionStorage.removeItem(SAVED_SEPARATION_DATE);
    setFormData({
      ...newData,

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

export const validateSeparationDate = (
  errors,
  dateString,
  _formData,
  _schema,
Severity: Minor
Found in src/applications/disability-benefits/all-claims/validations.js - About 25 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