Home | Blog | Software | Reviews and Features | Forum | Help | Donate | About us
topbanner_forum
  *

avatar image

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

Login with username, password and session length
  • September 04, 2015, 02:54:24 AM
  • Proudly celebrating 10 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 14785 times)

kyrathaba

  • N.A.N.Y. Organizer
  • Moderator
  • Joined in 2006
  • *****
  • Posts: 3,088
    • View Profile
    • Read more about this member.
    • Donate to Member
NANY 2012 Release: Kyrathaba's Source Code Line Counter
« on: July 02, 2011, 09:43:34 AM »
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 (kyrathasoft@gmail.com)
Uninstallinguse the uninstaller
Known Issuesnone


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

skwire

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 4,393
    • View Profile
    • Donate to Member
Re: NANY 2012 Pledge & Early Beta: Kyrathaba's Source Code Line Counter
« Reply #1 on: July 03, 2011, 01:16:47 AM »
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,088
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: NANY 2012 Pledge & Early Beta: Kyrathaba's Source Code Line Counter
« Reply #2 on: July 03, 2011, 07:31:01 AM »
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,088
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: NANY 2012 Pledge & Early Beta: Kyrathaba's Source Code Line Counter
« Reply #3 on: July 03, 2011, 09:58:10 PM »
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,088
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: NANY 2012 Pledge & Early Beta: Kyrathaba's Source Code Line Counter
« Reply #4 on: July 04, 2011, 04:41:15 PM »
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: 2,539
    • View Profile
    • Donate to Member
Re: NANY 2012 Pledge & Early Beta: Kyrathaba's Source Code Line Counter
« Reply #5 on: July 05, 2011, 03:22:08 PM »
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,088
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: NANY 2012 Pledge & Early Beta: Kyrathaba's Source Code Line Counter
« Reply #6 on: July 05, 2011, 05:37:52 PM »
Quote
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,088
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: NANY 2012 Pledge & Early Beta: Kyrathaba's Source Code Line Counter
« Reply #7 on: July 07, 2011, 10:28:53 PM »
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,088
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: NANY 2012 Pledge & Early Beta: Kyrathaba's Source Code Line Counter
« Reply #8 on: August 09, 2011, 07:46:42 PM »
Added this program to my blog here.

Stephen66515

  • Animated Giffer in Chief
  • Honorary Member
  • Joined in 2010
  • **
  • Posts: 3,003
    • 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:22 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,088
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: NANY 2012 Pledge & Early Beta: Kyrathaba's Source Code Line Counter
« Reply #10 on: September 15, 2011, 05:28:50 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,088
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: NANY 2012 Pledge & Early Beta: Kyrathaba's Source Code Line Counter
« Reply #11 on: September 15, 2011, 05:29:17 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
    • Read more about this member.
    • Donate to Member
Re: NANY 2012 Pledge & Early Beta: Kyrathaba's Source Code Line Counter
« Reply #12 on: November 22, 2011, 09:31:20 PM »
Can this be extended to handle Java and/or Delphi sources?

kyrathaba

  • N.A.N.Y. Organizer
  • Moderator
  • Joined in 2006
  • *****
  • Posts: 3,088
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: NANY 2012 Pledge & Early Beta: Kyrathaba's Source Code Line Counter
« Reply #13 on: November 22, 2011, 09:35:18 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
    • Read more about this member.
    • Donate to Member
Re: NANY 2012 Pledge & Early Beta: Kyrathaba's Source Code Line Counter
« Reply #14 on: November 23, 2011, 11:18:38 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: 2,539
    • 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:04 AM »
+1 :)

kyrathaba

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

Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 2,539
    • 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:22 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
    • Read more about this member.
    • Donate to Member
Re: NANY 2012 Pledge & Early Beta: Kyrathaba's Source Code Line Counter
« Reply #18 on: November 24, 2011, 09:27:14 AM »
*.sh -> bash source (comments with '#')
*.ahk -> ahk source :) (comments with ';')

kyrathaba

  • N.A.N.Y. Organizer
  • Moderator
  • Joined in 2006
  • *****
  • Posts: 3,088
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: NANY 2012 Pledge & Early Beta: Kyrathaba's Source Code Line Counter
« Reply #19 on: November 24, 2011, 11:42:16 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
    • Read more about this member.
    • Donate to Member
Re: NANY 2012 Pledge & Early Beta: Kyrathaba's Source Code Line Counter
« Reply #20 on: November 24, 2011, 12:02:27 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: 2,539
    • 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:56 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,088
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: NANY 2012 Pledge & Early Beta: Kyrathaba's Source Code Line Counter
« Reply #22 on: November 24, 2011, 02:59:22 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: 2,539
    • 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:12 PM »
Hey, that's fast! :Thmbsup:

Ath

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 2,539
    • 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:41 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.