Skip to content

Commit

Permalink
Static code analysis setup
Browse files Browse the repository at this point in the history
  • Loading branch information
sbenmoussati committed Dec 28, 2022
1 parent e7759e7 commit b4d5f6d
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .semgrepignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
spec/
Dockerfile
1 change: 1 addition & 0 deletions src/app/app-cache-handler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const cleanOldCache = (): void => {
const files = fs.readdirSync(userDataPath);

files.forEach((file) => {
// nosemgrep
const filePath = path.join(userDataPath, file);
if (!fileRemovalList.includes(file)) {
return;
Expand Down
9 changes: 3 additions & 6 deletions src/common/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,9 @@ class Translation {
* @param locale
*/
private loadResource(locale: LocaleType): JSON | null {
const resourcePath = path.resolve(
__dirname,
'..',
'locale',
`${locale}.json`,
);
const filename = `${locale}.json`;
// nosemgrep
const resourcePath = path.resolve(__dirname, '..', 'locale', filename);

if (!fs.existsSync(resourcePath)) {
return null;
Expand Down
1 change: 1 addition & 0 deletions src/common/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ class Logger {
const files = fs.readdirSync(this.logPath);
const deleteTimeStamp = new Date().getTime() - 5 * 24 * 60 * 60 * 1000;
files.forEach((file) => {
// nosemgrep
const filePath = path.join(this.logPath, file);
if (fs.existsSync(filePath)) {
const stat = fs.statSync(filePath);
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/components/message-banner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ export default class MessageBanner {
if (onlineStateIntervalId) {
return;
}

// nosemgrep
onlineStateIntervalId = setInterval(async () => {
try {
const response = await window.fetch(this.url || window.location.href, {
Expand Down

0 comments on commit b4d5f6d

Please sign in to comment.