Showing 4,177 of 14,709 total issues
File ProfileInformationEditView.jsx
has 384 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { focusElement } from 'platform/utilities/ui';
File ContactInfo.jsx
has 384 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { useEffect, useState, useRef } from 'react';
import { useSelector } from 'react-redux';
import PropTypes from 'prop-types';
import { Link, withRouter } from 'react-router';
Function render
has 130 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { location } = this.props;
if (!location) {
return null;
Function AppointmentsPage
has 130 lines of code (exceeds 25 allowed). Consider refactoring. Open
const AppointmentsPage = props => {
const { router } = props;
const selectFeatureToggles = useMemo(makeSelectFeatureToggles, []);
const { isUpcomingAppointmentsEnabled } = useSelector(selectFeatureToggles);
const selectApp = useMemo(makeSelectApp, []);
File ProfileInformationEditView.jsx
has 383 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { focusElement } from 'platform/utilities/ui';
File ProfileInformationEditView.jsx
has 383 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { focusElement } from 'platform/utilities/ui';
File ProfileInformationEditView.jsx
has 383 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { focusElement } from 'platform/utilities/ui';
Function FieldTemplate
has 129 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function FieldTemplate(props) {
const {
id,
schema,
help,
Function alertMessage
has 129 lines of code (exceeds 25 allowed). Consider refactoring. Open
const alertMessage = (alertType, appType) => {
switch (alertType) {
case ALERT_TYPES.ALL_ZERO:
return {
alertStatus: 'info',
Function MrBreadcrumbs
has 129 lines of code (exceeds 25 allowed). Consider refactoring. Open
const MrBreadcrumbs = () => {
const dispatch = useDispatch();
const location = useLocation();
const history = useHistory();
const crumbsList = useSelector(state => state.mr.breadcrumbs.crumbsList);
Function createSuccessPayment
has 128 lines of code (exceeds 25 allowed). Consider refactoring. Open
const createSuccessPayment = (hasRecentPayment = false) => {
return {
data: {
id: '',
type: 'bgs_va_payment_history_response',
File form-submit-transform.js
has 379 lines of code (exceeds 250 allowed). Consider refactoring. Open
// this constant maps the values on address.js in vets.json schema from VA.gov values to LTS values
// the lts values were found on the LTS database and LTS validates them, so we need to send correct value from here
const countries = [
{ schemaValue: 'USA', ltsValue: 'US', label: 'United States' },
{ schemaValue: 'AFG', ltsValue: 'AF', label: 'Afghanistan' },
File form.js
has 379 lines of code (exceeds 250 allowed). Consider refactoring. Open
import environment from 'platform/utilities/environment';
import footerContent from 'platform/forms/components/FormFooter';
import { externalServices } from 'platform/monitoring/DowntimeNotification';
import { scrollAndFocus } from 'platform/utilities/ui';
File FAQSections.jsx
has 379 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from 'react';
export const FirstFAQSection = () => {
return (
<>
Function focusReview
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
export const focusReview = (name, editing, reviewEditFocusOnHeaders) => {
setTimeout(() => {
const scrollName = `${name}${SCROLL_ELEMENT_SUFFIX}`;
const scrollElement = document.querySelector(`[name="${scrollName}"]`);
- Read upRead up
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 AuthApp
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
export default function AuthApp({ location }) {
useDatadogRum();
const [
{ auth, errorCode, returnUrl, loginType, state, requestId },
- Read upRead up
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 AppointmentMessage
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
const AppointmentMessage = props => {
const { appointment, page } = props;
const { t } = useTranslation();
const defaultMessage = t(
- Read upRead up
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 prefillTransformer
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
export default function prefillTransformer(pages, formData, metadata, state) {
const prefillRatedDisabilities = data => {
const { disabilities } = data;
if (!disabilities) {
- Read upRead up
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 CreditCardBill
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
const CreditCardBill = props => {
const { data, goToPath, setFormData } = props;
const { expenses } = data;
const { creditCardBills = [] } = expenses;
- Read upRead up
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 covid19VaccineReducer
has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring. Open
export default function covid19VaccineReducer(state = initialState, action) {
switch (action.type) {
case FORM_PAGE_OPENED: {
const { newBooking } = state;
const { data, schema } = setupFormData(
- Read upRead up
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"