department-of-veterans-affairs/vets-website

View on GitHub

Showing 3,736 of 12,833 total issues

Function ITFWrapper has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

const ITFWrapper = ({
  // loggedIn,
  benefitType,
  pathname,
  children,
Severity: Minor
Found in src/applications/appeals/testing/sc/containers/ITFWrapper.jsx - About 1 hr 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 PrimaryPhone has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

export const PrimaryPhone = ({
  data,
  goBack,
  goForward,
  onReviewPage,
Severity: Minor
Found in src/applications/appeals/testing/sc/components/PrimaryPhone.jsx - About 1 hr 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 ITFWrapper has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

const ITFWrapper = ({
  loggedIn,
  benefitType,
  pathname,
  children,
Severity: Minor
Found in src/applications/appeals/995/containers/ITFWrapper.jsx - About 1 hr 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 SearchAreaControl has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

const SearchAreaControl = ({
  isMobile,
  isEnabled,
  handleSearchArea,
  query,
Severity: Minor
Found in src/applications/facility-locator/components/SearchAreaControl.jsx - About 1 hr 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 focusIssue has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

export const focusIssue = (_index, root, value) => {
  setTimeout(() => {
    const item = value || window.sessionStorage.getItem(LAST_ISSUE);
    window.sessionStorage.removeItem(LAST_ISSUE);
    const [id, type] = (item || '').toString().split(',');
Severity: Minor
Found in src/applications/appeals/shared/utils/focus.js - About 1 hr 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 FormQuestions has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

const FormQuestions = ({ formValues, updateFormField, router }) => {
  useEffect(
    () => {
      // Helps screen reader read the next question
      const nextEl = formValues.questions.slice()[
Severity: Minor
Found in src/applications/discharge-wizard/components/FormQuestions.jsx - About 1 hr 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 StepOne has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

const StepOne = ({ formValues }) => {
  const questionOneResponse = formValues['4_reason'];
  const specReason = ['1', '2', '4'].indexOf(questionOneResponse) > -1;
  const boardToSubmit = board(formValues);
  /* eslint-disable quote-props */
Severity: Minor
Found in src/applications/discharge-wizard/components/gpSteps/StepOne.jsx - About 1 hr 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 answerReviewLabel has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

export const answerReviewLabel = (key, formValues) => {
  const answer = formValues[key];

  const dischargeMonth =
    monthLabelMap[formValues[SHORT_NAME_MAP.DISCHARGE_MONTH]] || '';
Severity: Minor
Found in src/applications/discharge-wizard/helpers/index.jsx - About 1 hr 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 StepOne has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

const StepOne = ({ formResponses }) => {
  const reason = formResponses[SHORT_NAME_MAP.REASON];
  const specialReason = [
    RESPONSES.REASON_PTSD,
    RESPONSES.REASON_TBI,

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

export default function schoolSearch(state = initialState, action) {
  switch (action.type) {
    case INSTITUTION_SELECTED: {
      const {
        address1,

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

export default function applicantInformationUpdate(schema, options) {
  // Use the defaults as necessary, but override with the options given
  const prefix = options && options.isVeteran ? 'veteran' : 'relative';
  const { fields, required, labels } = {
    ...defaults(prefix),

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

const InsuranceSummary = props => {
  const {
    data,
    goBack,
    goForward,
Severity: Minor
Found in src/applications/ezr/components/FormPages/InsuranceSummary.jsx - About 1 hr 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 RadioWidget has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

export default function RadioWidget(props) {
  const { options, formContext = {}, value, disabled, onChange, id } = props;
  const { enumOptions, labels = {} } = options;

  const onReviewPage = formContext?.onReviewPage || false;
Severity: Minor
Found in src/applications/pre-need/components/PreparerRadioWidget.jsx - About 1 hr 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 SearchControls has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

const SearchControls = props => {
  const {
    currentQuery,
    onChange,
    geolocateUser,

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

const PreviousEnrollmentVerifications = ({ enrollmentData }) => {
  const [userEnrollmentData, setUserEnrollmentData] = useState([]);
  const [pastAndCurrentAwards, setPastAndCurrentAwards] = useState([]);
  const [currentPage, setCurrentPage] = useState(0);
  const [pageCount, setPageCount] = useState(0);

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

const InsuranceSummary = props => {
  const {
    data,
    goBack,
    goForward,

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

const VaMedicalCenter = props => {
  const {
    errorSchema,
    formContext,
    formData,
Severity: Minor
Found in src/applications/hca/components/FormFields/VaMedicalCenter.jsx - About 1 hr 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 adaptWithLangCode has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

const adaptWithLangCode = (
  langCode,
  selector,
  attributesToSet = ['hreflang', 'lang'],
  setContainerAttribute = false,
Severity: Minor
Found in src/applications/static-pages/i18Select/utilities/helpers.js - About 1 hr 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 VyeEnrollmentLoginWidget has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

export function VyeEnrollmentLoginWidget({
  toggleLoginModal,
  user,
  includedInFlipper,
}) {

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

const createRoutesWithStore = () => {
  return (
    <Switch>
      {routes.map((route, i) => {
        const options = { appName: APP_NAMES.CHECK_IN };
Severity: Minor
Found in src/applications/check-in/day-of/routes.jsx - About 1 hr 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