We don’t allow questions seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(4)
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.
尽管我为 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.
我们开发了一个名为 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.
如果问题是程序维护起来很痛苦,那么该指标应该反映维护它们所涉及的痛苦程度,例如“实现新功能 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.