Showing 69 of 200 total issues
Function NfcTable
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
const NfcTable: FC<Props> = ({ hackersData, eventsData }): JSX.Element => {
const EventOptions: { label: string; value: string }[] = eventsData.map(event => {
return {
label: event.name,
value: event.id,
- 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 NfcTable
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
const NfcTable: FC<NfcTableProps> = ({ hackersData, eventsData }: NfcTableProps): JSX.Element => {
const EventOptions: { label: string; value: string }[] = eventsData.map(event => {
return {
label: event.name,
value: event.id,
- 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 createActionRenderer
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function createActionRenderer(
updateStatus: (s: { status: ApplicationStatus; id: string }) => Promise<void>
): FC<ActionRendererProps> {
return function ActionRenderer({ rowData: { id, firstName, lastName, status } }) {
return (
- Create a ticketCreate a ticket
Function ManageHackers
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const ManageHackers: FunctionComponent = (): JSX.Element => {
const { loading, error, data } = useHackersQuery();
const [tableState, updateTableState] = useImmer(defaultTableState);
return (
- Create a ticketCreate a ticket
Function generateHacker
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
const generateHacker: () => HackerDbObject = () => {
const fn = faker.name.firstName();
const ln = faker.name.lastName();
return {
_id: new ObjectID(),
- Create a ticketCreate a ticket
Function Button
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const Button: FC<ButtonProps> = props => {
const [unresolved, setUnresolved] = useState(false);
const { icon, iconAlt } = props;
const iconElement = useMemo(() => getIcon(icon, iconAlt), [icon, iconAlt]);
- Create a ticketCreate a ticket
Function getResumes
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Confirmed
const getResumes = async (models: Models): Promise<void[]> => {
const cwd = process.cwd();
const arr = await models.Hackers.find({
status: { $in: ['ACCEPTED', 'SUBMITTED', 'CONFIRMED'] },
})
- Create a ticketCreate a ticket
Function transformCalEventToDBUpdate
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
export const transformCalEventToDBUpdate = (event: SimplifiedVEvent): EventUpdate => {
if (!event.start && !event.end) {
throw new TypeError('Calendar event did not contain start or end timestamp');
}
// Either start or end may be undefined, but not both due to guard above.
- Create a ticketCreate a ticket
Function KVData
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const KVData = (hackerData: string[], types: string): ChartData<ChartJSData> => {
let keys: string[] = [];
if (types === 'gender') {
keys = [...Object.values(Gender), 'NOT FOUND'];
} else if (types === 'status') {
- 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 onTableColumnSelect
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const onTableColumnSelect = (
ctx: TableCtxI,
index: number
): ((s: ValueType<Option, true>) => void) => {
// Dependency injection
- 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 a Cognitive Complexity of 8 (exceeds 5 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('');
- 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 constructor
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
constructor() {
this.schema = schema;
this.resolvers = {
_Plugin__Event: {
attendees: async event => (await event).attendees || [],
- 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 ResumeLink
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export const ResumeLink: FC<ResumeLinkProps> = (props: { id: string }) => {
const { id } = props;
const { data, loading, error } = useDetailedHackerQuery({ variables: { id } });
const [linkLoc, setLinkLoc] = useState('');
const fileReadUrlQuery = useSignedReadUrlQuery({
- 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
Consider simplifying this complex logical expression. Open
if (
word.length !== 0 &&
!hacker.firstName.toLowerCase().includes(word) &&
!hacker.lastName.toLowerCase().includes(word) &&
!hacker.email.toLowerCase().includes(word) &&
- Create a ticketCreate a ticket
Consider simplifying this complex logical expression. Open
if (
word.length !== 0 &&
!hacker.firstName.toLowerCase().includes(word) &&
!hacker.lastName.toLowerCase().includes(word) &&
!hacker.email.toLowerCase().includes(word) &&
- Create a ticketCreate a ticket
Function generateRowClassName
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
) => (arg: { index: number }) => string = (data, topUserMatch) => ({ index }) => {
if (data[index] && data[index].id === topUserMatch) return 'selected';
if (index < 0) return 'headerRow';
- 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 HackerView
has a Cognitive Complexity of 7 (exceeds 5 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) || '' },
- 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 generateRowClassName
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
) => (arg: { index: number }) => string = (data, topUserMatch) => ({ index }) => {
if (data[index] && data[index].id === topUserMatch) return 'selected';
if (index < 0) return 'headerRow';
- 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 transformCalEventToDBUpdate
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export const transformCalEventToDBUpdate = (event: SimplifiedVEvent): EventUpdate => {
if (!event.start && !event.end) {
throw new TypeError('Calendar event did not contain start or end timestamp');
}
// Either start or end may be undefined, but not both due to guard above.
- 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 a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export async function assignEventToCompany(
eventID: string,
companyID: string,
models: Models
): Promise<EventDbObject> {
- 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"