topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Tuesday December 3, 2024, 2:47 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Last post Author Topic: NANY 2012 Release: Kyrathaba's Source Code Line Counter  (Read 42220 times)

kyrathaba

  • N.A.N.Y. Organizer
  • Moderator
  • Joined in 2006
  • *****
  • Posts: 3,200
    • View Profile
    • Donate to Member
Introducing Kyrathaba's Source Code Line Counter, a donationware program that, given a project directory, will tally the lines of source code across all source code files within the project (or multiple projects).  Has the option to exclude blank lines and comments.

NANY 2012 Entry Information

Application Name Kyrathaba's Source Code Line Counter
Version 1.0.1.0
Short Descriptioncounts lines of source code across all files in a project (or even across multiple projects) using physical SLOC
Supported OSes Windows XP forward
Setup File KyrSrcLineCounterSetup.zip (~330 Kb)
System Requirementsrequires .NET Framework 4.0; the setup program detects the absence of .NET Framework 4.0 and installs if necessary
Author Infokyrathaba, author of Kyrathaba's Hangman. My past NANY entries include: Crocus Contacts, Blackjack, and NANY Excuse Manager.
DescriptionOption to count or not-count comments and blank lines.
Use standard folder-selection dialog, or drop folder on the listview
Automatically recounts when file extension is changed in the dropdown combo box
Automatically recounts when a folder is dropped on listview
Ability to count files/lines across multiple top-level directories
Supports C, C#, C++, VB, Delphi/Pascal, Bash, Java, AHK, Auto-It
Screenshots
Installationuse the Setup file created by Inno Setup
Using the applicationShould be highly intuitive; I await feedback ([email protected])
Uninstallinguse the uninstaller
Known Issuesnone


« Last Edit: December 30, 2011, 08:00 PM by kyrathaba, Reason: updated version to 1.0.0.9 »

skwire

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 5,287
    • View Profile
    • Donate to Member
Make sure to give this a read: http://en.wikipedia....Source_lines_of_code

kyrathaba

  • N.A.N.Y. Organizer
  • Moderator
  • Joined in 2006
  • *****
  • Posts: 3,200
    • View Profile
    • Donate to Member
Thanks for that link, skwire.  Based on the article, my program is of the type "Physical SLOC" rather than "Logical SLOC" :)

kyrathaba

  • N.A.N.Y. Organizer
  • Moderator
  • Joined in 2006
  • *****
  • Posts: 3,200
    • View Profile
    • Donate to Member
Version 1.0.0.1 is now available.  It adds "Help"->"About" menu/submenu:


srcCodeLineCounterVersion1001.png

kyrathaba

  • N.A.N.Y. Organizer
  • Moderator
  • Joined in 2006
  • *****
  • Posts: 3,200
    • View Profile
    • Donate to Member
I've updated the program to include the ability to check for (and, if available, download) an updated version.  In the process, I've incremented the program's version a few times (during dev-testing), so that's it's up to 1.0.0.5.

Anyone who has installed the program should uninstall, then download v1.0.0.5 and do a fresh install.

Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 3,629
    • View Profile
    • Donate to Member
There's a lot of theory behind SLOC.

I once had a work-assignment to roughly compare the value/weight of the several software packages we have, written in several languages (C, C++, C#, Cobol, Delphi, Java, Modula2, VB is in alphabetic order what I can remember now).
I searched for tools then that could generate some useful statistics based on SLOC, and ended up testing a few and finally settling on CodeCount from USC, in the 2006.05 version back then (Gee was it that long ago :o).

The major reason for selecting CodeCount was that it then gave reasonable and somewhat comparable counts for most of the languages I had to report on (Delphi and Modula2 aren't supported but I think I used another counter that supports Delphi and would eat Modula2, but I can't recall which one) , and all are based on the same measurement types, and from one development team.

I not sure you have the ambition to reach that kind of level or approach, and I'm not really interested in re-doing my tests from back then, but in addition to the Wikipedia article skwire referred to, it could be an interesting article/site for you to read.

Don't have the results of that report at hand, but it must be somewhere in my mail archive. I do recall there was quite a difference between the languages on P-Sloc and L-Sloc ratings (they're both calculated), but I can't even recall any figures just now.

I'll give this one a swing on some of my current projects 8)

kyrathaba

  • N.A.N.Y. Organizer
  • Moderator
  • Joined in 2006
  • *****
  • Posts: 3,200
    • View Profile
    • Donate to Member
I'll give this one a swing on some of my current projects Cool

Cool.  Thanks, Ath!

kyrathaba

  • N.A.N.Y. Organizer
  • Moderator
  • Joined in 2006
  • *****
  • Posts: 3,200
    • View Profile
    • Donate to Member
Version 1.0.0.6 updates the form TitleBar's title to fix a teensy error.  Use "About"->"Update".

kyrathaba

  • N.A.N.Y. Organizer
  • Moderator
  • Joined in 2006
  • *****
  • Posts: 3,200
    • View Profile
    • Donate to Member
Added this program to my blog here.

KynloStephen66515

  • Animated Giffer in Chief
  • Honorary Member
  • Joined in 2010
  • **
  • Posts: 3,758
    • View Profile
    • Donate to Member
Re: NANY 2012 Pledge & Early Beta: Kyrathaba's Source Code Line Counter
« Reply #9 on: September 15, 2011, 04:12 PM »
Just downloaded and ran this.  Works VERY well indeed.  Was actually shocked at how many lines of code my small utility actually has (Even with all the options like blank lines, and designer unchecked).

Out of curiosity...How many lines does your line counter have? :P

kyrathaba

  • N.A.N.Y. Organizer
  • Moderator
  • Joined in 2006
  • *****
  • Posts: 3,200
    • View Profile
    • Donate to Member
Re: NANY 2012 Pledge & Early Beta: Kyrathaba's Source Code Line Counter
« Reply #10 on: September 15, 2011, 05:28 PM »
LOL!  1,905, counting blank lines, comments, and auto-generated code:

linesInSrcCodeCntr.png

kyrathaba

  • N.A.N.Y. Organizer
  • Moderator
  • Joined in 2006
  • *****
  • Posts: 3,200
    • View Profile
    • Donate to Member
Re: NANY 2012 Pledge & Early Beta: Kyrathaba's Source Code Line Counter
« Reply #11 on: September 15, 2011, 05:29 PM »
Glad the program worked well for you!  Always good to hear positive feedback!  :up:

timns

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 1,211
    • View Profile
    • Donate to Member
Re: NANY 2012 Pledge & Early Beta: Kyrathaba's Source Code Line Counter
« Reply #12 on: November 22, 2011, 09:31 PM »
Can this be extended to handle Java and/or Delphi sources?

kyrathaba

  • N.A.N.Y. Organizer
  • Moderator
  • Joined in 2006
  • *****
  • Posts: 3,200
    • View Profile
    • Donate to Member
Re: NANY 2012 Pledge & Early Beta: Kyrathaba's Source Code Line Counter
« Reply #13 on: November 22, 2011, 09:35 PM »
That should be fairly simple, timns.  I'd just add some additional extensions to search parameter.  Will try to get to it (right now I'm busy with a paid project).  Or, if you wish, I can release the source code to you.

timns

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 1,211
    • View Profile
    • Donate to Member
Re: NANY 2012 Pledge & Early Beta: Kyrathaba's Source Code Line Counter
« Reply #14 on: November 23, 2011, 11:18 AM »
No, I can wait - I'd love to see it in the main release if you have time. I'm very sure a lot of other folks would appreciate both Java and Delphi.

Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 3,629
    • View Profile
    • Donate to Member
Re: NANY 2012 Pledge & Early Beta: Kyrathaba's Source Code Line Counter
« Reply #15 on: November 24, 2011, 01:30 AM »
+1 :)

kyrathaba

  • N.A.N.Y. Organizer
  • Moderator
  • Joined in 2006
  • *****
  • Posts: 3,200
    • View Profile
    • Donate to Member
Re: NANY 2012 Pledge & Early Beta: Kyrathaba's Source Code Line Counter
« Reply #16 on: November 24, 2011, 07:57 AM »
Okay, can you guys give me a list of file extensions I'll need to know?

Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 3,629
    • View Profile
    • Donate to Member
Re: NANY 2012 Pledge & Early Beta: Kyrathaba's Source Code Line Counter
« Reply #17 on: November 24, 2011, 09:05 AM »
*.java -> Java source
*.dpr -> Delphi Project (contains mostly source)
*.pas -> Delphi/Pascal source

jgpaiva

  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • View Profile
    • Donate to Member
Re: NANY 2012 Pledge & Early Beta: Kyrathaba's Source Code Line Counter
« Reply #18 on: November 24, 2011, 09:27 AM »
*.sh -> bash source (comments with '#')
*.ahk -> ahk source :) (comments with ';')

kyrathaba

  • N.A.N.Y. Organizer
  • Moderator
  • Joined in 2006
  • *****
  • Posts: 3,200
    • View Profile
    • Donate to Member
Re: NANY 2012 Pledge & Early Beta: Kyrathaba's Source Code Line Counter
« Reply #19 on: November 24, 2011, 11:42 AM »
Okay, guys: I've updated the program to be capable of identifying the files with the extensions you've provided.  Please use Help->About->Update to download the newest version for installation, or you can download a copy from the link in my OP.

timns

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 1,211
    • View Profile
    • Donate to Member
Re: NANY 2012 Pledge & Early Beta: Kyrathaba's Source Code Line Counter
« Reply #20 on: November 24, 2011, 12:02 PM »
It works!  :Thmbsup:

887,726 lines counted in well under a second.

  • Can it automatically recount after changing the file type please?
  • And count the # of files?
  • And make the window sizeable?
  • Can we get it to save previous folder locations and also groups? Many of my projects are spread across several folders (core files, shared resources)
  • How about being able to drag a folder into the window to be counted?



Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 3,629
    • View Profile
    • Donate to Member
Re: NANY 2012 Pledge & Early Beta: Kyrathaba's Source Code Line Counter
« Reply #21 on: November 24, 2011, 02:30 PM »
+1 on all timns just said (except for the lines/speed counted :P)

kyrathaba

  • N.A.N.Y. Organizer
  • Moderator
  • Joined in 2006
  • *****
  • Posts: 3,200
    • View Profile
    • Donate to Member
Re: NANY 2012 Pledge & Early Beta: Kyrathaba's Source Code Line Counter
« Reply #22 on: November 24, 2011, 02:59 PM »
    Can it automatically recount after changing the file type please? DONE!
    And count the # of files? DONE!
    And make the window sizeable? DONE!
    Can we get it to save previous folder locations and also groups? Many of my projects are spread across several folders (core files, shared resources) ON TO-DO LIST!
    How about being able to drag a folder into the window to be counted? DONE!


Please use Help->About->Update to download v1.0.0.8, the newest version for installation, or you can download a copy from the link in my OP.

Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 3,629
    • View Profile
    • Donate to Member
Re: NANY 2012 Pledge & Early Beta: Kyrathaba's Source Code Line Counter
« Reply #23 on: November 24, 2011, 03:06 PM »
Hey, that's fast! :Thmbsup:

Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 3,629
    • View Profile
    • Donate to Member
Re: NANY 2012 Pledge & Early Beta: Kyrathaba's Source Code Line Counter
« Reply #24 on: November 24, 2011, 03:11 PM »
H'm should have thought of AutoIt3 (.au3) when I saw .ahk on that list, the language is a lot like ahk, so should be easy.