Showing 69 of 200 total issues
Avoid too many return
statements within this function. Open
return <p>You dont have permissions to scan NFCs</p>;
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return (
<FloatingPopup borderRadius="1rem" height="100%" backgroundOpacity="1" padding="1.5rem">
<TableContext.Provider value={{ state: tableState, update: updateTableState }}>
<NfcTable hackersData={hackersData.hackers} eventsData={eventsCurrent} />
</TableContext.Provider>
- Create a ticketCreate a ticket
Avoid too many return
statements within this function. Open
return (
<FloatingPopup borderRadius="1rem" height="100%" backgroundOpacity="1" padding="1.5rem">
<TableContext.Provider value={{ state: tableState, update: updateTableState }}>
<NfcTable hackersData={hackers.data?.hackers ?? []} eventsData={ongoingEvents ?? []} />
</TableContext.Provider>
- Create a ticketCreate a ticket
Function SponsorHackerView
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const SponsorHackerView: FC = () => {
const { loading, error, data } = useHackersQuery();
const [tableState, updateTableState] = useImmer(defaultTableState);
const sponsor = useMeSponsorQuery();
const now = Date.now();
- 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 addOrUpdateEvent
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export async function addOrUpdateEvent(
eventInput: EventUpdateInput,
models: Models
): Promise<EventDbObject> {
if (!eventInput.id && !eventInput.gcalID)
- 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 updateEventsHandler
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export async function updateEventsHandler(
events: null | EventUpdate[],
addOrUpdateEvent: AddOrUpdateEventMutationHookResult[0],
removeAbsentEvents: RemoveAbsentEventsMutationHookResult[0]
): Promise<string[]> {
- 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 CheckInEvent
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export const CheckInEvent: FC = () => {
const events = useEventsForHackersQuery();
const hacker = useMyEventStatusQuery();
const [checkIn] = useCheckInUserToEventAndUpdateEventScoreMutation();
const onCheckIn = useMemo(() => getOnCheckIn(checkIn), [checkIn]);
- 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 FileInput
has a Cognitive Complexity of 6 (exceeds 5 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);
- 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 addHackers
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const addHackers = async (): Promise<void> => {
const models = await new DB().collections;
console.log('Connected to DB');
const newHackers: HackerDbObject[] = [];
for (let i = 1; i <= NUM_HACKERS; i += 1) {
- 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"