计算代码行数 - 质量指标

发布于 2024-09-01 18:26:37 字数 77 浏览 3 评论 0原文

我正在为我的 Java 项目获取代码行,该项目也包含大量 XML 文件。现在我的问题是计算代码行数时。我还需要考虑 XML 代码行吗?请帮忙

I'm taking the lines of code for my Java project , the project contains lot of XML files too. Now my question is when calculating lines of code. Do i need to consider XML lines of code as well? Please help

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

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

发布评论

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

评论(2

盛夏尉蓝 2024-09-08 18:26:37

在我看来,计算代码行数是一个糟糕的质量指标。当我删除数百行代码时,我认为这是美好的一天。

不过回答你的问题。如果您的 XML 是手写的并且表示配置您的应用程序的元数据,那么是的,我会认为它是代码。

IMO counting lines of code is a terrible quality metric. I consider it a great day when I remove hundreds of lines of code.

However answering your question. if your XML is handwritten and represents metadata that configures your application then yes I'd consider it to be code.

不美如何 2024-09-08 18:26:37

这取决于 xml 是表示数据还是某种 DSL。

如果它只是数据,那么我会从 LOC 指标中忽略它。但是,如果它类似于 NAnt 脚本,本质上是用 xml 进行编程,那么我会很想将其算作 LOC。

It depends if the xml is representing data or if it is a DSL of some sort.

If it is just data then I'd ignore it from a LOC metric. However, if it is something like a NAnt script which is essentially programming in xml then I would be tempted to count it as LOC.

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