Showing 108 of 518 total issues
Function getDate
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
weekday: number,
hours: number,
minutes = 0,
seconds = 0,
milliseconds = 0,
Function getMeetings
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export async function getMeetings(
query: MeetingsQuery
): Promise<{ hits: number; results: Meeting[] }> {
const to = query.to.toISOString();
const from = query.from.toISOString();
- 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 mail
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
export default function mail(subjects: Subject[], description: string, user: User, org: Org, admins: User[]): Promise<void> {
Function getMeeting
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
height: number,
position: Position,
meeting: Meeting,
width: number,
reference: Date = new Date(0)
Function getDateWithTime
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
hours: number,
minutes = 0,
seconds = 0,
milliseconds = 0,
reference = new Date(0)
Function useSocialProps
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
data: T,
setData: Callback<T>,
className: string,
labelKey: string,
Model: Constructor<T>
Function getAlgoliaAvailability
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
availability: Availability,
booked = (new Availability()),
until = (new Date(new Date().getFullYear(), new Date().getMonth() + 3)),
interval = 15,
duration = 60
Function getTimeslot
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
height: number,
position: Position,
original?: Timeslot,
width: number = WIDTH,
reference: Date = new Date(0)
Function UserDisplay
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export default function UserDisplay({
user,
langs,
subjects,
}: UserDisplayProps): JSX.Element {
- 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 deleteMeetingAPI
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export default async function deleteMeetingAPI(
req: Req,
res: Res<DeleteMeetingRes>
): Promise<void> {
try {
- 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 hoursAPI
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export default async function hoursAPI(
req: Req,
res: Res<DBHoursCumulative[] | APIError>
): Promise<void> {
if (req.method !== 'GET') {
- 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 createAuthUser
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export default async function createAuthUser(user: User): Promise<User> {
await user.validatePhone();
const [err, userRecord] = await to<UserRecord, FirebaseError>(
auth.createUser({
disabled: 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 loginWithGoogle
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export async function loginWithGoogle(
user?: User,
gsuite?: boolean
): Promise<User> {
const { default: firebase } = await import('lib/firebase');
- 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 RequestForm
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export default function RequestForm(): JSX.Element {
const { org } = useOrg();
const { t } = useTranslation();
const [user, setUser] = useState<User>(new User());
const [subjects, setSubjects] = useState<Subject[]>([]);
- 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
Avoid too many return
statements within this function. Open
return '';
Avoid too many return
statements within this function. Open
if (!isUserJSON(json.creator)) return false;
Avoid too many return
statements within this function. Open
if (!isStringArray(json.parents)) return false;
Avoid too many return
statements within this function. Open
if (!isStringArray(json.profiles)) return false;
Avoid too many return
statements within this function. Open
if (!isBookingConfig(json.booking)) return false;
Avoid too many return
statements within this function. Open
if (typeof json.timezone !== 'string') return false;