Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

fixed linting issues

Blue Mouse889c0feeff5c
diff --git a/src/analytics/analytics.controller.ts b/src/analytics/analytics.controller.ts
index a30458702..78ac96a24 100644
--- a/src/analytics/analytics.controller.ts
+++ b/src/analytics/analytics.controller.ts
@@ -869,7 +869,9 @@ export class AnalyticsController {
}
// trying to get country from timezome, otherwise using CloudFlare's IP based country code as a fallback
- const cc = ct.getCountryForTimezone(logDTO.tz)?.id || (headers['cf-ipcountry'] === 'XX' ? 'NULL' : headers['cf-ipcountry'])
+ const cc =
+ ct.getCountryForTimezone(logDTO.tz)?.id ||
+ (headers['cf-ipcountry'] === 'XX' ? 'NULL' : headers['cf-ipcountry'])
const ua = UAParser(userAgent)
const dv = ua.device.type || 'desktop'
@@ -896,9 +898,6 @@ export class AnalyticsController {
let perfDTO: Array<string | number> = []
if (!_isEmpty(logDTO.perf) && isPerformanceValid(logDTO.perf)) {
- const dv = ua.device.type || 'desktop'
- const br = ua.browser.name
-
const {
dns,
tls,
@@ -970,7 +969,8 @@ export class AnalyticsController {
await this.analyticsService.validate(logDTO, origin)
- const ip = headers['cf-connecting-ip'] || headers['x-forwarded-for'] || reqIP || ''
+ const ip =
+ headers['cf-connecting-ip'] || headers['x-forwarded-for'] || reqIP || ''
const salt = await redis.get(REDIS_SESSION_SALT_KEY)
const sessionHash = getSessionKey(ip, userAgent, logDTO.pid, salt)
const unique = await this.analyticsService.isUnique(sessionHash)
@@ -983,7 +983,8 @@ export class AnalyticsController {
const os = ua.os.name
// using CloudFlare's IP based country code
- const cc = headers['cf-ipcountry'] === 'XX' ? 'NULL' : headers['cf-ipcountry']
+ const cc =
+ headers['cf-ipcountry'] === 'XX' ? 'NULL' : headers['cf-ipcountry']
const dto = analyticsDTO(
sessionHash,
logDTO.pid,
diff --git a/src/analytics/analytics.service.ts b/src/analytics/analytics.service.ts
index 49e69b9d5..aeb77d881 100644
--- a/src/analytics/analytics.service.ts
+++ b/src/analytics/analytics.service.ts
@@ -185,7 +185,11 @@ const nullifyMissingElements = (results: any[], size?: number): number[] => {
return copy
}
-const generateParamsQuery = (col: string, subQuery: string, customEVFilterApplied: boolean): string => {
+const generateParamsQuery = (
+ col: string,
+ subQuery: string,
+ customEVFilterApplied: boolean,
+): string => {
if (customEVFilterApplied) {
return `SELECT ${col}, count(*) ${subQuery} AND ${col} IS NOT NULL GROUP BY ${col}`
}