💅 entropyThreshold
option for noSecrets
rules does not have an effect
#4494
Labels
S-Needs triage
Status: this issue needs to be triaged
Environment information
Full Environment Information (probably irrelevant to this bug, but included anyway)
Rule name
lint/nursery/noSecrets
Playground link
https://biomejs.dev/playground/?lintRules=all&code=dAAoACIAbQBpAHMAcwBpAG4AZwBUAHIAYQBuAHMAbABhAHQAaQBvAG4AIgApAA%3D%3D
Expected result
Due to a bug in the implementation of the
no_secrets
rule, theentropyThreshold
setting does not have any observable effect. Because thebase_treshold
is always added to the result of the entropy calculation, it has no purpose because it is meaningless to dobase_threshold + adjusted_entropy > base_threshold
.(Due to type conversions
f64 <-> u16
, the actual comparison is more likefloor(base_threshold + adjusted_entropy) > base_threshold
)biome/crates/biome_js_analyze/src/lint/nursery/no_secrets.rs
Lines 493 to 502 in fbf4b3d
biome/crates/biome_js_analyze/src/lint/nursery/no_secrets.rs
Lines 385 to 389 in fbf4b3d
Code of Conduct
The text was updated successfully, but these errors were encountered: