Showing 4,177 of 14,709 total issues
Function renderResultItems
has 112 lines of code (exceeds 25 allowed). Consider refactoring. Open
const renderResultItems = (searchQuery, apiResults) => {
return apiResults?.map((result, index) => {
let item;
const showHealthConnectNumber = isHealthAndHealthConnect(result, query);
Function guardianInformation
has 112 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function guardianInformation(schema, options) {
// Use the defaults as necessary, but override with the options given
const { fields, required } = {
...defaults(),
...options,
Function getGroupedPreviousEnrollmentsDGIB
has 112 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const getGroupedPreviousEnrollmentsDGIB = enrollment => {
const {
verificationBeginDate,
verificationEndDate,
verificationMethod,
Function prefillTransformerV1
has 112 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function prefillTransformerV1(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 FacilityPatientSatisfactionScoresWidget
has 112 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function FacilityPatientSatisfactionScoresWidget(props) {
if (props.loading || !Object.keys(props.facility).length) {
return (
<va-loading-indicator message="Loading facility patient satisfaction scores..." />
);
Function render
has 112 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const {
deriveResultsEndNumber,
deriveResultsStartNumber,
onPageSelect,
Function render
has 112 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { idSchema, formContext, formData, uiSchema, schema } = this.props;
const id = idSchema.$id;
// wrap matching text in a <span> element
Function Hub
has 112 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const Hub = () => {
const { label, link } = useSignInServiceProvider();
const hasBadAddress = useSelector(hasBadAddressSelector);
useEffect(() => {
Function sharingCardContent
has 112 lines of code (exceeds 25 allowed). Consider refactoring. Open
const sharingCardContent = () => {
if (statusError) {
if (['optin', 'optout'].includes(statusError.type)) {
const optInError = statusError.type === 'optin';
return (
File address.js
has 353 lines of code (exceeds 250 allowed). Consider refactoring. Open
import get from 'platform/utilities/data/get';
import set from 'platform/utilities/data/set';
import unset from 'platform/utilities/data/unset';
import { createSelector } from 'reselect';
File AddressValidationModal.jsx
has 352 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import {
Function render
has 111 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { showWizard } = this.props;
if (showWizard === undefined) return null;
return (
Function ReviewPage
has 111 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function ReviewPage() {
const pageTitle = useSelector(state => getPageTitle(state, pageKey));
const dispatch = useDispatch();
const {
Function content
has 111 lines of code (exceeds 25 allowed). Consider refactoring. Open
const content = () => {
if (labAndTestDetails) {
return (
<>
<PrintHeader />
Function MedicationsList
has 111 lines of code (exceeds 25 allowed). Consider refactoring. Open
const MedicationsList = props => {
const history = useHistory();
const {
isFullList,
rxList,
File index.unit.spec.js
has 351 lines of code (exceeds 250 allowed). Consider refactoring. Open
import sinon from 'sinon';
import { expect } from 'chai';
import { rest } from 'msw';
import { setupServer } from 'msw/node';
Function paginatedThreads
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
const paginatedThreads = (req, res) => {
const { index } = req.params;
const { pageSize, pageNumber, sortField, sortOrder } = req.query;
const sortFunc = (a, b) => {
- 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 validateAddress
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
export const validateAddress = (
route,
method,
fieldName,
inputAddress,
- 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 MissingFileOverview
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
export default function MissingFileOverview({
contentAfterButtons,
data,
goBack,
goForward,
- 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 FileInput
has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring. Open
const FileInput = props => {
const {
attachments,
setAttachments,
setAttachFileSuccess,
- 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"