From 600a767605370ad4334b7b94c066c1dfbaa17f34 Mon Sep 17 00:00:00 2001 From: gargsaumya Date: Mon, 22 Jun 2026 09:37:03 +0530 Subject: [PATCH] Suppress S360 SM05139 finding for DefaultAzureCredential in dev benchmark Add CodeQL inline suppression comments to the credential-cache microbenchmark. The benchmark intentionally uses DefaultAzureCredential to measure credential instance caching overhead; it is a development-only tool, not product code. --- benchmarks/bench_credential_cache.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/benchmarks/bench_credential_cache.py b/benchmarks/bench_credential_cache.py index 4d7403f06..40f1a5a5f 100644 --- a/benchmarks/bench_credential_cache.py +++ b/benchmarks/bench_credential_cache.py @@ -26,7 +26,7 @@ def bench_no_cache(n: int) -> list[float]: times = [] for _ in range(n): start = time.perf_counter() - cred = DefaultAzureCredential() + cred = DefaultAzureCredential() # CodeQL [SM05139] Development-only microbenchmark, not product code; intentionally uses DefaultAzureCredential to measure credential instance caching overhead. cred.get_token("https://database.windows.net/.default") times.append(time.perf_counter() - start) return times @@ -36,7 +36,7 @@ def bench_with_cache(n: int) -> list[float]: """Simulate the NEW behavior: reuse a single credential instance.""" from azure.identity import DefaultAzureCredential - cred = DefaultAzureCredential() + cred = DefaultAzureCredential() # CodeQL [SM05139] Development-only microbenchmark, not product code; intentionally uses DefaultAzureCredential to measure credential instance caching overhead. times = [] for _ in range(n): start = time.perf_counter()