LOC Stat

Architecture Kata “LOC Stat”

Develop a program to observe how the lines of code (LOC) in a directory tree change over time.

When run (e.g. during an automatic build) the total number of LOC is counted and stored together with previous results for the directory tree. Example usage:

c:\> locstat.exe d:\myproject
Files: 10
LOC: 1620
Lines: 1798

In addition all the accumulated data will be used to draw a line chart like the following to show the tendency of the LOC development:

1

This diagram will be saved in the cloud and a link to it will be sent to a list of email addresses and published via Twitter using the hashtag #locstat. The Twitter account and sender email address can be dedicated to the analyzed directory tree.

Variation #1

Each email address can have a condition associated with it when it should be notified, e.g.

leaddeveloper@acme.com, LOC+10%

The recipient then should only be informed if the current number of LOC exceeds the previous one by at least 10%.

Each email address can be listed several times each with another condition.

Placeholders in conditions may be: LOC (lines of code without comments or whitespace), Lines (raw number of lines), Delta (Lines – LOC).

Conditions are positive or negative absolute integer numbers or percentages, e.g. +10, -100, +10%, -50%.

Variation #2

Old charts and old measurements have an expiration date. The program will do a garbage collection upon each run.