Loading...
Loading...
Compare original and translation side by side
| CRAP Score | Risk Level | Interpretation |
|---|---|---|
| < 5 | Low | Simple and well-tested |
| 5-15 | Moderate | Acceptable for most code |
| 15-30 | High | Needs more tests or simplification |
| > 30 | Critical | Refactor and add coverage urgently |
| CRAP得分 | 风险等级 | 释义 |
|---|---|---|
| < 5 | 低 | 代码简单且测试覆盖完善 |
| 5-15 | 中等 | 对大部分代码来说可接受 |
| 15-30 | 高 | 需要补充测试或简化代码 |
| > 30 | 严重 | 急需重构并补充测试覆盖率 |
run-testswriting-mstest-testsrun-testswriting-mstest-tests| Input | Required | Description |
|---|---|---|
| Target scope | Yes | Method name, class name, or file path to analyze |
| Test project path | No | Path to the test project. Defaults to discovering test projects in the solution. |
| Source project path | No | Path to the source project under analysis |
| 输入项 | 是否必填 | 描述 |
|---|---|---|
| 目标范围 | 是 | 要分析的方法名、类名或文件路径 |
| 测试项目路径 | 否 | 测试项目的路径。默认会自动发现解决方案中的测试项目。 |
| 源项目路径 | 否 | 待分析的源项目路径 |
dotnet test.csproj| Coverage Package | Command | Output Location |
|---|---|---|
| | Typically under |
| | |
| | |
dotnet test.csproj| 覆盖率包 | 命令 | 输出位置 |
|---|---|---|
| | 通常位于 |
| | |
| | |
| Construct | Example |
|---|---|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| Pattern match arm | |
| 语法结构 | 示例 |
|---|---|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| 模式匹配分支 | |
line-rate<class>line-rate<lines><class>line-rateline-rate<lines>| Method | Complexity | Coverage | CRAP Score | Risk |
|---------------------------------|------------|----------|------------|----------|
| OrderService.ProcessOrder | 12 | 45% | 28.4 | High |
| OrderService.ValidateItems | 8 | 90% | 8.1 | Moderate |
| OrderService.CalculateTotal | 3 | 100% | 3.0 | Low || Method | Complexity | Coverage | CRAP Score | Risk |
|---------------------------------|------------|----------|------------|----------|
| OrderService.ProcessOrder | 12 | 45% | 28.4 | High |
| OrderService.ValidateItems | 8 | 90% | 8.1 | Moderate |
| OrderService.CalculateTotal | 3 | 100% | 3.0 | Low |ProcessOrderComplexMethodProcessOrderComplexMethod*.Designer.cs*.g.cs*.Designer.cs*.g.cs