(content: &str, match_position: usize)
| 190 | /// Analyze the context of a matched secret |
| 191 | #[allow(dead_code)] |
| 192 | pub fn analyze_context(content: &str, match_position: usize) -> CodeContext { |
| 193 | // Priority 1: Check if in comment |
| 194 | if is_in_comment(content, match_position) { |
| 195 | return CodeContext::Comment; |
| 196 | } |
| 197 | |
| 198 | // Priority 2: Check if test code |
| 199 | if is_test_code(content, match_position) { |
| 200 | return CodeContext::TestCode; |
| 201 | } |
| 202 | |
| 203 | // Priority 3: Check if example/documentation |
| 204 | if has_example_indicators(content, match_position) { |
| 205 | return CodeContext::Example; |
| 206 | } |
| 207 | |
| 208 | // Default: Assume real code |
| 209 | CodeContext::RealCode |
| 210 | } |
| 211 | |
| 212 | // ═══════════════════════════════════════════════════════════════════ |
| 213 | // PLACEHOLDER DETECTION |
no test coverage detected