pjatk21/alt-api

View on GitHub

Showing 35 of 45 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open

<ExperimentalTutorPicker
tutors={tutors ?? []}
setTutors={(tutors) => setQueryOptions({ tutors })}
visible={tutorsPickerVisible}
setVisible={setTutorsPickerVisible}
Severity: Minor
Found in alt-api-ui/src/schedule-viewer/ScheduleViewer.tsx and 1 other location - About 55 mins to fix
alt-api-ui/src/schedule-viewer/ScheduleViewer.tsx on lines 177..182

Function Scrappers has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

export function Scrappers() {
const { data, error, isLoading, isError } = useQuery('scrappers', getScrappers, {
refetchInterval: 5_000,
retry: false,
})
Severity: Minor
Found in alt-api-ui/src/scrappers/Scrappers.tsx - About 45 mins to fix

Function ScheduleTimeline has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

export function ScheduleTimeline({
date,
queryData,
choice,
dontPrintSummary,
Severity: Minor
Found in alt-api-ui/src/schedule-viewer/ScheduleTimeline.tsx - About 45 mins to fix

Similar blocks of code found in 4 locations. Consider refactoring.
Open

const getAllTutors = () =>
ky.get(`${baseUrl}v1/timetable/tutors`).json<{ tutorsAvailable: string[] }>()
Severity: Major
Found in alt-api-ui/src/schedule-viewer/pickers/TutorPicker.tsx and 3 other locations - About 40 mins to fix
alt-api-ui/src/datalists/GroupDatalist.tsx on lines 5..6
alt-api-ui/src/datalists/TutorDatalist.tsx on lines 5..6
alt-api-ui/src/schedule-viewer/pickers/GroupPicker.tsx on lines 15..16

Similar blocks of code found in 4 locations. Consider refactoring.
Open

const getAllGroups = () =>
ky.get(`${baseUrl}v1/timetable/groups`).json<{ groupsAvailable: string[] }>()
Severity: Major
Found in alt-api-ui/src/schedule-viewer/pickers/GroupPicker.tsx and 3 other locations - About 40 mins to fix
alt-api-ui/src/datalists/GroupDatalist.tsx on lines 5..6
alt-api-ui/src/datalists/TutorDatalist.tsx on lines 5..6
alt-api-ui/src/schedule-viewer/pickers/TutorPicker.tsx on lines 15..16

Similar blocks of code found in 4 locations. Consider refactoring.
Open

const getAllTutors = () =>
ky.get(`${baseUrl}v1/timetable/tutors`).json<{ tutorsAvailable: string[] }>()
Severity: Major
Found in alt-api-ui/src/datalists/TutorDatalist.tsx and 3 other locations - About 40 mins to fix
alt-api-ui/src/datalists/GroupDatalist.tsx on lines 5..6
alt-api-ui/src/schedule-viewer/pickers/GroupPicker.tsx on lines 15..16
alt-api-ui/src/schedule-viewer/pickers/TutorPicker.tsx on lines 15..16

Similar blocks of code found in 4 locations. Consider refactoring.
Open

const getAllGroups = () =>
ky.get(`${baseUrl}v1/timetable/groups`).json<{ groupsAvailable: string[] }>()
Severity: Major
Found in alt-api-ui/src/datalists/GroupDatalist.tsx and 3 other locations - About 40 mins to fix
alt-api-ui/src/datalists/TutorDatalist.tsx on lines 5..6
alt-api-ui/src/schedule-viewer/pickers/GroupPicker.tsx on lines 15..16
alt-api-ui/src/schedule-viewer/pickers/TutorPicker.tsx on lines 15..16

Function updateOneEntry has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

async updateOneEntry(htmlId: string, changeHash: string, entry: ScheduleEntryDto) {
const previous = await this.timetableModel.findOne({
'entry.groups': entry.groups,
'entry.begin': entry.begin,
'entry.code': entry.code,
Severity: Minor
Found in src/public-timetable/public-timetable.service.ts - About 35 mins to fix

Identical blocks of code found in 2 locations. Consider refactoring.
Open

@Prop({ required: true, type: S.Types.ObjectId, ref: ScrapperVisa.name })
visa: ScrapperVisa
Severity: Minor
Found in src/hypervisor/schemas/scrapper-state.schema.ts and 1 other location - About 30 mins to fix
src/hypervisor/schemas/scrapper-task.schema.ts on lines 10..11

Similar blocks of code found in 2 locations. Consider refactoring.
Open

<Grid>
<Link to={'/app/toolbox/tutor-finder'}>
<Button>Znaleźć inne zajęcia wykładowcy</Button>
</Link>
</Grid>
Severity: Minor
Found in alt-api-ui/src/toolbox/Toolbox.tsx and 1 other location - About 30 mins to fix
alt-api-ui/src/toolbox/Toolbox.tsx on lines 38..42

Similar blocks of code found in 2 locations. Consider refactoring.
Open

@Type(() => DateTime)
@Transform(({ value }) => DateTime.fromISO(value))
end: DateTime
Severity: Minor
Found in alt-api-ui/src/altapi.ts and 1 other location - About 30 mins to fix
alt-api-ui/src/altapi.ts on lines 22..24

Avoid too many return statements within this function.
Open

return <p>Ayo?</p>
Severity: Major
Found in alt-api-ui/src/scrappers/Scrappers.tsx - About 30 mins to fix

Similar blocks of code found in 2 locations. Consider refactoring.
Open

<Grid>
<Link to={'/app/toolbox/group-finder'}>
<Button>Znaleźć inne grupy wykładowcy</Button>
</Link>
</Grid>
Severity: Minor
Found in alt-api-ui/src/toolbox/Toolbox.tsx and 1 other location - About 30 mins to fix
alt-api-ui/src/toolbox/Toolbox.tsx on lines 33..37

Identical blocks of code found in 2 locations. Consider refactoring.
Open

@Prop({ required: true, type: S.Types.ObjectId, ref: ScrapperVisa.name })
visa: ScrapperVisa
Severity: Minor
Found in src/hypervisor/schemas/scrapper-task.schema.ts and 1 other location - About 30 mins to fix
src/hypervisor/schemas/scrapper-state.schema.ts on lines 10..11

Similar blocks of code found in 2 locations. Consider refactoring.
Open

@Type(() => DateTime)
@Transform(({ value }) => DateTime.fromISO(value))
begin: DateTime
Severity: Minor
Found in alt-api-ui/src/altapi.ts and 1 other location - About 30 mins to fix
alt-api-ui/src/altapi.ts on lines 26..28
Severity
Category
Status
Source
Language