Comment ratio metrics / Perl

Avatar

AndyArmstrong

about 1 year ago

I assume the comment ratio metric doesn't include embedded POD when scanning Perl?

Many Perl developers interleave POD and Perl

=head3 C<foo>

Set or get the foo factor for this frobnicator. Called with no arguments returns the current foo factor

my $foo_factor = $frob->foo;

Called with a single argument sets the foo factor

 $frob->foo(11.5);

=cut

sub foo { ... }

It's also possible to use POD for block comments

=begin comment

Setting foo while the frobnicator is processing documents is safe but won't take effect until the next run. At the start of the current run all settings are captured in a closure - so setting foo has no immediate effect.

=end comment

Are such blocks counted as comments? I think they should be :)


Avatar

Torsten Bronger

about 1 year ago

The same seems to be true for Python docstrings.


Avatar

Robin Luckey

about 1 year ago

We're going to open up our source code parser/line counter very soon. We're hoping some brave soul will take it upon themselves to add POD and docstring support to our parser. :-)


Avatar

AndyArmstrong

about 1 year ago

I'll certainly volunteer for the POD parser :)