comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Code Metrics tools for IDL
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Code Metrics tools for IDL [message #36224] Thu, 28 August 2003 10:05 Go to previous message
Liam E. Gumley is currently offline  Liam E. Gumley
Messages: 378
Registered: January 2000
Senior Member
"John" <jgreive@starband.net> wrote in message
news:c53c914e.0308280754.25f84ccb@posting.google.com...
> Hello,
> Does anyone know of any tools to calculate quality metrics for IDL
> code. For example, does anyone have a tool that would calculate
> cyclomatic complexity metrics?

See "Code Complete" by Steve McConnell, pp 394-396. To paraphrase:

The McCabe complexity for a routine may be estimated as follows:

(1) Start with 1 for the straight path through the routine

(2) Add 1 for each of the following control statements: IF, WHILE, REPEAT,
FOR, AND, OR

(3) Add 1 for each case in a CASE statement

Guidelines: if the complexity is
0-5 The routine is probably fine
6-10 Think about ways to simplify the routine
10+ Break part(s) of the routine into smaller routines which can be
called from within the parent routine

No doubt you could write a shell script to parse an IDL source file and
compute the total complexity.

Cheers,
Liam.
Practical IDL Programming
http://www.gumley.com/
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: how to make polygons created by idlgrpolygon transparent?
Next Topic: Re: how to make polygons created by idlgrpolygon transparent?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 19:55:28 PDT 2025

Total time taken to generate the page: 0.00874 seconds