Showing 3,724 of 12,675 total issues
File ArrayField.jsx
has 341 lines of code (exceeds 250 allowed). Consider refactoring. Open
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
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 EvidenceSummaryLists.jsx
has 341 lines of code (exceeds 250 allowed). Consider refactoring. Open
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
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
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
Open
render() {
const {
currentDropdown,
currentSection,
data,
Function FormNav
has 104 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function FormNav(props) {
const {
formConfig = {},
currentPath,
formData,
Function IntroductionPage
has 104 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const IntroductionPage = props => {
useEffect(() => {
focusElement('h1');
scrollTo('topContentElement');
}, []);
Function BurialAllowance
has 104 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function BurialAllowance(props) {
const { values } = useFormikContext();
const getBurialAllowanceRequestedOptions = () => {
const allowanceTypes = [
Function YourTreatmentPlan
has 104 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const YourTreatmentPlan = props => {
const { avs } = props;
const { medChangesSummary, orders } = avs;
const medChanges =
Function useDirectDeposit
has 104 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const useDirectDeposit = () => {
const dispatch = useDispatch();
const [formData, setFormData] = useState({});
Function ManageDependents
has 104 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const ManageDependents = props => {
const {
relationship,
updateFormData,
cleanupFormData,
File profile.js
has 339 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React from 'react';
import PropTypes from 'prop-types';
import {
isValidEmail,
File profile.js
has 339 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React from 'react';
import PropTypes from 'prop-types';
import {
isValidEmail,
Function useGetSearchResults
has 103 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function useGetSearchResults(articles, query, page) {
const [results, setResults] = useState([]);
// Refresh the results list when the query is submitted or the page is changed.
useEffect(
Function PreSubmitNotice
has 103 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const PreSubmitNotice = props => {
const { preSubmitInfo, showError, onSectionComplete, submission } = props;
const { field, required } = preSubmitInfo;
const [accepted, setAccepted] = useState(false);
Function AppointmentListInfoBlock
has 103 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const AppointmentListInfoBlock = () => {
const { t } = useTranslation();
const [privacyActModalOpen, setPrivacyActModalOpen] = useState(false);
const getModalUrl = modalState => {
Function updateSchema
has 103 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const updateSchema = () => {
if (addressFormData) {
// if livesOnMilitaryBase is checked
if (addressFormData?.['view:livesOnMilitaryBase']) {
const filteredRequiredArray = addressFormRequiredData.filter(
Function getMissingInfo
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
Open
export const getMissingInfo = ({ data, keys, content, requiredKeys = [] }) => {
const missingInfo = [];
// If both home & mobile selected, make only one phone required
const phones = [keys.homePhone, '|', keys.mobilePhone];
const eitherPhone =
- 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 EvidenceSummary
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
Open
const EvidenceSummary = ({
data,
goBack,
goForward,
setFormData,
- 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"