You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While the current metrics are great to get to get a rough insight on the size of your application, I feel an important metric missing, is the number of lines with "functional code". By "functional code" I do not mean "working" code or "code within functions" but rather:
I might be an exception but I think a metric ignoring certain "quasi empty" lines would allow me to judge the size of a software way better than only ignoring blanks.
Lines which contain some sort of meaningful code beyond the syntactic requirements of the language.
The goal is to get an idea on the functional size (and complexity) of the software.
The simplest example would be: Ignore all lines which contain only certain characters like { , } , ;
Depending on how you format your code you have more lines, but not more "complexity". See following 3 pieces of code. They result in completely different LoC reports without necessary meaning "more code".
How should it work?
There should be a list of patterns (per language?) specifying when a line is not counted for this new metric. e.g a pattern like ^[ \t]+[{}]$ would not count lines with only a brace symbol.
If I could choose, I'd like to see this additionally metric additionally by-default right beside metrics like code,blank,comments.
An alternative apporach is to add new CLI options to provide multple patterns to exclude in counting.
The text was updated successfully, but these errors were encountered:
It's an interesting idea but not easily implemented. The challenge isn't adding an ignore filter--that part is relatively simple. The tedious part is extending the metrics type to include "functional code" in addition to the existing categories of code,blank,comments because of the many (too many?) output formats and styles.
I'll keep this issue open since the concept has merit.
General idea:
While the current metrics are great to get to get a rough insight on the size of your application, I feel an important metric missing, is the number of lines with "functional code". By "functional code" I do not mean "working" code or "code within functions" but rather:
I might be an exception but I think a metric ignoring certain "quasi empty" lines would allow me to judge the size of a software way better than only ignoring blanks.
The goal is to get an idea on the functional size (and complexity) of the software.
The simplest example would be: Ignore all lines which contain only certain characters like
{
,}
,;
Depending on how you format your code you have more lines, but not more "complexity". See following 3 pieces of code. They result in completely different LoC reports without necessary meaning "more code".
How should it work?
There should be a list of patterns (per language?) specifying when a line is not counted for this new metric. e.g a pattern like
^[ \t]+[{}]$
would not count lines with only a brace symbol.If I could choose, I'd like to see this additionally metric additionally by-default right beside metrics like code,blank,comments.
An alternative apporach is to add new CLI options to provide multple patterns to exclude in counting.
The text was updated successfully, but these errors were encountered: