4

Can someone please recommend a tool for analyzing, improving, finding "dead code", provide statistics etc. for a source code on COBOL language on VMS/VAX OS and RDB Database?

Thanks.

MT0
  • 143,790
  • 11
  • 59
  • 117

2 Answers2

1

Some compilers have options for locating dead code, so you may already have the tools you desire. Please keep in mind that there are going to be situations where the code is dead and you cannot tell via static source code analysis.

if a = 1
    move 'error' to out-message
end-if

If a can never be 1 then this is dead code. Static source code analysis may not find more complicated instances of this scenario, particularly if the value of a comes from outside the program being analyzed - perhaps a database.

A cursory scan of the static source code analysis tools listed on Wikipedia shows the commercial products are pricy (thousands of euros). The open source tools don't appear to provide much COBOL coverage. You might want to check those out for yourself as I admit I didn't do a thorough evaluation but instead just scanned their documentation.

COBOL is a difficult language to parse.

cschneid
  • 10,237
  • 1
  • 28
  • 39
  • 1
    Pretty much all languages are difficult to parse because they tend to have a lot of content and funny rules that happened over time and ossified into place through compiler or committee. That isn't the problem; with good parsing machinery and lots of empirical testing, you can get good parsers [We have good COBOL parsers]. As a tool vendor, we have to justify the engineering costs of building a tool vs. the expected return. For anything that isn't mainstream, nobody can afford to build cheap tools; this is compounded by the problem that managers and programmers don't want to pay for them. – Ira Baxter Jul 01 '12 at 18:07
1

I have never used it, but the DecSet suite of products includes a product called PCA - Performance and Coverage Analyser. This may be what you are looking for.

ChrisB
  • 96
  • 2
  • PCA is Performance Analyser, it can not give us indication on efficiency of source code, and I couldn't find a way to improve the source code with it. It can , for ex. , indicate whether we're using "too much" DB calls, so it is not quite what we are looking for. – Azarya Youshvaev Jul 02 '12 at 08:49