Skip to content

Commit

Permalink
Quell some SonarCloud code smells
Browse files Browse the repository at this point in the history
  • Loading branch information
mjradwin committed Dec 8, 2024
1 parent 4f08d8a commit 6345a25
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ export function shouldRenderBrief(ev: Event): boolean {
const mask = ev.getFlags();
if (mask & flags.HEBREW_DATE) {
const hd = ev.getDate();
return hd.getDate() === 1 ? false : true;
return hd.getDate() !== 1;
} else if (
mask &
(flags.DAILY_LEARNING | flags.DAF_YOMI | flags.YERUSHALMI_YOMI)
Expand Down
3 changes: 2 additions & 1 deletion src/csv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ export function eventToCsv(ev: Event, options: RestApiOptions): string {
.replace(/"/g, "''")
.replace(/\n/g, ' / ');

const showTimeAs = timed || mask & flags.CHAG ? 4 : 3;
const isChag = Boolean(mask & flags.CHAG);
const showTimeAs = timed || isChag ? 4 : 3;
return `"${subj}",${date},${startTime},${endDate},${endTime},${allDay},"${memo}","${showTimeAs}","${loc}"`;
}

Expand Down
3 changes: 2 additions & 1 deletion src/fullcalendar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ import {
export function eventToFullCalendar(ev: Event, tzid: string, il: boolean): any {
const classes = getEventCategories(ev);
const mask = ev.getFlags();
if (classes[0] === 'holiday' && mask & flags.CHAG) {
const isChag = Boolean(mask & flags.CHAG);
if (isChag && classes[0] === 'holiday') {
classes.push('yomtov');
}
const timedEv = ev as TimedEvent;
Expand Down
2 changes: 1 addition & 1 deletion test/common.spec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {RestApiOptions,
import {
getDownloadFilename, getCalendarTitle, makeTorahMemoText, getEventCategories,
getHolidayDescription,
appendIsraelAndTracking, locationToPlainObj, shouldRenderBrief} from '../src/common';
Expand Down

0 comments on commit 6345a25

Please sign in to comment.