Showing 3,724 of 12,675 total issues
Function ConfirmationPage
has 118 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function ConfirmationPage() {
const {
submission: { response },
data: { fullName },
} = useSelector(state => state.form);
Function specializedMissionAttributes
has 118 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const specializedMissionAttributes = () => {
const options = [
{
name: 'specialMissionHbcu',
dataTestId: 'special-mission-hbcu',
File constants.js
has 362 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/* eslint-disable camelcase */
/* eslint-disable no-restricted-syntax */
export const PAGE_TITLE = 'GI Bill® CT Redesign Sandbox';
Function IntroductionPage
has 117 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const IntroductionPage = props => {
// focus on element
useEffect(() => {
focusElement('h1');
}, []);
File questions.jsx
has 361 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React from 'react';
export const questions = [
{
id: 'isStaff',
Function validateAddress
has 116 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
) => async dispatch => {
const userEnteredAddress = { ...inputAddress };
dispatch({
type: ADDRESS_VALIDATION_INITIALIZE,
fieldName,
Function IntroductionPage
has 116 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const IntroductionPage = props => {
// Toggle from hearing aid supplies to hearing aid + CPAP supplies.
const {
TOGGLE_NAMES,
useToggleValue,
Function prefillTransformerV2
has 116 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function prefillTransformerV2(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 prefillTransformerV2
has 116 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function prefillTransformerV2(pages, formData, metadata, state) {
const bankInformation = state.data?.bankInformation || {};
const claimant = state.data?.formData?.data?.attributes?.claimant || {};
const contactInfo = claimant?.contactInfo || {};
const sponsors = state.data?.formData?.attributes?.sponsors;
Function IntroductionPage
has 116 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const IntroductionPage = props => {
// Toggle from hearing aid supplies to hearing aid + CPAP supplies.
const {
TOGGLE_NAMES,
useToggleValue,
Function PayrollDeductionChecklist
has 116 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const PayrollDeductionChecklist = props => {
const { goToPath, goBack, setFormData } = props;
const editIndex = getJobIndex();
Function PrintDownload
has 116 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const PrintDownload = props => {
const { downloadPdf, downloadTxt, list, allowTxtDownloads } = props;
const menu = useRef(null);
const [menuOpen, setMenuOpen] = useState(false);
File mockData.js
has 359 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
export const UPDATED_USER_MOCK_DATA = {
'vye::UserInfo': {
remEnt: '2854321', // 28(first 2 numbers) for months .54321 * 30 = res needs to be rounded
certIssueDate: '2019-06-28T00:00:00.000Z',
delDate: '2026-09-03T00:00:00.000Z',
Function determineVenueAddress
has 115 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const determineVenueAddress = (formResponses, noDRB) => {
if (!formResponses) return null;
const boardData = determineBoardObj(formResponses);
Function venueAddress
has 115 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const venueAddress = (formValues, noDRB) => {
if (!formValues) return null;
const boardData = board(formValues);
Function DocumentUploader
has 115 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const DocumentUploader = () => {
const [state, setState] = useState({
documentType: '',
documentDescription: '',
errorMessage: null,
Function transformForSubmit
has 115 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function transformForSubmit(formConfig, form) {
const hasReceivedMedicalTreatment =
form?.data?.['view:hasReceivedMedicalTreatment'];
const transformedData = JSON.parse(
Function SpousePayrollDeductionChecklist
has 115 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const SpousePayrollDeductionChecklist = props => {
const { goToPath, goBack, setFormData } = props;
const editIndex = getJobIndex();
Function RadioWidget
has 115 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function RadioWidget(props) {
const { options, formContext = {}, value, disabled, onChange, id } = props;
const { enumOptions, labels = {} } = options;
const dispatch = useDispatch();
Function ArrayBuilderSummaryPage
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
Open
export default function ArrayBuilderSummaryPage({
arrayPath,
firstItemPagePath,
getText,
hasItemsKey,
- 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"