关于“超出范围”的报告会员

发布于 2024-11-15 09:02:57 字数 243 浏览 7 评论 0原文

我正在开发一个高度可扩展的产品,并且有一个 SDK。我们必须检查的是,成员和类的可见性不大于要求。程序集成员的可见性越高,它所需要的“维护”就越多。

我想要一个可以生成报告作为夜间构建一部分的工具,该工具通过分析程序集,可以告诉我是否引入了“过度可见”的内容 - 即标记为公共/受保护,但仅使用在同一程序集中...等等。

有什么可以做到这一点吗? 我看过 NDepend,但它非常复杂,而且我无法制作一个 CQL 表达式来完成我想要的操作。

I am working on a product which is highly extensible, and has an SDK. Something that we must keep a check on, is that member and class visibility is not greater than required. The higher the visibility of a member of an assembly, the more 'maintenance' it incurs.

I would like a tool that can generate a report as part of the nightly build, which by analysing the assemblies, can tell me if anything has been introduced that is 'overly visible' - i.e. is marked as public/protected, but is only used within same assembly... and so on.

Is there anything out there that can do this?
I have looked at NDepend, but its very complicated, and I couldnt craft a CQL expression that did what I wanted.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

野稚 2024-11-22 09:02:57

使用 NDepend 分析代码,然后在 Code Rules and Queries over LINQ Explorer 面板中查看可见性组。该组包含多个 CQLinq 规则,用于警告超出范围的类型和成员:

Visibility group

这些规则包括:

这样的规则可以是 在 VisualStudio 中实时检查 或在在夜间构建 CI 过程中生成的报告。在 VS 中实时运行这样的规则如下所示:

在此处输入图像描述

Analyze your code with NDepend, then in the Code Rules and Queries over LINQ Explorer panel see the Visibility group. This group contains several CQLinq rules that warn about over scoped types and members:

Visibility group

These rules include:

Such rule can be checked live in VisualStudio or in a report produced during nightly build CI process. Running such a rule live in VS looks like:

enter image description here

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文