Static code analysis setup

This commit is contained in:
sbenmoussati
2022-12-28 08:32:58 +01:00
committed by Salah Benmoussati
parent e7759e72c4
commit b4d5f6d038
5 changed files with 8 additions and 7 deletions
+2
View File
@@ -0,0 +1,2 @@
spec/
Dockerfile
+1
View File
@@ -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;
+3 -6
View File
@@ -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;
+1
View File
@@ -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);
+1 -1
View File
@@ -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, {