Showing 3,724 of 12,675 total issues
Function render
has 139 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
const { supplies, order, eligibility } = this.props;
const currentDate = moment();
const accessorySupplies = supplies.filter(
supply => supply.productGroup === ACCESSORY,
Function UpcomingAppointmentsPage
has 139 lines of code (exceeds 25 allowed). Consider refactoring. Open
const UpcomingAppointmentsPage = props => {
const { router } = props;
const [refresh, setRefresh] = useState(false);
const selectApp = useMemo(makeSelectApp, []);
const { app } = useSelector(selectApp);
Function ThreadListItem
has 139 lines of code (exceeds 25 allowed). Consider refactoring. Open
const ThreadListItem = props => {
const location = useLocation();
const { keyword, activeFolder } = props;
const {
senderName,
Function DeleteDraft
has 139 lines of code (exceeds 25 allowed). Consider refactoring. Open
const DeleteDraft = props => {
const history = useHistory();
const location = useLocation();
const dispatch = useDispatch();
const deleteDraftButtonRef = useRef();
Function submitFilesLighthouse
has 139 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function submitFilesLighthouse(claimId, trackedItem, files) {
let filesComplete = 0;
let bytesComplete = 0;
let hasError = false;
const totalSize = files.reduce((sum, file) => sum + file.file.size, 0);
Function editPhoneNumberSuccess
has 139 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const editPhoneNumberSuccess = () => {
// store the phone number that's passed in via the POST or PUT call so we can
// return it with the GET user/ response
let newAreaCode;
let newPhoneNumber;
Function Allergies
has 138 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Allergies = props => {
const { runningUnitTest } = props;
const dispatch = useDispatch();
const updatedRecordList = useSelector(
state => state.mr.allergies.updatedList,
Function DependentInformation
has 137 lines of code (exceeds 25 allowed). Consider refactoring. Open
const DependentInformation = props => {
const { data, goToPath, setFormData } = props;
const { dependents = [] } = data;
const search = new URLSearchParams(window.location.search);
Function DependentInformation
has 137 lines of code (exceeds 25 allowed). Consider refactoring. Open
const DependentInformation = props => {
const { data, goToPath, setFormData } = props;
const { dependents = [] } = data;
const search = new URLSearchParams(window.location.search);
File dependentChildrenPages.js
has 395 lines of code (exceeds 250 allowed). Consider refactoring. Open
import merge from 'lodash/merge';
import get from 'platform/utilities/data/get';
import {
arrayBuilderItemFirstPageTitleUI,
File IntroductionPage.jsx
has 395 lines of code (exceeds 250 allowed). Consider refactoring. Open
import {
VaAlert,
VaButton,
VaSearchInput,
} from '@department-of-veterans-affairs/component-library/dist/react-bindings';
Function EmploymentQuestion
has 137 lines of code (exceeds 25 allowed). Consider refactoring. Open
const EmploymentQuestion = props => {
const {
data,
goBack,
goToPath,
Function ChemHemDetails
has 137 lines of code (exceeds 25 allowed). Consider refactoring. Open
const ChemHemDetails = props => {
const { record, fullState, runningUnitTest } = props;
const user = useSelector(state => state.user.profile);
const allowTxtDownloads = useSelector(
state =>
Function CrisisPanel
has 136 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function CrisisPanel() {
return (
<div
id="modal-crisisline"
className="va-overlay va-modal va-modal-large"
Function mapStateToProps
has 136 lines of code (exceeds 25 allowed). Consider refactoring. Open
function mapStateToProps(state, ownProps) {
const { formContext } = ownProps;
const { form, askVA } = state;
const formData = form.data;
Function default
has 136 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function(state = INITIAL_STATE, action) {
const newState = {
...state,
loadFromUrl: false, // set this to false anytime a user action happens
};
Function Vitals
has 136 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Vitals = () => {
const dispatch = useDispatch();
const updatedRecordList = useSelector(state => state.mr.vitals.updatedList);
const listState = useSelector(state => state.mr.vitals.listState);
const vitals = useSelector(state => state.mr.vitals.vitalsList);
Function ResultsList
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
export const ResultsList = ({
facilityTypeName,
inProgress,
searchString,
results,
- 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 ZipCodePage
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
const ZipCodePage = ({
editMode,
pastMode,
router,
toggleEditMode,
- 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 SearchPage
has a Cognitive Complexity of 36 (exceeds 5 allowed). Consider refactoring. Open
const SearchPage = props => {
const searchResultTitleRef = useRef(null);
const previousLocationInputString = useRef(
props.currentQuery.locationInputString,
);
- 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"