Showing 4,231 of 14,884 total issues
Function Vitals
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
const Vitals = () => {
const dispatch = useDispatch();
const history = useHistory();
const location = useLocation();
- 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 generateSelfEnteredData
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
export const generateSelfEnteredData = ({
activityJournal,
allergies,
demographics,
familyHistory,
- 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 Decision
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
const Decision = ({ issues, aoj, ama = true, boardDecision = false }) => {
const allowedIssues = issues
.filter(issue => issue.disposition === 'allowed')
.map((issue, i) => <li key={`allowed-${i}`}>{issue.description}</li>);
const deniedIssues = issues
- 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 generateResultsContent
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
const generateResultsContent = async (doc, parent, data, config) => {
const results = doc.struct('Sect', {
title: 'Results',
});
parent.add(results);
Function createDetailItem
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
const createDetailItem = async (doc, config, x, item) => {
const paragraphOptions = { lineGap: item.lineGap ?? 6 };
let titleText = item.title ?? '';
const content = [];
const monospaceFont = config.text.monospaceFont || config.text.font;
Function summaryPage
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
pageBuilder.summaryPage = pageConfig => {
let requiredOpts = ['title', 'path'];
if (usesYesNo) {
requiredOpts = requiredOpts.concat(['uiSchema', 'schema']);
}
Function render
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const alertContent = (
<div>
<p>
This will remove your {toLower(this.props.title)} across many VA
Function createComments
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function createComments(submissionForm) {
const serviceHistoryIncorrect =
submissionForm['view:serviceHistory']?.serviceHistoryIncorrect;
if (serviceHistoryIncorrect) {
Function NeedHelp
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function NeedHelp() {
const isIntro = window.location.pathname.endsWith('/introduction');
return isIntro ? (
<>
<p>
Function board
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const board = (formValues, noDRB) => {
if (!formValues) return null;
const prevAppType =
['1', '4'].indexOf(formValues['10_prevApplicationType']) > -1;
Function BenefitsSelection
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function BenefitsSelection(props) {
const state = useFormikContext();
return (
<>
Function schema
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function schema(currentSchema, userOptions) {
const options = {
fields: ['serviceBranch', 'dateRange'],
required: [],
...userOptions,
Function createOldSchoolPage
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function createOldSchoolPage(schema) {
const { trainingEndDate, reasonForChange } = schema.properties;
const { school, date } = schema.definitions;
return {
path: 'school-selection/old-school',
Function onDownloadLinkClick
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
export async function onDownloadLinkClick(event, reduxStore) {
// This function purpose is to determine if the PDF is valid on click.
// Once it's done, it passes information to DownloadHandler() which determines what to render.
event.preventDefault();
Function CollapsibleList
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
const CollapsibleList = () => {
return (
<div id="SupportingFiles-collapsiblePanel">
<div className="input-section">
<div
Function onUpdateClicked
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
const onUpdateClicked = async () => {
const addressState = {
...stateAndZip,
state: stateAndZip.stateCode,
};
Function WarningStatus
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
const WarningStatus = () => {
const {
statusCode,
applicationDate,
enrollmentDate,
Function IdentityVerificationForm
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
const IdentityVerificationForm = props => {
const { data, onLogin, onChange, onSubmit } = props;
const {
vesRecordFound,
hasServerError,
Function confirmationPageNextStepsParagraph
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const confirmationPageNextStepsParagraph = formData => {
if (
hasActiveCompensationITF({ formData }) &&
hasActivePensionITF({ formData })
) {
Function prefillTransformer
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
const prefillTransformer = (pages, formData, metadata, state) => {
const { veteran = {} } = formData;
const {
fullName,
ssn,