pharmaR / riskassessment

Risk Assessment Demo App: https://rinpharma.shinyapps.io/riskassessment
https://pharmar.github.io/riskassessment/
Other
98 stars 26 forks source link

Fix `get_exported_functions()` #676

Closed Jeff-Thompson12 closed 9 months ago

Jeff-Thompson12 commented 9 months ago

Seeks to close #679

codecov[bot] commented 9 months ago

Codecov Report

Merging #676 (a2af76a) into dev (08fff46) will increase coverage by 0.04%. Report is 15 commits behind head on dev. The diff coverage is 0.00%.

:exclamation: Current head a2af76a differs from pull request most recent head a1ccd72. Consider uploading reports for the commit a1ccd72 to get more accurate results

@@            Coverage Diff             @@
##              dev     #676      +/-   ##
==========================================
+ Coverage   72.98%   73.02%   +0.04%     
==========================================
  Files          33       33              
  Lines        4830     4830              
==========================================
+ Hits         3525     3527       +2     
+ Misses       1305     1303       -2     
Files Coverage Δ
R/mod_code_explorer.R 26.21% <0.00%> (-0.26%) :arrow_down:
R/mod_code_explorer_utils.R 0.00% <0.00%> (ø)

... and 1 file with indirect coverage changes

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

Jeff-Thompson12 commented 9 months ago

Assignment arrows showing up

For pkg zoo:

image

If you look at the NAMESPACE for zoo you will see that those are indeed exported functions. I believe that is the way to export the behavior for items like for example names(x) <- x, where it assigns values to the name attribute. But nevertheless this is helpful because the app is not identifying the source code for those functions.

Jeff-Thompson12 commented 9 months ago

@AARON-CLARK

Strange Behavior

This should be fixed now. I have extracted the relevant parsing from the base function.

Assignment arrows showing up

This is proving to be a little more difficult. In {zoo} we have some exported functions such as coredata<-. However, in the source code these functions are defined as "coredata<-" <- function(){...}, so the parsed item is not in the list but is instead interpreted as a string constant. Including all string constants can lead to some undesirable matching. Plus we are not capturing any actual usage such as coredata(x) <- ....