Skip to content

Commit ce56199

Browse files
committed
fix linter issues
1 parent b62f1d4 commit ce56199

6 files changed

Lines changed: 23 additions & 23 deletions

File tree

sql/2025/sustainability/cache_header_usage.sql

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
SELECT
55
client,
6-
COUNT(*) AS total_requests,
6+
COUNT(1) AS total_requests,
77

88
COUNTIF(uses_cache_control) AS total_using_cache_control,
99
COUNTIF(uses_max_age) AS total_using_max_age,
@@ -22,24 +22,24 @@ SELECT
2222
NOT uses_cache_control AND uses_expires
2323
) AS total_using_only_expires,
2424

25-
COUNTIF(uses_cache_control) / COUNT(*) AS pct_cache_control,
26-
COUNTIF(uses_max_age) / COUNT(*) AS pct_using_max_age,
27-
COUNTIF(uses_expires) / COUNT(*) AS pct_using_expires,
25+
COUNTIF(uses_cache_control) / COUNT(1) AS pct_cache_control,
26+
COUNTIF(uses_max_age) / COUNT(1) AS pct_using_max_age,
27+
COUNTIF(uses_expires) / COUNT(1) AS pct_using_expires,
2828
COUNTIF(
2929
uses_max_age AND uses_expires
30-
) / COUNT(*) AS pct_using_max_age_and_expires,
30+
) / COUNT(1) AS pct_using_max_age_and_expires,
3131
COUNTIF(
3232
uses_cache_control AND uses_expires
33-
) / COUNT(*) AS pct_using_both_cc_and_expires,
33+
) / COUNT(1) AS pct_using_both_cc_and_expires,
3434
COUNTIF(
3535
NOT uses_cache_control AND NOT uses_expires
36-
) / COUNT(*) AS pct_using_neither_cc_nor_expires,
36+
) / COUNT(1) AS pct_using_neither_cc_nor_expires,
3737
COUNTIF(
3838
uses_cache_control AND NOT uses_expires
39-
) / COUNT(*) AS pct_using_only_cache_control,
39+
) / COUNT(1) AS pct_using_only_cache_control,
4040
COUNTIF(
4141
NOT uses_cache_control AND uses_expires
42-
) / COUNT(*) AS pct_using_only_expires
42+
) / COUNT(1) AS pct_using_only_expires
4343

4444
FROM (
4545
SELECT

sql/2025/sustainability/cdn_adoption.sql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ SELECT
55
client,
66
total,
77
IF(cdn = '', 'No CDN', cdn) AS cdn,
8-
COUNT(*) AS freq,
9-
COUNT(*) / total AS pct
8+
COUNT(1) AS freq,
9+
COUNT(1) / total AS pct
1010
FROM (
1111
SELECT
1212
client,
13-
COUNT(*) AS total,
13+
COUNT(1) AS total,
1414
ARRAY_CONCAT_AGG(
1515
SPLIT(JSON_EXTRACT_SCALAR(summary, '$.cdn'), ', ')
1616
) AS cdn_list

sql/2025/sustainability/responsive_images.sql

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ WITH page_data AS (
3434
SELECT
3535
client,
3636
round(
37-
safe_divide(countif(media_info.num_srcset_all > 0), count(*)) * 100, 2
37+
safe_divide(countif(media_info.num_srcset_all > 0), count(1)) * 100, 2
3838
) AS pages_with_srcset_pct,
3939
round(
40-
safe_divide(countif(media_info.num_srcset_sizes > 0), count(*)) * 100, 2
40+
safe_divide(countif(media_info.num_srcset_sizes > 0), count(1)) * 100, 2
4141
) AS pages_with_srcset_sizes_pct,
4242
round(
4343
safe_divide(
@@ -46,7 +46,7 @@ SELECT
4646
media_info.num_srcset_all > 0
4747
) - countif(media_info.num_srcset_sizes > 0)
4848
),
49-
count(*)
49+
count(1)
5050
) * 100,
5151
2
5252
) AS pages_with_srcset_wo_sizes_pct,
@@ -64,7 +64,7 @@ SELECT
6464
2
6565
) AS instances_of_srcset_wo_sizes_pct,
6666
round(
67-
safe_divide(countif(media_info.num_picture_img > 0), count(*)) * 100, 2
67+
safe_divide(countif(media_info.num_picture_img > 0), count(1)) * 100, 2
6868
) AS pages_with_picture_pct
6969
FROM page_data
7070
GROUP BY

sql/2025/sustainability/script_count.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,10 @@ SELECT
9595
SAFE_DIVIDE(SUM(inline_scripts), SUM(total_scripts)) AS pct_inline_script,
9696
APPROX_QUANTILES(
9797
SAFE_DIVIDE(external_scripts, total_scripts), 1000
98-
) [OFFSET(500)] AS median_external,
98+
)[OFFSET(500)] AS median_external,
9999
APPROX_QUANTILES(
100100
SAFE_DIVIDE(inline_scripts, total_scripts), 1000
101-
) [OFFSET(500)] AS median_inline
101+
)[OFFSET(500)] AS median_inline
102102
FROM
103103
script_data
104104
GROUP BY

sql/2025/sustainability/video_autoplay_values.sql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ WITH video_data AS (
2323
SELECT
2424
client,
2525
IF(autoplay_value = '', '(empty)', autoplay_value) AS autoplay_value,
26-
COUNT(*) AS autoplay_value_count,
27-
SUM(COUNT(*)) OVER (PARTITION BY client) AS total_videos,
26+
COUNT(1) AS autoplay_value_count,
27+
SUM(COUNT(1)) OVER (PARTITION BY client) AS total_videos,
2828
ROUND(
29-
SAFE_DIVIDE(COUNT(*), SUM(COUNT(*)) OVER (PARTITION BY client)) * 100, 2
29+
SAFE_DIVIDE(COUNT(1), SUM(COUNT(1)) OVER (PARTITION BY client)) * 100, 2
3030
) AS autoplay_value_pct
3131
FROM
3232
video_data

sql/2025/sustainability/video_preload_values.sql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ SELECT
2424
date,
2525
client,
2626
IF(preload_value = '', '(empty)', preload_value) AS preload_value,
27-
COUNT(*) AS preload_value_count,
27+
COUNT(1) AS preload_value_count,
2828
SAFE_DIVIDE(
29-
COUNT(*), SUM(COUNT(*)) OVER (PARTITION BY date, client)
29+
COUNT(1), SUM(COUNT(1)) OVER (PARTITION BY date, client)
3030
) AS preload_value_pct
3131
FROM
3232
video_data

0 commit comments

Comments
 (0)