MCPcopy Create free account
hub / github.com/KingOfBugbounty/enumrust / has_example_indicators

Function has_example_indicators

src/secret_validators.rs:167–188  ·  view source on GitHub ↗
(content: &str, position: usize)

Source from the content-addressed store, hash-verified

165/// Detect if content contains example/documentation indicators
166#[allow(dead_code)]
167pub fn has_example_indicators(content: &str, position: usize) -> bool {
168 let example_indicators = [
169 "example", "Example", "EXAMPLE",
170 "sample", "Sample", "SAMPLE",
171 "demo", "Demo", "DEMO",
172 "placeholder", "Placeholder", "PLACEHOLDER",
173 "TODO:", "FIXME:", "NOTE:", "HACK:",
174 "Replace with", "Change this", "Insert your",
175 "your-", "my-", "our-",
176 "documentation", "README", "docs/",
177 "<your", "<my", "{{", "}}", "${",
178 ];
179
180 // Check within 250 chars before and after
181 let start = position.saturating_sub(250);
182 let end = (position + 250).min(content.len());
183 let nearby_content = &content[start..end];
184
185 example_indicators.iter().any(|indicator| {
186 nearby_content.contains(indicator)
187 })
188}
189
190/// Analyze the context of a matched secret
191#[allow(dead_code)]

Callers 1

analyze_contextFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected