Showing 212 of 556 total issues
Avoid too many return
statements within this function. Open
return null;
Avoid too many return
statements within this function. Open
return null;
Avoid too many return
statements within this function. Open
return <LoadingSpinner />;
Avoid too many return
statements within this function. Open
return Wind;
Avoid too many return
statements within this function. Open
return {
past: [...past, present],
present: next,
future: newFuture,
};
Avoid too many return
statements within this function. Open
return produce(state, (draft) => {
draft.hidden[semester] = hiddenModules;
});
Avoid too many return
statements within this function. Open
if (requiredCount === 1 && options.length === 1) return [options[0]];
Avoid too many return
statements within this function. Open
return [fragment];
Avoid too many return
statements within this function. Open
return state;
Avoid too many return
statements within this function. Open
return assertNever(fragment);
Avoid too many return
statements within this function. Open
return assertNever(conflict);
Avoid too many return
statements within this function. Open
return `Weeks ${processed.join(', ')}`;
Avoid too many return
statements within this function. Open
return {
...state,
lessons: { [semester]: timetable },
colors: { [semester]: colors },
hidden: { [semester]: hidden },
Avoid too many return
statements within this function. Open
return state;
Function program_types
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public program_types(): Program_typesContext {
let _localctx: Program_typesContext = new Program_typesContext(this._ctx, this.state);
this.enterRule(_localctx, 2, NusModsParser.RULE_program_types);
let _la: number;
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 ExportMenuComponent
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const ExportMenuComponent: React.FC<Props> = ({ semester, timetable }) => {
const [isMacWarningOpen, setIsMacWarningOpen] = useState(false);
const dispatch = useDispatch();
const state = useSelector((storeState: State) => storeState);
- 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 ModulePageContent
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const ModulePageContent: React.FC<Props> = ({ module, archiveYear }) => {
const [isMenuOpen, setIsMenuOpen] = useState(false);
const { moduleCode, title } = module;
- 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 getDuplicateModules
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function getDuplicateModules(classes: VenueLesson[]): ModuleCode[] {
const lessonsByTime: VenueLesson[][] = values(
groupBy(classes, (lesson) => [lesson.startTime, lesson.endTime, lesson.weeks, lesson.day]),
);
- 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 parse
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function parse(data: ModuleWithoutTree[], subLogger: Logger): PrereqTreeMap {
const results: PrereqTreeMap = {};
for (const module of data) {
const { moduleCode, prerequisiteRule: value } = module;
- 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 ExamWeekComponent
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const ExamWeekComponent: React.FC<Props> = (props) => {
const { modules, weekNumber, firstDayOfExams, days } = props;
const currentTime = useCurrentTime();
// Array of dates to display
- 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"