
AI智能体的SAST智能。复杂性、热点、爆炸半径和技术债务分析,均覆盖MCP。
概览
呼叫图报告揭示call_resolutions(符号)和输入范围的 resolution_summary(影响)。这些报告区分了唯一名称候选人与模糊且未解决的调用。唯一候选者不是编译器验证的绑定;排除边并不证明编辑是安全的。请参阅改进标准及关于限制和回归门的测量结果。 Omen为AI助手提供了他们所需的上下文:复杂性热点、隐藏依赖、易出缺陷的文件,以及自我承认的债务。一个命令揭示了看不见的东西。 预兆是未来趋势的预兆——无论好坏。你的代码库充满了预兆:低复杂度和干净的架构预示着前路顺畅,而高流失率、技术债务和代码克隆则预示着麻烦即将发生。预兆会浮现这些信号,让你能在“临时修复”迎来生产三周年之前采取行动。
概述(AI 翻译)
呼叫图报告会暴露call_resolutions(符号)和输入范围
resolution_summary(影响)。这些区分了独特的候选人
模糊且未解决的调用。唯一候选者未经过编译器验证
绑定;排除边并不保证编辑是安全的。参见
改进标准和
极限和回归门的测量结果。
你的AI写代码时不知道地雷在哪里。
Omen为AI助手提供了他们所需的上下文:复杂性热点、隐藏依赖、易出缺陷的文件,以及自我承认的债务。一个命令揭示了看不见的东西。
为什么叫“预兆”? 预兆是未来事物的预兆——无论好坏。你的代码库充满了预兆:低复杂度和干净的架构预示着前进顺利,而高流失率、技术债务和代码克隆则预示着麻烦即将酩酝酿。预兆会浮现这些信号,让你能在“临时修复”庆祝生产三周年之前采取行动。
特色
复杂性分析——你的代码有多难理解和测试
复杂度有两种类型:
- 环状复杂性 计算代码中不同路径的数量。
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
Features
There are two types of complexity:
-
Cyclomatic Complexity counts the number of different paths through your code. Every
if,for,while, orswitchcreates a new path. A function with cyclomatic complexity of 10 means there are 10 different ways to run through it. The higher the number, the more test cases you need to cover all scenarios. -
Cognitive Complexity measures how hard code is for a human to read. It penalizes deeply nested code (like an
ifinside aforinside anotherif) more than flat code. Two functions can have the same cyclomatic complexity, but the one with deeper nesting will have higher cognitive complexity because it’s harder to keep track of.
Why it matters: Research shows that complex code has more bugs and takes longer to fix. McCabe’s original 1976 paper found that functions with complexity over 10 are significantly harder to maintain. SonarSource’s cognitive complexity builds on this by measuring what actually confuses developers.
[!TIP]
安装
docker run --rm -v "$(pwd):/repo" ghcr.io/panbanda/omen:latest -p /repo all配置
{
"mcpServers": {
"omen": {
"command": "omen",
"args": ["mcp"]
}
}
}