coronasafe/care_fe

View on GitHub
src/CAREUI/misc/SectionNavigator.tsx

Summary

Maintainability
B
4 hrs
Test Coverage

Showing 3 of 3 total issues

Function SectionNavigator has 61 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export default function SectionNavigator(props: {
sections: { label: string; id: string }[];
className?: string;
}) {
const { sections, className } = props;
Severity: Major
Found in src/CAREUI/misc/SectionNavigator.tsx - About 2 hrs to fix

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

sections.forEach((section) => {
const element = document.getElementById(section.id);
if (element) {
observer.observe(element);
}
Severity: Minor
Found in src/CAREUI/misc/SectionNavigator.tsx and 1 other location - About 55 mins to fix
src/CAREUI/misc/SectionNavigator.tsx on lines 49..54

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

sections.forEach((section) => {
const element = document.getElementById(section.id);
if (element) {
observer.unobserve(element);
}
Severity: Minor
Found in src/CAREUI/misc/SectionNavigator.tsx and 1 other location - About 55 mins to fix
src/CAREUI/misc/SectionNavigator.tsx on lines 39..44

There are no issues that match your filters.

Category
Status