Showing 12,827 of 12,827 total issues
Function SpouseGrossMonthlyIncomeInput
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
const SpouseGrossMonthlyIncomeInput = props => {
const { goToPath, goBack, setFormData } = props;
const editIndex = getJobIndex();
- 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 GrossMonthlyIncomeInput
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
const GrossMonthlyIncomeInput = props => {
const { goToPath, goBack, setFormData } = props;
const editIndex = getJobIndex();
- 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 parseTestFile
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
function parseTestFile(features, code) {
const stack = [];
const ast = parser.parse(code, { sourceType: 'module', plugins: ['jsx'] });
traverse.default(ast, {
enter(path) {
- 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 FilterYourResults
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
export function FilterYourResults({
dispatchFilterChange,
dispatchError,
filters,
modalClose,
- 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
File PreSubmitSection.jsx
has 274 lines of code (exceeds 250 allowed). Consider refactoring. Open
// libs
import React, { useState } from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { withRouter } from 'react-router';
File helpers.js
has 274 lines of code (exceeds 250 allowed). Consider refactoring. Open
import moment from 'moment';
import { addDays, format, isValid } from 'date-fns';
import { toggleValues } from '~/platform/site-wide/feature-toggles/selectors';
import FEATURE_FLAG_NAMES from '~/platform/utilities/feature-toggles/featureFlagNames';
import { deductionCodes } from '../constants/deduction-codes';
File InstitutionProfile.jsx
has 274 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* eslint-disable jsx-a11y/anchor-has-content */
import React from 'react';
import { getScrollOptions } from 'platform/utilities/ui';
import scrollTo from 'platform/utilities/ui/scrollTo';
Function createDirectDepositPage
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function createDirectDepositPage() {
const bankAccountProperties = {
type: 'object',
properties: {
accountType: {
Function IntroductionPage
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function IntroductionPage(props) {
const { route } = props;
const { formConfig, pageList } = route;
const { appType } = formConfig?.customText;
Function libraryFilters
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function libraryFilters(el) {
// Grab our current page from the active pager button.
if (el.srcElement.classList.contains('pager-numbers')) {
activePage = parseInt(el.srcElement.text, 10);
sessionStorage.setItem('pageNum', parseInt(el.srcElement.text, 10));
Function ArrivedAtFacility
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
const ArrivedAtFacility = props => {
const { router } = props;
const { t } = useTranslation();
const dispatch = useDispatch();
const { goToNextPage } = useFormRouting(router);
Function transformTOEForm
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function transformTOEForm(_formConfig, form) {
const formFieldUserFullName = form?.data['view:userFullName']?.userFullName;
const viewComponentUserFullName =
form?.loadedData?.formData['view:userFullName']?.userFullName;
const formFieldDateOfBirth = form?.data?.dateOfBirth;
Function IntroductionPage
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
const IntroductionPage = props => {
const dispatch = useDispatch();
const { hasVaFileNumber, isLoading } = useSelector(
state => state?.vaFileNumber,
);
Function LandingPageUnauth
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
const LandingPageUnauth = () => {
const dispatch = useDispatch();
const handleSignIn = () => {
dispatch(toggleLoginModal(true, 'mhv-sm-landing-page'));
};
Function selectRequestedAppointmentDetails
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function selectRequestedAppointmentDetails(state, id) {
const { appointmentDetailsStatus, facilityData } = state.appointments;
const featureVAOSServiceCCAppointments = selectFeatureVAOSServiceCCAppointments(
state,
);
Function specializedMissionAttributes
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
const specializedMissionAttributes = () => {
const options = [
{
name: 'specialMissionHbcu',
checked: specialMissionHbcu,
Function StemAskVAQuestions
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
function StemAskVAQuestions() {
const handler = {
recordLinkClick: () => {
recordEvent({
event: 'nav-ask-va-questions-link-click',
Function mapRating
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
const mapRating = institution => {
const { type } = institution; // used to identify if the training is OJT
let ratingAverage = false;
let ratingCount = -1;
let institutionRatingIsNotNull = false;
Function validateMilitaryHistory
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const validateMilitaryHistory = (errors, serviceRecords, formData) => {
// Map the highestRank to the corresponding Rank Description from jsonData
const rankMap = jsonData.reduce((map, rank) => {
// eslint-disable-next-line no-param-reassign
map[rank['Rank Code'].toUpperCase()] = rank[
Function mapStateToProps
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
const mapStateToProps = state => {
const togglesLoaded = togglesAreLoaded(state);
const profileToggles = selectProfileToggles(state);
const signInServicesEligibleForDD = new Set([
CSP_IDS.ID_ME,