# 静态代码分析

> For the complete documentation index, see [llms.txt](https://www.jetbrains.com/zh-cn/help/clion/llms.txt).

在 CLion 中，有一组代码检查可以在编译之前检测并纠正项目中的异常代码。 IDE 可以发现并高亮显示各种问题，定位无效代码，发现可能的错误、拼写问题，并改进整体代码结构。

检查可以扫描项目文件中的所有代码或仅扫描特定 [作用域](configuring-scopes-and-file-colors.html)（例如，仅在生产代码或修改过的文件中）。

每个检查都有一个 [严重程度](configuring-inspection-severities.html)——问题对您的代码可能产生的影响程度。 编辑器中不同严重性的问题会以不同方式高亮显示，以便您能够快速区分关键问题和不太重要的事情。 CLion 附带一组预定义的严重性级别，并允许您创建自己的级别。

检查及其设置被归类于 [profiles](customizing-profiles.html)中。 每个配置文件包含有关启用检查的信息、它们分析的文件作用域及其严重级别。

> **Tip:**
> 作为额外的外部分析器，您可以通过 [Cppcheck 插件](https://plugins.jetbrains.com/plugin/8143-cppcheck)使用 [cppcheck](http://cppcheck.sourceforge.net/)，或者通过 [SonarLint 插件](https://plugins.jetbrains.com/plugin/7973-sonarlint)使用 [SonarLint](https://www.sonarlint.org/)。

Procedure: 访问检查设置

要编辑检查和 [检查配置文件](customizing-profiles.html)，请执行以下操作之一：

* Go 到   编辑器｜检查  设置页面 `Ctrl+Alt+S` (Windows), `⌘ Comma` (macOS), `⌘ Comma` (IntelliJ IDEA Classic (macOS)), `⌘ Comma` (macOS System Shortcuts), `Ctrl+Alt+S` (XWin), `Ctrl+Alt+S` (GNOME), `Ctrl+Alt+S` (KDE), `Ctrl+Alt+S` (Emacs), `Ctrl+Alt+S` (Sublime Text), `⌘ Comma` (Sublime Text (macOS)), `⌘ Comma` (Xcode), `Ctrl+Alt+S` (Visual Studio), `⌘ Comma` (Visual Studio (macOS)), `Ctrl+Alt+S` (ReSharper), `⌘ Comma` (ReSharper (macOS)), `Ctrl+Alt+S` (QtCreator), `⌘ Comma` (QtCreator (macOS)), `Ctrl+Alt+S` (NetBeans), `Ctrl+Alt+S` (Eclipse), `⌘ Comma` (Eclipse (macOS))

![检查设置](https://resources.jetbrains.com/help/img/idea/2026.3/cl_inspections_settings.png)

* 将鼠标悬停在编辑器右上角的检查小部件上，点击 ![更多 按钮](https://resources.jetbrains.com/help/img/idea/2026.3/app.actions.more.svg)，然后选择   配置检查  ：

![从编辑器小部件访问检查设置](https://resources.jetbrains.com/help/img/idea/2026.3/cl_access_inspectionssettings_from_widget.png)

* 在编辑器中，打开建议列表，点击右箭头，然后在子菜单中选择  `编辑检查配置文件设置` 。

* 在 [问题工具窗口](problems-tool-window.html)中，点击工具栏上的   编辑设置   ![](https://resources.jetbrains.com/help/img/idea/2026.3/app.expui.general.settings.svg)，或使用相应的上下文菜单命令。

请使用 ![筛选图标](https://resources.jetbrains.com/help/img/idea/2026.3/app.expui.general.filter.svg) 筛选检查列表。 例如，您可以按严重性或语言筛选检测。

> **Note:**
> 选中   默认禁用新检查  复选框以禁用来自已安装插件的新检查，因为它们可能会影响您的检查配置文件。

## See also

### 流程

[意图操作](intention-actions.html)

### 参考

[检查](inspections-settings.html) [作用域](settings-scopes.html) [问题工具窗口](problems-tool-window.html)

### 外部链接

[Check lambda support in IntelliJ IDEA 12 EAP](http://blogs.jetbrains.com/idea/2012/08/check-lambda-support-in-intellij-idea-12-eap-build-122202/)

