Re-movery 项目使用教程
Re-movery Re-movery 项目地址: https://gitcode.com/gh_mirrors/re/Re-movery
1. 项目的目录结构及介绍
Re-movery 项目是一个漏洞代码克隆检测工具,其目录结构如下所示:
re-movery/
├── movery/ # Python实现
│ ├── config/ # 配置文件
│ ├── utils/ # 工具类
│ ├── analyzers/ # 分析器
│ ├── detectors/ # 检测器
│ └── reporters/ # 报告生成器
│
├── go/ # Go实现
│ ├── cmd/ # 命令行工具
│ │ └── movery/ # 主程序
│ ├── internal/ # 内部包
│ │ ├── cmd/ # 命令行命令
│ │ ├── config/ # 配置管理
│ │ ├── core/ # 核心功能
│ │ ├── detectors/# 漏洞检测器
│ │ ├── reporters/# 报告生成器
│ │ ├── api/ # API服务器
│ │ └── web/ # Web应用
│ └── pkg/ # 公共包
│
└── docs/ # 文档
movery/
: 包含了 Python 版本的实现,包括配置文件、工具类、分析器、检测器和报告生成器。go/
: 包含了 Go 版本的实现,以及命令行工具、内部包、API服务器和Web应用。docs/
: 存放项目文档。
2. 项目的启动文件介绍
Python 版本
Python 版本的启动主要是通过 movery
脚本,通常在项目根目录下的 movery
文件夹中。
运行以下命令来启动 Python 版本:
python movery.py /path/to/your/code
Go 版本
Go 版本的启动需要先编译项目,然后运行编译后的二进制文件。
编译项目:
cd go
go build -o movery ./cmd/movery
运行编译后的二进制文件:
./movery scan --dir /path/to/directory
3. 项目的配置文件介绍
Re-movery 项目支持配置文件来个性化设置项目参数。
Python 版本
Python 版本的配置文件为 config.json
,通常位于项目根目录。配置文件内容如下:
{
"processing": {
"num_processes": 4,
"enable_cache": true
}
}
num_processes
: 设置并行处理的进程数。enable_cache
: 是否启用结果缓存机制。
Go 版本
Go 版本的配置文件支持 JSON 和 YAML 格式,例如 re-movery.yaml
:
scanner:
parallel: true
incremental: true
confidenceThreshold: 0.7
excludePatterns:
- node_modules
- "*.min.js"
web:
host: localhost
port: 8080
debug: false
server:
host: localhost
port: 8081
debug: false
parallel
: 是否启用并行处理。incremental
: 是否启用增量扫描。confidenceThreshold
: 置信度阈值。excludePatterns
: 排除特定文件或目录的模式列表。web
和server
部分分别用于配置 Web 界面和 API 服务器的参数。
Re-movery Re-movery 项目地址: https://gitcode.com/gh_mirrors/re/Re-movery
创作声明:本文部分内容由AI辅助生成(AIGC),仅供参考