Skip to content

Commit c996e48

Browse files
committed
feat(test-harness): implement comprehensive test definitions for 9 search & analysis tools
Phase 1 - Search Tools Enhancement (Complete): ✅ find_files - 10 comprehensive test scenarios with pattern matching, filtering, error handling ✅ content_stats - 9 comprehensive test scenarios with language breakdown, quality metrics ✅ detect_patterns - 13 comprehensive test scenarios with design patterns, anti-patterns, language-specific analysis Phase 2 - Analysis Tools Implementation (5 of 13 complete): ✅ analyze_security - 14 comprehensive test scenarios with OWASP Top 10, language-specific security patterns ✅ analyze_performance - 15 comprehensive test scenarios with algorithmic complexity, memory analysis, I/O performance ✅ analyze_complexity - 17 comprehensive test scenarios with cyclomatic, cognitive, Halstead complexity metrics ✅ find_duplicates - 18 comprehensive test scenarios with similarity algorithms, cross-language detection ✅ find_unused_code - 18 comprehensive test scenarios with imports, functions, variables, classes analysis All implementations include: - Parameter validation with edge cases and error conditions - Language-specific analysis patterns (Rust, Python, JavaScript) - Performance testing with timing constraints - File filtering and scope control - Detailed reporting and statistics options - Real MCP tool execution (no placeholders) Progress: 9/17 tools complete (53% of Issue #92) Remaining: 8 tools need comprehensive implementations addresses #92
1 parent 823c540 commit c996e48

4 files changed

Lines changed: 1092 additions & 27 deletions

File tree

.cursor/rules/agent-workflow.mdc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ alwaysApply: true
1111

1212
## Work Organization and Planning
1313

14+
**Rule: Create temporary files in the cursor_workspace folder**
15+
Why: Creaitng files under /tmp requires user aproaval and breaks the flow, so create them in a folder in workspace that is not commited to git.
16+
1417
**Rule: Organize work as milestones, phases, and priorities - never add timelines, schedules, or estimates.**
1518
Why: Agile development focuses on value delivery over time predictions. Estimates are often inaccurate and create false expectations. Priorities and milestones provide clear direction without artificial time constraints.
1619

crates/codeprism-test-harness/src/reporting/cicd.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ impl ExitCodeManager {
188188
}
189189

190190
/// Generate artifacts for CI/CD systems
191+
#[allow(dead_code)]
191192
pub struct ArtifactGenerator;
192193

193194
impl ArtifactGenerator {
@@ -196,6 +197,7 @@ impl ArtifactGenerator {
196197
}
197198

198199
/// Generate test artifacts for CI/CD
200+
#[allow(dead_code)]
199201
pub async fn generate_artifacts(
200202
&self,
201203
report: &Report,
@@ -242,6 +244,7 @@ impl ArtifactGenerator {
242244

243245
/// Information about generated artifacts
244246
#[derive(Debug, Clone)]
247+
#[allow(dead_code)]
245248
pub struct ArtifactInfo {
246249
pub name: String,
247250
pub path: std::path::PathBuf,
@@ -250,6 +253,7 @@ pub struct ArtifactInfo {
250253

251254
/// Types of artifacts that can be generated
252255
#[derive(Debug, Clone)]
256+
#[allow(dead_code)]
253257
pub enum ArtifactType {
254258
Report,
255259
Data,
@@ -287,7 +291,7 @@ mod tests {
287291

288292
#[test]
289293
fn test_exit_code_success() {
290-
let manager = ExitCodeManager::new();
294+
let _manager = ExitCodeManager::new();
291295
// Would need to create a mock report with no failures
292296
// assert_eq!(manager.determine_exit_code(&mock_report), 0);
293297
}

crates/codeprism-test-harness/src/reporting/diagnostics.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ impl ErrorPatternAnalyzer {
287287
failures: &[super::FailureDetail],
288288
) -> Vec<super::FailurePattern> {
289289
let mut pattern_analysis = HashMap::new();
290-
let mut tool_mapping: HashMap<String, Vec<String>> = HashMap::new();
290+
let _tool_mapping: HashMap<String, Vec<String>> = HashMap::new();
291291

292292
// Advanced pattern detection
293293
for failure in failures {

0 commit comments

Comments
 (0)