Showing 3,724 of 12,675 total issues
Function sanitizeKramesHtmlStr
has 107 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const sanitizeKramesHtmlStr = htmlString => {
const tempDiv = document.createElement('div');
tempDiv.innerHTML = htmlString;
// This section is to address removing <body> and <page> tags
File ResultsPage.jsx
has 344 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { useEffect } from 'react';
import { connect } from 'react-redux';
import PropTypes from 'prop-types';
import { waitForRenderThenFocus } from '@department-of-veterans-affairs/platform-utilities/ui';
import { CONTACTS } from '@department-of-veterans-affairs/component-library/contacts';
File communicationPreferences.js
has 344 lines of code (exceeds 250 allowed). Consider refactoring. Open
import recordEvent from '~/platform/monitoring/record-event';
import { apiRequest } from '~/platform/utilities/api';
import { LOADING_STATES } from '../../common/constants';
import { RX_TRACKING_SUPPORTING_FACILITIES } from '../constants';
Function FieldTemplate
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
export default function FieldTemplate(props) {
const {
id,
schema,
help,
- 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 uiSchema
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
export function uiSchema(
label = 'Address',
useStreet3 = false,
isRequired = null,
ignoreRequired = false,
- 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 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 ProfilePageHeader
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
const ProfilePageHeader = ({
compare,
dispatchAddCompareInstitution,
dispatchRemoveCompareInstitution,
institution,
- 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 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 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 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 = {
Function render
has 106 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { route } = this.props;
const { formConfig, pageList } = route;
return (
Function SelectAccreditedRepresentative
has 106 lines of code (exceeds 25 allowed). Consider refactoring. Open
const SelectAccreditedRepresentative = props => {
const { setFormData, formData, router, routes, location } = props;
const [query, setQuery] = useState('');
const [loading, setLoading] = useState(false);
const [error, setError] = useState(null);
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 form.js
has 342 lines of code (exceeds 250 allowed). Consider refactoring. Open
import footerContent from 'platform/forms/components/FormFooter';
import environment from '@department-of-veterans-affairs/platform-utilities/environment';
import manifest from '../manifest.json';
import ITFStatusLoadingIndicatorPage from '../components/ITFStatusLoadingIndicatorPage';
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,
Function ReviewApproved
has 105 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function ReviewApproved() {
const [patientData, setPatientData] = useState({});
const [loading, setLoading] = useState(true);
const [error, setError] = useState(false);