DupHunter is an AST-driven near-duplicate code detector for Python, designed to uncover structural duplication that often leads to bugs when changes are not consistently applied across all copies. By normalizing abstract syntax trees (ASTs) to account for renamed variables and literals, it can find copy-paste clones even when they appear superficially different. It scales to large codebases using MinHash and LSH indexing, making it a powerful tool for refactoring, code quality, and AI-assisted development workflows.
主要功能
01AST normalization to ignore variable renames
02MinHash + LSH for scalable indexing of large codebases
03Literal normalization to find logic with different data
04Cluster transitive duplicates for comprehensive reporting
051 GitHub stars
06MCP server integration for AI assistant queries
使用案例
01General project-wide code scanning
02Preparing for refactoring by finding similar code to a specific function
03Integrating into CI pipelines for continuous code quality checks