Showing 69 of 200 total issues
Function createSubmitHandler
has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring. Open
export const createSubmitHandler = (
registerFunction: RegisterNfcuidWithUserMutationFn,
markAttendedFunction: CheckInUserToEventMutationFn,
removeFunction: RemoveUserFromEventMutationFn,
markAttendedByNfcFunction: CheckInUserToEventByNfcMutationFn,
- Read upRead up
- Create a ticketCreate a ticket
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 createSubmitHandler
has a Cognitive Complexity of 49 (exceeds 5 allowed). Consider refactoring. Open
export const createSubmitHandler = (
registerFunction: _Plugin__RegisterNfcuidWithUserMutationFn,
markAttendedFunction: _Plugin__CheckInUserToEventMutationFn,
removeFunction: _Plugin__RemoveUserFromEventMutationFn,
markAttendedByNfcFunction: _Plugin__CheckInUserToEventByNfcMutationFn,
- Read upRead up
- Create a ticketCreate a ticket
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 HackerTable.tsx
has 437 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { useContext, useState, useEffect, useRef, FC } from 'react';
import { AutoSizer, SortDirection } from 'react-virtualized';
import 'react-virtualized/styles.css';
import styled from 'styled-components';
import Select from 'react-select';
- Create a ticketCreate a ticket
Function Application
has 129 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const Application: FunctionComponent = (): JSX.Element => {
const { update: setActionButton } = useContext(ActionButtonContext);
const [openSection, setOpenSection] = useState('');
const [input, setInput] = useImmer<{ answer: string; question: string }[]>([]);
const [loaded, setLoaded] = useState(false);
- Create a ticketCreate a ticket
Function RadioSlider
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
export const RadioSlider: FC<Props> = (props: Props) => {
const { option1, option2, option3, disable = false, confirmMessageFunc } = props;
const [selected, setSelected] = useState(option2);
const [width, setWidth] = useState(0);
const [left, setLeft] = useState(0);
- Read upRead up
- Create a ticketCreate a ticket
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 RadioSlider
has 102 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const RadioSlider: FC<Props> = (props: Props) => {
const { option1, option2, option3, disable = false, confirmMessageFunc } = props;
const [selected, setSelected] = useState(option2);
const [width, setWidth] = useState(0);
const [left, setLeft] = useState(0);
- Create a ticketCreate a ticket
Function HackerDash
has 90 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const HackerDash: FunctionComponent = (): JSX.Element => {
const { data, loading } = useMyStatusQuery();
const [statusInfo, setStatusInfo] = useState(statusConfig[ApplicationStatus.Created]);
const [confirmMySpot] = useConfirmMySpotMutation();
const [declineMySpot] = useDeclineMySpotMutation();
- Create a ticketCreate a ticket
Function ManageEvents
has 88 lines of code (exceeds 25 allowed). Consider refactoring. Open
const ManageEvents: FunctionComponent = (): JSX.Element => {
const [output, setOutput] = useState('No updates to report');
const [addOrUpdateEvent] = useAddOrUpdateEventMutation();
const [removeAbsentEvents] = useRemoveAbsentEventsMutation();
const [assignEventToCompany] = useAssignEventToCompanyMutation();
- Create a ticketCreate a ticket
Function createSubmitHandler
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
) => async (nfc: string, user: string, event: QueriedEvent, unadmit: boolean): Promise<boolean> => {
console.log([nfc, user, event, unadmit]);
let toastMsg = '';
try {
if (event.eventType === CHECK_IN_EVENT_TYPE) {
- Create a ticketCreate a ticket
Function createSubmitHandler
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
) => async (nfc: string, user: string, event: QueriedEvent, unadmit: boolean): Promise<boolean> => {
console.log([nfc, user, event, unadmit]);
let toastMsg = '';
try {
if (event.eventType === CHECK_IN_EVENT_TYPE) {
- Create a ticketCreate a ticket
Function Profile
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const Profile: React.FunctionComponent = (): JSX.Element => {
const { update: setActionButton } = useContext(ActionButtonContext);
const { data, loading, error } = useMyProfileQuery();
const [loaded, setLoaded] = useState(false);
const [input, setInput] = useImmer<UserInput>({});
- Create a ticketCreate a ticket
Function constructor
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor() {
this.schema = schema;
this.resolvers = {
_Plugin__Event: {
attendees: async event => (await event).attendees || [],
- Create a ticketCreate a ticket
Function FileInput
has 69 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const FileInput: FC<InputProps> = props => {
const [file, setFile] = useState<File>();
const [getSignedUploadUrl] = useSignedUploadUrlMutation();
const [uploaded, setUploaded] = useState(false);
const [loading, toggleLoading] = useState(false);
- Create a ticketCreate a ticket
Function HackerTable
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
const HackerTable: FC<HackerTableProps> = ({
data,
isSponsor = false,
viewResumes = false,
}: HackerTableProps): JSX.Element => {
- Read upRead up
- Create a ticketCreate a ticket
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 CreateSponsor
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
const CreateSponsor: React.FunctionComponent = (): JSX.Element => {
const [sponsorEmail, setSponsorEmail] = useState('');
const [sponsorName, setSponsorName] = useState('');
const [companyId, setCompanyId] = useState('');
const [createSponsorMsg, setCreateSponsorMsg] = useState('');
- Create a ticketCreate a ticket
File NfcTable.tsx
has 269 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { useContext, useState, useEffect, FC } from 'react';
import { AutoSizer, SortDirection, RowMouseEventHandlerParams } from 'react-virtualized';
import 'react-virtualized/styles.css';
import styled from 'styled-components';
import Select from 'react-select';
- Create a ticketCreate a ticket
Function HackerView
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const HackerView: FC<HackerViewProps> = props => {
const { match } = props;
const { data, loading, error } = useDetailedHackerQuery({ variables: { id: match.params.id } });
const fileReadUrlQuery = useSignedReadUrlQuery({
variables: { input: (data && data.hacker.id) || '' },
- Create a ticketCreate a ticket
Function Frame
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Frame: FunctionComponent = (): JSX.Element => {
const currentUser = useContext(AuthContext);
const [ActionButton, setActionButton] = useState<React.ReactNode>(null);
const [menuOpen, setMenuOpen] = useState(false);
- Create a ticketCreate a ticket
Function Nfc
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const Nfc: FunctionComponent = (): JSX.Element => {
const hackers = useHackersQuery();
const hackersLoading = hackers.loading;
const hackersError = hackers.error;
const hackersData = hackers.data;
- Create a ticketCreate a ticket
File NfcTable.tsx
has 262 lines of code (exceeds 250 allowed). Consider refactoring. Open
import React, { useContext, useState, useEffect, FC, useCallback } from 'react';
import { AutoSizer, SortDirection, RowMouseEventHandlerParams } from 'react-virtualized';
import 'react-virtualized/styles.css';
import styled from 'styled-components';
import Select from 'react-select';
- Create a ticketCreate a ticket