Showing 4,177 of 14,709 total issues
Function TypeOfCarePage
has 121 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function TypeOfCarePage() {
const pageTitle = useSelector(state => getPageTitle(state, pageKey));
const dispatch = useDispatch();
const {
File form.js
has 367 lines of code (exceeds 250 allowed). Consider refactoring. Open
import FormFooter from 'platform/forms/components/FormFooter';
// import CustomPageWrapper from '../components/CustomPageWrapper';
import IntroductionPage from '../containers/IntroductionPage';
import taskList from '../pages/taskList';
File calculator.js
has 367 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { isFinite } from 'lodash';
import camelCaseKeysRecursive from 'camelcase-keys-recursive';
import {
CALCULATOR_INPUTS_CHANGED,
Function generate
has 120 lines of code (exceeds 25 allowed). Consider refactoring. Open
const generate = async data => {
validate(data.details);
const doc = createAccessibleDoc(data, config);
Function ResourcesAndSupportSearchApp
has 120 lines of code (exceeds 25 allowed). Consider refactoring. Open
const ResourcesAndSupportSearchApp = () => {
const [articles, errorMessage] = useArticleData();
const [userInput, setUserInput] = useState('');
const [query, setQuery] = useState('');
const [page, setPage] = useState(1);
Function applicantInformationUpdate
has 120 lines of code (exceeds 25 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),
Function content
has 120 lines of code (exceeds 25 allowed). Consider refactoring. Open
const content = () => {
if (activeAlert && activeAlert.type === ALERT_TYPE_ERROR) {
return (
<>
<h1 className="vads-u-margin-bottom--0p5">Allergy:</h1>
File EvidenceRecords.jsx
has 366 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from 'react';
import PropTypes from 'prop-types';
import { Link } from 'react-router';
import {
Function prefillTransformerV1
has 119 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function prefillTransformerV1(pages, formData, metadata, state) {
const bankInformation = state.data?.bankInformation || {};
const claimant = state.data?.formData?.data?.attributes?.claimant || {};
const serviceData = state.data?.formData?.data?.attributes?.serviceData || [];
const contactInfo = claimant?.contactInfo || {};
Function EmailSignup
has 119 lines of code (exceeds 25 allowed). Consider refactoring. Open
const EmailSignup = () => {
const [inputError, setInputError] = useState(null);
const [email, setEmail] = useState('');
const [headerHasFocused, setHeaderHasFocused] = useState(false);
Function prefillTransformer
has 119 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function prefillTransformer(pages, formData, metadata, state) {
const prefillRatedDisabilities = data => {
const { disabilities } = data;
if (!disabilities) {
Function fieldEntries
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
const fieldEntries = (key, uiSchema, data, schema, schemaFromState, index) => {
if (data === undefined || data === null) return null;
if (key.startsWith('view:') || key.startsWith('ui:')) return null;
let schemaPropertiesKey = schema.properties?.[key];
- 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 render
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
render() {
const {
value: items,
id,
options,
- 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 transformVAOSAppointment
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
export function transformVAOSAppointment(appt) {
const appointmentType = getAppointmentType(appt);
const isCC = appt.kind === 'cc';
const isVideo = appt.kind === 'telehealth';
const isAtlas = !!appt.telehealth?.atlas;
- 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
File ConfirmationPage.jsx
has 364 lines of code (exceeds 250 allowed). Consider refactoring. Open
import moment from 'moment';
import PropTypes from 'prop-types';
import React from 'react';
import { connect } from 'react-redux';
import environment from 'platform/utilities/environment';
File EvidenceRecords.jsx
has 364 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from 'react';
import PropTypes from 'prop-types';
import { Link } from 'react-router';
import {
File ConfirmationPage.jsx
has 364 lines of code (exceeds 250 allowed). Consider refactoring. Open
import moment from 'moment';
import PropTypes from 'prop-types';
import React from 'react';
import { connect } from 'react-redux';
import environment from 'platform/utilities/environment';
Function ConfirmationPage
has 118 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function ConfirmationPage() {
const {
submission: { response },
data: { fullName },
} = useSelector(state => state.form);
Function ConfirmedAppointmentDetailsPage
has 118 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function ConfirmedAppointmentDetailsPage() {
const dispatch = useDispatch();
const { id } = useParams();
const {
appointment,
Function specializedMissionAttributes
has 118 lines of code (exceeds 25 allowed). Consider refactoring. Open
const specializedMissionAttributes = () => {
const options = [
{
name: 'specialMissionHbcu',
dataTestId: 'special-mission-hbcu',