Showing 212 of 556 total issues
Function SettingsContainer
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const SettingsContainer: React.FC<Props> = ({
currentThemeId,
colorScheme,
betaTester,
loadDisqusManually,
- 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 fetchModule
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
async function fetchModule(moduleCode: string) {
const fileName = `${moduleCode}.json`;
let mod;
- 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 prereq
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public prereq(): PrereqContext {
let _localctx: PrereqContext = new PrereqContext(this._ctx, this.state);
this.enterRule(_localctx, 32, NusModsParser.RULE_prereq);
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 errorHandler
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const errorHandler: Koa.Middleware<State> = async (ctx, next) => {
try {
await next();
if (ctx.status === 404) {
- 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 getAcadWeekInfo
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function getAcadWeekInfo(date: Date): AcadWeekInfo {
const currentAcad = getAcadYear(date);
const acadYear = currentAcad.year;
const acadYearStartDate = getAcadYearStartDate(acadYear);
- 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 cohort_years
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public cohort_years(): Cohort_yearsContext {
let _localctx: Cohort_yearsContext = new Cohort_yearsContext(this._ctx, this.state);
this.enterRule(_localctx, 24, NusModsParser.RULE_cohort_years);
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 PlannerModuleSelectComponent
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function PlannerModuleSelectComponent({
id,
className,
rows,
defaultValue,
- 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 NotificationText
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
}> = ({ useLineBreaks, round, now }) => {
const isRoundOpen = now >= round.startDate;
const timeFromNow = formatDistance(now, isRoundOpen ? round.endDate : round.startDate, {
includeSeconds: true,
});
- 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 moduleBank
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function moduleBank(state: ModuleBank = defaultModuleBankState, action: Actions): ModuleBank {
switch (action.type) {
case SUCCESS_KEY(FETCH_MODULE_LIST):
return {
...state,
- 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 calculateWeekRange
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function calculateWeekRange(
lesson: RawLesson,
_semester: Semester,
weekRange: WeekRange,
): EventOption {
- 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 createSearchPredicate
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function createSearchPredicate(
searchTerm: string,
): (searchableModule: SearchableModule) => boolean {
const searchRegexes = tokenize(searchTerm).map(regexify);
- 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 undefined;
Avoid too many return
statements within this function. Open
return;
Avoid too many return
statements within this function. Open
return latestVersion;
Avoid too many return
statements within this function. Open
if (acadWeekNumber <= lastWeekOfSpecialSem2) return special2;
Avoid too many return
statements within this function. Open
return <LoadingSpinner />;
Avoid too many return
statements within this function. Open
return Thunderstorm;
Avoid too many return
statements within this function. Open
if (process.env.NODE_ENV === 'production' && process.env.CI) return 'preview';
Avoid too many return
statements within this function. Open
return cleanedDesc.includes('light') ? Showers : Rain;
Avoid too many return
statements within this function. Open
return 'development';