Showing 36 of 74 total issues
Function WriterProfileForm
has 369 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function WriterProfileForm() {
const history = useHistory();
const dispatch = useDispatch();
const classes = useStyles();
const userId = useSelector((state) => state.login.user.id);
Function ApplicantProfileForm
has 236 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function ApplicantProfileForm() {
const history = useHistory();
const dispatch = useDispatch();
const classes = useStyles();
const userId = useSelector((state) => state.login.user.id);
Function EditProfile
has 208 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const EditProfile = (props) => {
const classes = useStyles();
const userType = props.userType;
if (userType === "writer") {
Function RegisterForm
has 150 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function RegisterForm() {
const dispatch = useDispatch();
const classes = useStyles();
const history = useHistory();
const [isDisabled, setIsDisabled] = useState(true);
Function LandingPage
has 136 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function LandingPage() {
const classes = useStyles();
const dispatch = useDispatch();
const token = localStorage.getItem("token");
useEffect(() => {
File WriterProfileForm.js
has 391 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React, { useState } from "react";
import { useHistory } from "react-router-dom";
import { useDispatch, useSelector } from "react-redux";
import { postWriterOboarding } from "../../store/actions/onboardingActions";
import CssBaseline from "@material-ui/core/CssBaseline";
Function grantsReducer
has 123 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const grantsReducer = (state = initialState, action) => {
switch (action.type) {
case GET_GRANTS_START:
return {
...state,
Function UpdateGrant
has 122 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function UpdateGrant() {
const dispatch = useDispatch();
const history = useHistory();
const classes = useStyles();
const applicant_id = useSelector(
Function PrimarySearchAppBar
has 121 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function PrimarySearchAppBar() {
const classes = useStyles();
const history = useHistory();
const [anchorEl, setAnchorEl] = useState(null);
const [mobileMoreAnchorEl, setMobileMoreAnchorEl] = useState(null);
Function GrantsForm
has 114 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function GrantsForm() {
const classes = useStyles();
const history = useHistory();
const dispatch = useDispatch();
const profileId = useSelector((state) => state.profileInfo.profileDetails.id);
Function GrantCard
has 96 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function GrantCard(props) {
const dispatch = useDispatch();
const grant = props.data;
const classes = useStyles();
const [expanded, setExpanded] = React.useState(false);
Function WriterProfileForm
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
Open
export default function WriterProfileForm() {
const history = useHistory();
const dispatch = useDispatch();
const classes = useStyles();
const userId = useSelector((state) => state.login.user.id);
- 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 GrantCard
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function GrantCard(props) {
const dispatch = useDispatch();
const grant = props.data;
const classes = useStyles();
Function ApplicantProfileForm
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
Open
export default function ApplicantProfileForm() {
const history = useHistory();
const dispatch = useDispatch();
const classes = useStyles();
const userId = useSelector((state) => state.login.user.id);
- 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 getStepContent
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function getStepContent(step) {
switch (step) {
case 0:
return (
<WriterContactInfoForm
Function Login
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const Login = () => {
const history = useHistory();
const dispatch = useDispatch();
const [user, setUser] = useState({
email: "",
Function onboardingReducer
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const onboardingReducer = (state = initialState, action) => {
switch (action.type) {
case APPLICANT_ONBOARDING_POST_START:
return {
...state,
Function handleValidation
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const handleValidation = (e) => {
// validation function handles all inputs where the only validation is that the string must be greater than 2
const validator = (formValue) => {
//persisting the event to ensure it makes it to validation
e.persist();
Function WriterProfile
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const WriterProfile = (props) => {
const dispatch = useDispatch();
const classes = useStyles();
//Redux
File WriterWorkCard.js
has 288 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React, { useState } from "react";
import { useDispatch, useSelector } from "react-redux";
import { useStyles } from "./WriterForm.styles";
import Card from "@material-ui/core/Card";
import CardContent from "@material-ui/core/CardContent";