CodeChurn reduction function computes a single telemetry stream representing churn in the project. It can be either the number of lines added and/or the number of lines deleted from files in the Project as they are committed to the configuration management repository.
Example 28.4. Net Churn
streams NetCodeChurnStream(filePattern, cumulative) = {
"Added minus Deleted",
CodeChurn("LinesAdded", filePattern, cumulative) -
CodeChurn("LinesDeleted", filePattern, cumulative)
};
y-axis yAxis(label) = {label};
chart NetCodeChurnChart(filePattern, cumulative) = {
"Lines Added minus Lines Deleted",
(NetCodeChurnStream(filePattern, cumulative), yAxis("Lines Added - Lines Deleted Count"))
};
draw NetCodeChurnChart("**/*.java", "false");

This chart shows the net churn, which is defined as 'LinesAdded' - 'LinesDeleted'. Net churn is good for factoring out the effects of refactoring, where a large number of lines of code might be deleted from one file and added to another.
Example 28.5. Churn: Lines Added and Lines Deleted
streams LinesAddedStream(filePattern, cumulative) = {
"Lines Added",
CodeChurn("LinesAdded", filePattern, cumulative)
};
streams LinesDeletedStream(filePattern, cumulative) = {
"Lines Deleted",
CodeChurn("LinesDeleted", filePattern, cumulative)
};
y-axis yAxis(label) = {label};
chart CodeChurnChart(filePattern, cumulative) = {
"Lines Added and Lines Deleted",
(LinesAddedStream(filePattern, cumulative), yAxis("Lines Count")),
(LinesDeletedStream(filePattern, cumulative), yAxis("Lines Count"))
};
draw CodeChurnChart("**/*.java", "false");

The chart shows both lines added and lines deleted.