From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.5-pre1 (2020-06-20) on ip-172-31-74-118.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-1.9 required=3.0 tests=BAYES_00,LOTS_OF_MONEY autolearn=ham autolearn_force=no version=3.4.5-pre1 Date: 15 Oct 92 21:33:36 GMT From: visicom!amstel!rlk@nosc.mil (Bob Kitzberger) Subject: Re: Assy/Ada SLOC ratio;What's an Ada SLOC? Message-ID: List-Id: smccoy@dw3g.ess.harris.com (Scott McCoy) writes: >In the past, I've used 'every non-blank, non-comment line is >a LOC'. Note that this method is highly depend upon programming >and formating style. I know that. But it's a simple way to >count, and if you're consistent, then the data can be meaningful. I agree that for most seat-of-the-pants uses this LOC definition is sufficient. IMHO, algorthmic complexity far overshadows SLOC in terms of important metrics, which McCabe et. al try to address. However McCabe's complexity measures, if I remember correctly, don't take into account the complexity of the problem domain, so flight control software that uises the same depth of loops, nesting of IF statements, etc. as an accounting program will be deemed equal in complexity. For entertainment, here's a simple awk script to count non-blank, non-comment lines. Don't make million-dollar decisions based on it ;-) .Bob. #!/bin/nawk -f BEGIN { cmnt = 0; sloc = 0; blnk = 0; } /^[ \t]*--/ { cmnt++; next; } /^[ \t]*$/ { blnk++; next; } /^*$/ { sloc++; next; } END { printf("Comment lines: %5d\n", cmnt); printf("Blank lines: %5d\n", blnk); printf("SLOC : %5d\n", sloc); printf("-----------------------\n"); printf("Total lines: %5d\n", cmnt+sloc+blnk); } ---------------- Bob Kitzberger VisiCom Laboratories, Inc. rlk@visicom.com 10052 Mesa Ridge Court, San Diego CA 92121 USA +1 619 457 2111 FAX +1 619 457 0888