Free App to Count Lines of Code

I did not want to hijack the conversation about the merits (or lack thereof) of counting lines of code, but I have developed a little app that will take an XOJO™ project file in XML format, and produce a report of all the modules, classes and methods counting how many “code” lines, white space lines and comment lines there are.

A code line with a comment on the end counts as a code line :slight_smile:

I have tested it under OSX (10.11.5) and Win10.

www.rdS.com/xojo_analyze_osx.zip
www.rdS.com/xojo_analyze_win.zip

Please post a comment if you do download it, and any suggestions etc…

Also, if anyone is bored and wants to come up with a nifty app icon :slight_smile:

Thank you, Dave! Seems to work great :slight_smile:

[quote=271437:@jean-paul devulder]hi Dave,

Doesn’t want load simple Xml project for me

Example here: [/quote]

the file extension must be .xojo_xml_project
previous versions of XOJO may have used other extenstions, but this is the only one this app will recognize
I changed the extension of your file to this, and it worked just fine.

Analyze_win works fine here. Impressive work David.

Just tested on Win7 X64 using a project saved with Xojo 2016R1.1

Analyze_win works fine for me. :smiley:

Thanks Dave!

it doesn’t seems to take into account the external items of the project ?

it does not

I use a lot of container controls in my projects and these are not shown but their events are itemised.

Sorry, Dave, I was wrong. They are shown separately, my mistake.

I like it, great work. Thank you.

Per suggestion pointed out by Simon, I have modified the code to classify containers as “containers” and not windows… this is based on the superclass designator.

New versions are available at the links above.

Starting with this version… a version # will appear in the upper right corner of the window

so my big multi-databases app is only 99 lines long ! :wink:

Tight code :slight_smile:

Tight code would be 97 lines of code :stuck_out_tongue:

Ah Jean is a profligate coder then ?

33239 lines of Code :slight_smile:

http://images.schneppi-software.de/WAG5_loc.html

Maybe the 2 extra lines were comments? :stuck_out_tongue:

35733 for GraffitiSuite Desktop demo.
18095 (not including Javascript) for GraffitiSuite Web demo.

Thanks, Dave, very nice tool.

JUST the IDE - 229,000 (no frameworks no compiler etc)

It does now :slight_smile:

Since External Items can be either Binary or XML, it will report all of them, but indicate the BINARY ones cannot be analyzed.
Also if for some reason an External Item cannot be found, that too will be reported.

same links as above

Dave, nice work, output format is easy to read, thanks. Lines of code looks about right, but under Comments it says, 114981030 I am not sure what that means, I don’t have anything close to that many comments in my code.

Dave: after watching Sasha screen shot, I saw a second help from your work. It may be used to search and find faster where a Method is located instead of relying on (good to bad) memory.

I will name that Collateral Advantage (vs the more know Collateral Damage…)
;-:slight_smile:

Some minutes later: can you add the name of the object the event refers to ?
Still in Sasha screen shot, in the first window, we have a bunch of CellClick events. It may be nice to know the name of the object owner.