department-of-veterans-affairs/vets-website

View on GitHub

Showing 3,724 of 12,675 total issues

Function standardizeDateTime has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export const standardizeDateTime = vetCenterHoursArray => {
  const output = [];
  if (
    !vetCenterHoursArray ||
    (vetCenterHoursArray && vetCenterHoursArray.length === 0)
Severity: Minor
Found in src/applications/static-pages/facilities/facilityUtilities.js - About 35 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 7 (exceeds 5 allowed). Consider refactoring.
Open

  render() {
    const {
      appId,
      authenticatedWithSSOe,
      children,
Severity: Minor
Found in src/applications/static-pages/cta-widget/index.js - About 35 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 Avs has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

const Avs = props => {
  useDatadogRum();

  const user = useSelector(selectUser);
  const { avsEnabled, featureTogglesLoading } = useSelector(
Severity: Minor
Found in src/applications/avs/containers/Avs.jsx - About 35 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 GetStarted has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

const GetStarted = ({ route }) => {
  const { isESOverrideEnabled } = useSelector(selectFeatureToggles);
  const { vesRecordFound, hasServerError, hasApplyStatus } = useSelector(
    selectEnrollmentStatus,
  );
Severity: Minor
Found in src/applications/hca/components/IntroductionPage/GetStarted/index.jsx - About 35 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 7 (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/FacilityListWidget.jsx - About 35 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 useTravelPayFlags has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

const useTravelPayFlags = appointment => {
  const [travelPayClaimSent, setTravelPayClaimSent] = useState();
  const selectCurrentContext = useMemo(makeSelectCurrentContext, []);
  const context = useSelector(selectCurrentContext);
  const { token } = context;
Severity: Minor
Found in src/applications/check-in/hooks/useTravelPayFlags.jsx - About 35 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 LinkList has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

const LinkList = ({ router }) => {
  const { jumpToPage, getCurrentPageFromRouter } = useFormRouting(router);
  const page = getCurrentPageFromRouter();
  const { t } = useTranslation();
  const { useToggleValue, TOGGLE_NAMES } = useFeatureToggle();
Severity: Minor
Found in src/applications/check-in/components/LinkList.jsx - About 35 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 getLabelForEditField has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

const getLabelForEditField = (
  field,
  options = { capitalizeFirstLetter: false },
) => {
  let rv = 'phone';
Severity: Minor
Found in src/applications/check-in/utils/appConstants/index.js - About 35 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 UpcomingAppointmentsPage has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

const UpcomingAppointmentsPage = props => {
  const { router } = props;
  const [refresh, setRefresh] = useState(false);
  const selectApp = useMemo(makeSelectApp, []);
  const { app } = useSelector(selectApp);

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

const ConfirmablePage = ({
  header,
  eyebrow = '',
  subtitle,
  helpText,
Severity: Minor
Found in src/applications/check-in/components/pages/ConfirmablePage/index.jsx - About 35 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 ValidateDisplay has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export default function ValidateDisplay({
  header = '',
  subtitle = '',
  validateHandler,
  isLoading,
Severity: Minor
Found in src/applications/check-in/components/pages/validate/ValidateDisplay.jsx - About 35 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 IntroductionLogin has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

function IntroductionLogin({
  isLoggedIn,
  isLOA3,
  isPersonalInfoFetchComplete,
  isPersonalInfoFetchFailed,

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

export const getAllPayments = () => async dispatch => {
  dispatch({ type: PAYMENTS_RECEIVED_STARTED });
  const response = await retrievePayments();
  if (response.errors) {
    const error = response.errors[0];
Severity: Minor
Found in src/applications/disability-benefits/view-payments/actions/index.js - About 35 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 7 (exceeds 5 allowed). Consider refactoring.
Open

  render() {
    const {
      uiSchema,
      errorSchema,
      idSchema,

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

const HomeAcreageValueReview = ({ data, editPage }) => {
  const { homeAcreageValue = '' } = data;
  const error =
    homeAcreageValue !== '' && !isValidCurrency(homeAcreageValue) ? (
      <strong className="usa-input-error-message">{content.error}</strong>
Severity: Minor
Found in src/applications/pensions/components/HomeAcreageValueReview.jsx - About 35 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 transformForSubmit has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export default function transformForSubmit(formConfig, form) {
  const remarksFormData = form.data.remarks;
  const remarksUiSchema =
    formConfig.chapters.additionalInformationChapter.pages.remarks.uiSchema;

Severity: Minor
Found in src/applications/simple-forms/26-4555/config/submit-transformer.js - About 35 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 validateTitle10StartDate has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export const validateTitle10StartDate = (
  errors,
  dateString,
  _formData,
  _schema,
Severity: Minor
Found in src/applications/disability-benefits/all-claims/validations.js - About 35 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 PreSubmitCheckboxGroup has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

const PreSubmitCheckboxGroup = props => {
  const {
    onSectionComplete,
    formData,
    showError,
Severity: Minor
Found in src/applications/caregivers/components/PreSubmitInfo/index.jsx - About 35 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 MobileOfficialGovtWebsite has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

export const MobileOfficialGovtWebsite = () => {
  const [expanded, setExpanded] = useState(false);

  const onToggle = () => {
    if (expanded) {

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

export default function MultiQuestionForm({
  questions,
  defaultOptions,
  customId,
  selectedLanguage,
Severity: Minor
Found in src/applications/coronavirus-screener/components/MultiQuestionForm.jsx - About 35 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