comp.lang.ada
 help / color / mirror / Atom feed
From: visicom!amstel!rlk@nosc.mil  (Bob Kitzberger)
Subject: Re: Assy/Ada SLOC ratio;What's an Ada SLOC?
Date: 15 Oct 92 21:33:36 GMT	[thread overview]
Message-ID: <rlk.719184816@amstel> (raw)

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

             reply	other threads:[~1992-10-15 21:33 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1992-10-15 21:33 Bob Kitzberger [this message]
  -- strict thread matches above, loose matches on Subject: below --
1992-10-17 13:41 Assy/Ada SLOC ratio;What's an Ada SLOC? Xmiester
1992-10-16 13:17 Dennis Doubleday
1992-10-15 13:15 cis.ohio-state.edu!zaphod.mps.ohio-state.edu!darwin.sura.net!mlb.semi.har
1992-10-15 12:21 cis.ohio-state.edu!zaphod.mps.ohio-state.edu!darwin.sura.net!mlb.semi.har
1992-10-14 16:55 Mark A Biggar
1992-10-14 12:14 cis.ohio-state.edu!zaphod.mps.ohio-state.edu!darwin.sura.net!aplcen.apl.j
1992-10-09 21:30 Paul Byrley
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox