Showing 69 of 200 total issues
Function recomputeHackerEventScores
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
const recomputeHackerEventScores = async (
models: Models,
writeResultsToDB = false
): Promise<void> => {
let bestScore = 0;
- Create a ticketCreate a ticket
Function CreateCompany
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
const CreateCompany: React.FunctionComponent = (): JSX.Element => {
const [companyName, setCompanyName] = useState('');
const [tierId, setTierId] = useState('');
const [createCompanyMsg, setCreateCompanyMsg] = useState('');
- Create a ticketCreate a ticket
Function updateMyApplication
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Confirmed
export const updateMyApplication: MutationResolvers['updateMyApplication'] = async (
root,
{ input },
{ user, models }
) => {
- 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 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const CheckInEvent: FC = () => {
const events = useEventsForHackersQuery();
const hacker = useMyEventStatusQuery();
const [checkIn] = useCheckInUserToEventAndUpdateEventScoreMutation();
const onCheckIn = useMemo(() => getOnCheckIn(checkIn), [checkIn]);
- Create a ticketCreate a ticket
Function checkInUserToEvent
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
export async function checkInUserToEvent(
userID: string,
eventID: string,
models: Models
): Promise<UserDbInterface> {
- Create a ticketCreate a ticket
Function addOrUpdateEvent
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
export async function addOrUpdateEvent(
eventInput: EventUpdateInput,
models: Models
): Promise<EventDbObject> {
if (!eventInput.id && !eventInput.gcalID)
- Create a ticketCreate a ticket
Function CreateTier
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
const CreateTier: React.FC = () => {
const [tierName, setTierName] = useState('');
const [permissions, setPermissions] = useState(['']);
const [createTierMsg, setCreateTierMsg] = useState('');
- Create a ticketCreate a ticket
Function Nfc
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
export const Nfc: FunctionComponent = (): JSX.Element => {
const [tableState, updateTableState] = useImmer(defaultTableState);
const hackers = useHackersQuery();
const events = useEventsQuery();
const loggedInUser = useMeSponsorQuery();
- 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 SponsorHackerView
has 37 lines of code (exceeds 25 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();
- Create a ticketCreate a ticket
Function addHackers
has 36 lines of code (exceeds 25 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) {
- Create a ticketCreate a ticket
Function Nfc
has a Cognitive Complexity of 12 (exceeds 5 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;
- 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 JoinTeam
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const JoinTeam: FC = () => {
const [searchValue, setSearchValue] = useState('');
const [errorMsg, setErrorMsg] = useState('');
const [joinTeam] = useJoinTeamMutation({ variables: { input: { name: searchValue } } });
- Create a ticketCreate a ticket
Function removeUserFromEvent
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
export async function removeUserFromEvent(
userID: string,
eventID: string,
models: Models
): Promise<UserDbInterface> {
- Create a ticketCreate a ticket
Function Nfc
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const Nfc: FunctionComponent = (): JSX.Element => {
const [tableState, updateTableState] = useImmer(defaultTableState);
const hackers = useHackersQuery();
const events = useEventsQuery();
const loggedInUser = useMeSponsorQuery();
- Create a ticketCreate a ticket
Function Application
has a Cognitive Complexity of 11 (exceeds 5 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);
- 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 assignEventToCompany
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
export async function assignEventToCompany(
eventID: string,
companyID: string,
models: Models
): Promise<EventDbObject> {
- Create a ticketCreate a ticket
Function Vaken
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Vaken: React.FunctionComponent = (): JSX.Element => {
const [ready, setReady] = useState(false);
const { data, error, loading } = useMeQuery();
const StateMachine: React.FunctionComponent = (): JSX.Element | null => {
- Create a ticketCreate a ticket
Function removeUserFromEvent
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
export async function removeUserFromEvent(
userID: string,
eventID: string,
models: Models
): Promise<UserDbInterface> {
- Create a ticketCreate a ticket
Function updateEventsHandler
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
export async function updateEventsHandler(
events: null | EventUpdate[],
addOrUpdateEvent: AddOrUpdateEventMutationHookResult[0],
removeAbsentEvents: RemoveAbsentEventsMutationHookResult[0]
): Promise<string[]> {
- Create a ticketCreate a ticket
Function checkInUserToEvent
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
export async function checkInUserToEvent(
userID: string,
eventID: string,
models: Models
): Promise<UserDbInterface> {
- Create a ticketCreate a ticket