Showing 4,177 of 14,709 total issues
Function AvailableDebtsAndCopays
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
const AvailableDebtsAndCopays = ({ formContext }) => {
const {
debts,
statements,
pending,
- 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 HighestRankAutoSuggest
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
function HighestRankAutoSuggest({ formData, formContext, idSchema, uiSchema }) {
const dispatch = useDispatch();
const [branchOfService, setBranchOfService] = useState('');
const [rankOptions, setRankOptions] = useState([]);
const [rank, setRank] = useState('');
- 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 SelectAccreditedRepresentative
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
const SelectAccreditedRepresentative = props => {
const {
loggedIn,
setFormData,
formData,
- 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 ConfirmationPage
has 106 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function ConfirmationPage(props) {
const { form } = props;
const { submission, data } = form;
const submitDate = new Date(submission?.timestamp);
Function InsurancePolicyInformation
has 106 lines of code (exceeds 25 allowed). Consider refactoring. Open
const InsurancePolicyInformation = props => {
const { data, goToPath, setFormData } = props;
const { providers = [] } = data;
const search = new URLSearchParams(window.location.search);
Function InsurancePolicyInformation
has 106 lines of code (exceeds 25 allowed). Consider refactoring. Open
const InsurancePolicyInformation = props => {
const { data, goToPath, setFormData } = props;
const { providers = [] } = data;
const search = new URLSearchParams(window.location.search);
Function ReloadWrapper
has 106 lines of code (exceeds 25 allowed). Consider refactoring. Open
const ReloadWrapper = props => {
const { children, router, app, reloadUpcoming = false } = props;
const location = window.location.pathname;
const { t } = useTranslation();
const dispatch = useDispatch();
Function createFormConfig781
has 106 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function createFormConfig781(iterations) {
let configObj = {};
const formType = '781';
for (let index = 0; index < iterations; index++) {
configObj = {
File component-library-analytics-setup.js
has 343 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* eslint-disable camelcase */
/**
* Attaches CustomEvent 'component-library-analytics' listener to document.body
* to translate component library actions into analytics dataLayer events.
*/
File schemas.js
has 343 lines of code (exceeds 250 allowed). Consider refactoring. Open
import constants from 'vets-json-schema/dist/constants.json';
import currentOrPastDateUI from 'platform/forms-system/src/js/definitions/currentOrPastDate';
import addressUiSchema from 'platform/forms-system/src/js/definitions/profileAddress';
const validateAtLeastOneSelected = (errors, fieldData, formData) => {
File seiConstants.js
has 342 lines of code (exceeds 250 allowed). Consider refactoring. Open
/** from BloodSugarTestingMethodEnumeration.java */
export const VITALS_BLOOD_SUGAR_METHOD = {
CLT: 'Clinical Lab Test',
SL: 'Sterile Lancet',
T: 'Transcutaneous',
Function Approved
has 105 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function Approved(name) {
return (
<>
<div>
<va-alert
Function MessageListItem
has 105 lines of code (exceeds 25 allowed). Consider refactoring. Open
const MessageListItem = props => {
const location = useLocation();
const {
senderName,
sentDate,
File ArrayField.jsx
has 341 lines of code (exceeds 250 allowed). Consider refactoring. Open
import PropTypes from 'prop-types';
import React from 'react';
import Scroll from 'react-scroll';
import {
getDefaultFormState,
File EvidenceSummaryLists.jsx
has 341 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from 'react';
import { Link } from 'react-router';
import PropTypes from 'prop-types';
import readableList from 'platform/forms-system/src/js/utilities/data/readableList';
File submit.js
has 341 lines of code (exceeds 250 allowed). Consider refactoring. Open
import _ from 'platform/utilities/data';
import {
PTSD_INCIDENT_ITERATION,
PTSD_CHANGE_LABELS,
ATTACHMENT_KEYS,
File ArrayField.jsx
has 341 lines of code (exceeds 250 allowed). Consider refactoring. Open
import get from '@department-of-veterans-affairs/platform-forms-system/get';
import set from '@department-of-veterans-affairs/platform-forms-system/set';
import {
getDefaultFormState,
toIdSchema,
Function render
has 104 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const {
currentDropdown,
currentSection,
data,
Function FormNav
has 104 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function FormNav(props) {
const {
formConfig = {},
currentPath,
formData,
Function fieldEntries
has 104 lines of code (exceeds 25 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];