Showing 15 of 29 total issues
File ProjectFormBody.js
has 340 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { useState } from 'react';
import Privacy from './Privacy';
import DeleteProjectModal from './DeleteProjectModal';
Function LoginBar
has 127 lines of code (exceeds 50 allowed). Consider refactoring. Open
const LoginBar = () => {
const { loginWithRedirect } = useAuth0();
const startLight = localStorage.getItem('theme') === 'light';
const [light, setLight] = useState(startLight);
const [show, setShow] = useState(false);
Function ProjectFromBody
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
const ProjectFromBody = ({
isEditing,
project,
projectPhotos,
userData,
- 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 OnboardingForm
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
const OnboardingForm = ({ history, isLoading }) => {
const [loadingPage, setLoadingPage] = useState(false);
// user data from auth0-spa
const { logout, user } = useAuth0();
- 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 ProfileTabs.js
has 313 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React from 'react';
import { Link } from 'react-router-dom';
import { Tab, Tabs, TabList, TabPanel } from 'react-tabs';
import moment from 'moment';
import { v4 } from 'uuid';
Function Profile
has 99 lines of code (exceeds 50 allowed). Consider refactoring. Open
export default function Profile(props, users) {
// const { username, avatar} = useParams();
const history = useHistory();
const { id } = useParams();
const { user } = useAuth0();
Function MultiImageUpload
has 79 lines of code (exceeds 50 allowed). Consider refactoring. Open
export function MultiImageUpload(props) {
const { files, setFiles } = props;
const {
isDragActive,
isDragReject,
Function Heatmap
has 75 lines of code (exceeds 50 allowed). Consider refactoring. Open
const Heatmap = (props) => {
const [today] = useState(new Date());
const heatmapArr = [];
const [days, setDays] = useState(-365);
const { width } = useWindowDimensions();
Function App
has 64 lines of code (exceeds 50 allowed). Consider refactoring. Open
export default function App() {
/* USER STATE */
const { user, loading } = useAuth0();
const history = useHistory();
Function InviteModal
has 61 lines of code (exceeds 50 allowed). Consider refactoring. Open
const InviteModal = () => {
return (
<div className="modal--close">
<span className="modal--expand__background-overlay">
<div className="invite-modal">
Function ImageViewer
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
const ImageViewer = ({ projectImg, userData, projectData }) => {
const { isModal, toggleModal } = useModal();
const [activeImg, setActiveImg] = useState(null);
const changeImg = (imgObj) => {
if (activeImg === null || activeImg.id !== imgObj.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 TopBar
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
const TopBar = ({ searchData, getSearch }) => {
const { logout, user } = useAuth0();
const history = useHistory();
const { data: activeUser } = useQuery(GET_USER_BY_ID_QUERY, {
- 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 LoginBar
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
const LoginBar = () => {
const { loginWithRedirect } = useAuth0();
const startLight = localStorage.getItem('theme') === 'light';
const [light, setLight] = useState(startLight);
const [show, setShow] = useState(false);
- 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 TempComment
has 51 lines of code (exceeds 50 allowed). Consider refactoring. Open
export const TempComment = (props) => {
const [comment, setComment] = useState();
const { c } = this.props;
const { top, left } = c;
Function Step1
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const Step1 = ({
alert,
formUser,
onChange,
showPrev,
- 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"