Skip to main content

Crate codesearch

Crate codesearch 

Source
Expand description

CodeSearch - A fast CLI tool for searching codebases

This library provides code search functionality with support for:

  • Regex and fuzzy search
  • Multi-language support
  • Codebase analysis
  • Complexity metrics
  • Duplicate detection
  • Dead code detection
  • Interactive mode
  • MCP server integration

Re-exports§

pub use analysis::analyze_codebase;
pub use ast::AstAnalysis;
pub use ast::AstParser;
pub use ast::AstSyntaxEdge;
pub use ast::ClassInfo;
pub use ast::FunctionInfo;
pub use ast::SyntaxRelationshipType;
pub use ast::analyze_file;
pub use ast::get_syntax_edges;
pub use callgraph::CallGraph;
pub use callgraph::CallNode;
pub use callgraph::build_call_graph;
pub use cfg::BasicBlock;
pub use cfg::ControlFlowGraph;
pub use cfg::analyze_file_cfg;
pub use cfg::build_cfg_from_source;
pub use circular::CircularCall;
pub use circular::detect_circular_calls;
pub use circular::find_circular_calls;
pub use codemetrics::FileMetrics;
pub use codemetrics::ProjectMetrics;
pub use codemetrics::analyze_file_metrics;
pub use codemetrics::analyze_project_metrics;
pub use codemetrics::print_metrics_report;
pub use complexity::calculate_cognitive_complexity;
pub use complexity::calculate_cyclomatic_complexity;
pub use complexity::calculate_file_complexity;
pub use deadcode::DeadCodeItem;
pub use deadcode::detect_dead_code;
pub use deadcode::find_dead_code;
pub use depgraph::DependencyGraph;
pub use depgraph::DependencyNode;
pub use depgraph::build_dependency_graph;
pub use designmetrics::DesignMetrics;
pub use designmetrics::ModuleMetrics;
pub use designmetrics::analyze_design_metrics;
pub use designmetrics::print_design_metrics;
pub use dfg::DataFlowGraph;
pub use dfg::DfgNode;
pub use dfg::analyze_file_dfg;
pub use dfg::build_dfg_from_source;
pub use duplicates::detect_duplicates;
pub use duplicates::find_duplicates;
pub use extract::extract_classes;
pub use extract::extract_function_calls;
pub use extract::extract_functions;
pub use extract::extract_identifier_references;
pub use find::FindReport;
pub use find::FindResult;
pub use find::FindType;
pub use find::find_symbol;
pub use find::print_find_report;
pub use githistory::CommitInfo;
pub use githistory::GitSearchResult;
pub use githistory::GitSearcher;
pub use githistory::search_git_history;
pub use graphs::GraphAnalysisResult;
pub use graphs::GraphAnalyzer;
pub use graphs::GraphType;
pub use health::HealthReport;
pub use health::print_health_report;
pub use health::scan_health;
pub use index::CodeIndex;
pub use index::IndexEntry;
pub use index::IndexStats;
pub use language::LanguageInfo;
pub use language::get_supported_languages;
pub use memopt::FileReader;
pub use memopt::StreamingSearcher;
pub use pdg::ProgramDependencyGraph;
pub use pdg::analyze_file_pdg;
pub use pdg::build_pdg_from_source;
pub use remote::RemoteSearchResult;
pub use remote::RemoteSearcher;
pub use remote::search_remote_repository;
pub use search::list_files;
pub use search::print_results;
pub use search::print_search_stats;
pub use search::search_code;
pub use security::SecurityFinding;
pub use security::SecurityKind;
pub use security::Severity;
pub use security::print_security_report;
pub use security::scan_security_patterns;
pub use types::ComplexityMetrics;
pub use types::DuplicateBlock;
pub use types::FileInfo;
pub use types::Match;
pub use types::RefactorSuggestion;
pub use types::SearchResult;
pub use unified::EdgeCategory;
pub use unified::UnifiedEdge;
pub use unified::UnifiedGraph;
pub use unified::build_unified_graph;
pub use unified::trace_data_flow_forward;
pub use unified::trace_data_flow_in_path;
pub use watcher::FileWatcher;
pub use watcher::start_watching;
pub use fs::FileSystem;
pub use fs::MockFileSystem;
pub use fs::RealFileSystem;
pub use fs::WalkOptions;
pub use fs::collect_files;
pub use fs::create_filtered_walker;

Modules§

analysis
Codebase Analysis Module
ast
AST-Based Code Analysis Module
cache
Cache Module
cache_lru
LRU Cache Implementation
callgraph
Call Graph Module
cfg
Control Flow Graph (CFG) Module
circular
Circular Call Detection Module
cli
CLI argument definitions and parsing
codemetrics
Comprehensive Code Metrics Module
commands
Command Handlers Module
complexity
Complexity Analysis Module
deadcode
Dead Code Detection Module
depgraph
Dependency Graph Analysis Module
designmetrics
Design Metrics Module
dfg
Data Flow Graph (DFG) Module
duplicates
Code Duplication Detection Module
errors
Error Types Module
export
Export Module
extract
Regex-based code extraction for analysis modules
find
Structural symbol find: definitions, references, callers
fs
File System Abstraction Module
githistory
Git History Search Module
graphs
Unified Graph Analysis Module
health
Unified codebase health scan
index
Incremental Indexing Module
interactive
Interactive Mode Module
language
Language Support Module
memopt
Memory-Optimized File Reading Module
parser
Native parser implementations for multiple programming languages
pdg
Program Dependency Graph (PDG) Module
remote
Remote Repository Search Module
search
Search Module
security
Basic security pattern detection
traits
Trait Abstractions Module
types
Shared Types Module
unified
Unified Code Graph (lightweight CPG)
watcher
File Watching Module