Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Counting lines of code?

  • 07-05-2001 8:46pm
    #1
    Registered Users, Registered Users 2 Posts: 21,264 ✭✭✭✭


    Is there a tool for doing this? In MSDN prehaps?

    I mean I can write one easy enough for the C++ but just wondering if there is a proggy out there that already does it?

    (too many +)

    [This message has been edited by Hobbes (edited 07-05-2001).]


Comments

  • Registered Users, Registered Users 2 Posts: 21,264 ✭✭✭✭Hobbes


    Found this...

    http://www.dwheeler.com/sloccount/

    But doesn't seem to do everything I want. eg. ASP.


  • Registered Users, Registered Users 2 Posts: 16,414 ✭✭✭✭Trojan


    There's tonnes of UNIX ones that you could use, can't remember the names offhand but you could use Cygwin to run them.

    Al.


  • Registered Users, Registered Users 2 Posts: 21,264 ✭✭✭✭Hobbes


    <font face="Verdana, Arial" size="2">Originally posted by Catch_22:
    yeh wc -l for example :P</font>

    That's just a line counter. Not a source code line counter. Remark statements are generally not considered code.


  • Registered Users, Registered Users 2 Posts: 432 ✭✭Catch_22


    yeh i know, twas a joke, hence the :P,
    its not like ive bothered figuring out how to do the proper smilies here

    but im bored here so heres another one,
    i might actually go as far as doing a proper on in perl at this rate ..

    comment="//"; #for example
    cat $file |grep ..* |grep -v $comment |wc -l

    c22


  • Registered Users, Registered Users 2 Posts: 432 ✭✭Catch_22


    arrgh, only end up making a fool of myself here, but i managed a mistake in the one line i put up there, should be |grep -v ^$comment to account for lines that have source & comment,

    anyways havent come across any decent line counters, http://www.enteract.com/~bradapp/clearperl/sclc.html

    is about the best i found, but it doesnt seem to cover as many languages as the one you have,

    i think thats enought stupidity for today,

    c22


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 432 ✭✭Catch_22


    yeh wc -l for example :P


  • Registered Users, Registered Users 2 Posts: 16,414 ✭✭✭✭Trojan


    Anyone got a DOS loc counter? I don't have time to set up cygwin at the mo (tho it's a class tool)...

    Al.


  • Registered Users, Registered Users 2 Posts: 21,264 ✭✭✭✭Hobbes


    Not sure where to pick them up though. frown.gif
    <font face="Verdana, Arial" size="2">
    Code Metric is a Visual C++ line-counting and formatting utility. It will read all of the projects and files in a workspace, and automatically count lines and comments. The code can then be formatted in a variety of styles. Formatting options include indenting, brace handling, white space, and several other choices. Code Metric comes as a standalone program and as an add-in to Visual C++. The shareware version displays registration reminder dialogs; the registered version costs $39.

    and

    "Source Code Counter (SCC) is a Line of code counter used to count the number of lines of code in a given software file or project. Source Code Counter can accurately count almost any language that uses comment line and comment block delimiters. SCC has been preset to count most High Order Languages including C,C++,Java and Visual basic. SCC also permits to recursively count files in a directory based on a selected High Order Language, or automatically count all of the known file types in a directory."

    </font>


  • Registered Users, Registered Users 2 Posts: 16,414 ✭✭✭✭Trojan


    ok, time to get off my a$$...

    Some counters here: http://download.cnet.com/downloads/1,10150,0-3897188-103-0-1-7,00.html?tag=srch&qt=count&cn=Software+Development&ca=3897188

    I like LineCount cos its only 53kb so I'll give that a shot ( http://download.cnet.com/downloads/0-10090-100-2672664.html?tag=st.dl.3897188-103-1.lst-7-5.2672664 )

    The one SCC you mentioned Hobbes, is at http://download.cnet.com/downloads/0-10090-100-2344758.html?tag=st.dl.3897188-103-1.lst-7-3.2344758

    Running off to do stuff for an hour, if you grab any of these before then let me know how you get on.

    Cheers,
    Al.


Advertisement