有没有一些项目可以评价RPG源码? 比如软件指标?

发布于 2024-07-10 07:27:51 字数 1560 浏览 5 评论 0原文

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

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

发布评论

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

评论(4

箜明 2024-07-17 07:27:52

SD 源代码搜索引擎 (SCSE) 是一个用于快速搜索大量源代码的工具代码,使用每个文件的语言结构根据代码元素(标识符、运算符、常量、字符串文字、注释)对文件进行索引。 SD 源代码引擎可用于多种语言,例如 C、C++、C#、Java...并且有 RPG 的草稿版本。

对于OP的原始问题,SCSE引擎在对文件进行索引时恰好计算文件的各种指标,包括SLOC、注释、空行以及Halstead和循环复杂度度量。 这些指标作为索引步骤的副产品提供。 因此,可以获得 RPG 的各种指标。

The SD Source Code Search Engine (SCSE) is a tool for rapidly search very large set of source code, using the langauge structure of each file to index the file according to code elements (identifiers, operators, constants, string literals, comments). The SD Source code engine is usable with a wide variety of langauges such as C, C++, C#, Java ... and there's a draft version of RPG.

To the OP's original question, the SCSE engine happens to compute various metrics over files as it indexes them, including SLOC, Comments, blank lines, and Halstead and Cyclomatic Complexity measures. The metrics are made available as byprooduct of the indexing step. Thus, various metrics for RPG could be obtained.

捎一片雪花 2024-07-17 07:27:52

尽管我为 RPG400 编写了一个原始分析器,但我从未见过。 随着自由形式和子过程的出现,修改起来太耗时了。 我希望有一个 API 可以让我访问编译器词法表。

如果您想自己尝试一下,请考虑阅读编译器列表底部并使用行号至少了解变量的寿命。 例如,全局变量比局部变量“更差”。 由于 GOTO 和 EXSR,这只能是猜测。

大量的工作。

I've never seen one, although I wrote a primitive analyser for RPG400. With the advent of free form and subprocedures, it was too time consuming to modify. I wish there was an API that let me have access to the compiler lexical tables.

If you wanted to try it yourself, consider the notion of reading the bottom of the compiler listing and using the line numbers to at least get an idea of how long a variable lives. For instance, a global variable is 'worse' than a local variable. That can only be a guess because of GOTO and EXSR.

Lot of work.

静待花开 2024-07-17 07:27:51

我们开发了一个名为 SourceMeter 的工具,可以分析符合 RPG III 和 RPG IV 版本(包括免费版本)的源代码形式也是如此)。 它为您提供了 McCabe 圈数和许多其他源代码指标,您可以使用它们来评估 RPG 代码。

We have developed a tool called SourceMeter that can analyze source code conforming to RPG III and RPG IV versions (including free-form as well). It provides you the McCabe Cyclomatic Number and many other source code metrics that you can use to rate your RPG code.

一杯敬自由 2024-07-17 07:27:51

如果问题是程序维护起来很痛苦,那么该指标应该反映维护它们所涉及的痛苦程度,例如“实现新功能 X 的时间”与“如果代码库不是热气腾腾的 POS 的估计时间” 。

然而,这些都是主观的(并且永远都是)。 在我看来,您最好无情地重构以消除开发中的痛点。 您可能需要了解strangler 应用程序的技术,以引入更现代的平台来交付新功能无需诉诸大爆炸重写。

If the issue is that the programs are painful to maintain, then the metric should reflect how how much pain is involved with maintaining them, such as "time to implement new feature X" vs "estimated time if codebase wasn't a steaming POS".

However, those are subjective (and always will be). IMO you're probably better off refactoring mercilessly to remove pain points from your development. You may want to look at the techniques of strangler applications to bring in a more modern platform to deliver new features without resorting to a Big Bang rewrite.

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