On Mon, Oct 01, 2012 at 02:00:30AM -0700, Ovid wrote: > Hi Paul, > > I'm very happy to see the great work you've been doing for Devel::Cover.
Thanks! > I've been meaning to ask: have you considered adding basis path coverage > information? Devel::Cover appears to be tracking all of the relevant data. It > seems that now it would merely be a matter of writing the algorithm to > generate the basis coverage. Many other languages have automated tools for > generating the requisite cyclomatic complexity and basic path information. It > would be awesome if Perl had this too :) > > For others: yes, I know that PPI offers cyclomatic complexity information. I > would like to see all code coverage information provided in "one-stop > shopping" for Perl rather than relying on a separate tool (and I don't know > that PPI exposes the control-flow graph used to calculate the cyclomatic > complexity. Does it?). Caclulating path coverage has been in the plan since day one. The low level routines are there and, you are right, I think that I'm collecting all the required information. It would be nice if I were able to complete that within the scope of this grant. As far as cyclomatic complexity is concerned, I don't think that that is something which I would like to build into Devel::Cover. Static analysis is a different problem. However, I would be very happy to have an annotation which added cyclomatic complexity information to a coverage report. I could be persuaded to reconsider if static analysis solutions are insufficient here. Annotations are a feature of Devel::Cover which allow you to add non-coverage information to coverage reports. At the moment, they're really only used to add git blame information to coverage reports. I would be happy to add such an annotation to Devel::Cover, or for an author to upload the annotation as a separate distribution. I don't think that all Devel::Cover reports and annotations need to be a part of Devel::Cover itself. There are APIs for both reports and annotations. Path coverage was already in the TODO, but I have added cyclomatic complexity annotations. Thanks for mentioning it. -- Paul Johnson - p...@pjcj.net http://www.pjcj.net