Showing 3,724 of 12,675 total issues
Function default
has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring. Open
export default function(state = INITIAL_STATE, action) {
switch (action.type) {
case CALCULATOR_INPUTS_CHANGED: {
const { field, value } = action;
let convertedValue = value;
- 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 NearByVetCenters
has 197 lines of code (exceeds 25 allowed). Consider refactoring. Open
const NearByVetCenters = props => {
const [originalCoordinates, setOriginalCoordinates] = useState([]);
const [fetchedVetCenters, setFetchedVetCenters] = useState([]);
const [nearbyVetCenterDistances, setNearbyVetCenterDistances] = useState(
false,
File reducer.js
has 495 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { getDefaultFormState } from '@department-of-veterans-affairs/react-jsonschema-form/lib/utils';
import {
updateSchemasAndData,
updateItemsSchema,
} from 'platform/forms-system/src/js/state/helpers';
File validation.js
has 494 lines of code (exceeds 250 allowed). Consider refactoring. Open
import find from 'lodash/find';
import { Validator } from 'jsonschema';
import get from '../../../utilities/data/get';
import omit from '../../../utilities/data/omit';
import set from '../../../utilities/data/set';
Function ContestableIssues
has 195 lines of code (exceeds 25 allowed). Consider refactoring. Open
const ContestableIssues = props => {
const {
id,
options,
formContext = {},
Function EmploymentRecord
has 195 lines of code (exceeds 25 allowed). Consider refactoring. Open
const EmploymentRecord = props => {
const { data, goToPath, setFormData } = props;
const editIndex = getJobIndex();
Function PrescriptionDetailsDocumentation
has 195 lines of code (exceeds 25 allowed). Consider refactoring. Open
const PrescriptionDetailsDocumentation = () => {
const { prescriptionId } = useParams();
const { search } = useLocation();
const queryParams = new URLSearchParams(search);
const ndcNumber = queryParams.get('ndc');
Function EmploymentRecord
has 194 lines of code (exceeds 25 allowed). Consider refactoring. Open
const EmploymentRecord = props => {
const { data, goToPath, setFormData } = props;
const editIndex = getJobIndex();
Function navigateForward
has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring. Open
export const navigateForward = (
SHORT_NAME,
formResponses,
router,
editMode,
- 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 MessageList
has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring. Open
const MessageList = props => {
const dispatch = useDispatch();
const { folder, messages, keyword, isSearch, sortOrder, page } = props;
const perPage = 10;
const totalEntries = messages?.length;
- 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 index.js
has 489 lines of code (exceeds 250 allowed). Consider refactoring. Open
import appendQuery from 'append-query';
import { fetchAndUpdateSessionExpiration as fetch } from 'platform/utilities/api';
import mbxGeo from '@mapbox/mapbox-sdk/services/geocoding';
import { api } from '../config';
Function render
has 192 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const {
formIds,
profile,
login,
Function schoolSearch
has 192 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function schoolSearch(state = initialState, action) {
switch (action.type) {
case INSTITUTION_SELECTED: {
const {
address1,
Function SpouseEmploymentWorkDates
has 192 lines of code (exceeds 25 allowed). Consider refactoring. Open
const SpouseEmploymentWorkDates = props => {
const { goToPath, setFormData, data } = props;
const RETURN_PATH = '/enhanced-spouse-employment-records';
File constants.js
has 485 lines of code (exceeds 250 allowed). Consider refactoring. Open
import { getAppUrl } from '../utilities/registry-helpers';
export const VA_FORM_IDS = Object.freeze({
FEEDBACK_TOOL: 'FEEDBACK-TOOL',
FORM_0873: '0873',
File SchoolSelectField.jsx
has 485 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from 'react';
import PropTypes from 'prop-types';
import _ from 'lodash';
import classNames from 'classnames';
import {
Function Error
has 190 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Error = () => {
const { t } = useTranslation();
const selectError = useMemo(makeSelectError, []);
const { error } = useSelector(selectError);
Function SpousePayrollDeductionInputList
has 190 lines of code (exceeds 25 allowed). Consider refactoring. Open
const SpousePayrollDeductionInputList = props => {
const { goToPath, goBack, setFormData } = props;
const editIndex = getJobIndex();
Function PrescriptionDetails
has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring. Open
const PrescriptionDetails = () => {
const prescription = useSelector(
state => state.rx.prescriptions?.prescriptionDetails,
);
const prescriptionsApiError = useSelector(
- 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 render
has 189 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { onCTALinkClick } = this;
const {
ehrDataByVhaId,
cernerFacilities,