pkgnet icon indicating copy to clipboard operation
pkgnet copied to clipboard

Improve workflow for telling pkgnet to run package coverage

Open jameslamb opened this issue 6 years ago • 2 comments

Currently, in FunctionReporter$extract_network() we have logic like this:

            if (!is.null(private$pkg_path)){
                private$calculate_test_coverage()
            }

This feels kind of awkward...instead of a user saying "add test coverage", we allow you to optionally set pkg_path in set_package() and then say "try to calculate test coverage if you specific a directory where the source code can be found". IMHO that is non-obvious.

Closing this task means proposing a better, more explicit pattern (for example, adding a $use_package_coverage(pkg_path)) or arguing effectively that this issue is unnecessary and the current UX is fine.

jameslamb avatar Feb 10 '19 06:02 jameslamb

@bburns632 @jayqi curious to hear what you think! Also...I've added the issue label ux to capture issues that are of the form "nothing is wrong but doing this might make the pkgnet easier and more intuitive to work with"

jameslamb avatar Feb 10 '19 06:02 jameslamb

@jameslamb I made a change to this in #181.

In my proposed refactor, it's little less awkward in that it doesn't automatically get calculated when the network is extracted, but rather when $calculate_default_measures is called. But perhaps still not as explicit as it could be. It also makes me feel a little wary that order ends up mattering if you want coverage to be reflected in the graph viz.

jayqi avatar Feb 10 '19 06:02 jayqi