russHyde / dupree

{dupree} helps identify code blocks that have a high level of similarity in a set of R files
https://russhyde.github.io/dupree/
Other
37 stars 0 forks source link

extend documentation #26

Open russHyde opened 5 years ago

russHyde commented 5 years ago
maelle commented 4 years ago

Thanks for the package!

I'd also like to know how you'd use the results to find the blocks to replace with a helper function. At the moment one would need to open files and navigate them by hand, correct?

russHyde commented 4 years ago

Thanks for your feedback, I wasn't sure if this was on anyone's radar. You are correct, the only way to assess the found matches is by looking at the code blocks in the relevant files. I'm planning to implement a way to highlight the code within duplicated regions for specific code-block-matches as part of v0.3.0; see #27 and #48

maelle commented 4 years ago

Ok, thanks!

Do you have any example of a PR or commit where the diff is your using dupree results to reduce duplication? I.e. a diff that'd be "here I removed 100 lines by writing a helper function instead of the same code block repeated 10 times, thanks to dupree".

russHyde commented 4 years ago

I'm afraid I've only done that in some private repos so far. I have applied it to lintr and installr but haven't yet made PRs that are a direct result of applying dupree. (If you're interested I have a network diagram of the duplicates found in ~ June in lintr in this presentation: http://rpubs.com/russH/dupree-intro see p18) [but, lintr has undergone a pretty big overhaul since then]

maelle commented 4 years ago

Ok, thanks.

For context I was thinking about mentioning dupree in a future blog post https://github.com/r-hub/blog/issues/32 (I can't remember whether I saw dupree on Twitter via CRANberries, or via pkgsearch::cran_latest())

russHyde commented 4 years ago

Cool. I have a blogpost about it here: https://russ-hyde.rbind.io/post/dupree/ but all the formatting has gone weird and it's a bit out of date. I need to pull together some new examples for a newcastle satrdays abstract, so I'll try and write a Release blog post this week. You did retweet or like one of my tweets quite early on the day it was released: https://twitter.com/haematobot/status/1193605949858177024

... if there's anything I can do to help, just drop us a message

maelle commented 4 years ago

Aaah yes so your tweet was how I found out about it!

Thanks for the links!

maelle commented 4 years ago

Btw what got my attention was the package name. Why is it called so?

russHyde commented 4 years ago

Simply because it finds _dup_licates; and the name dupree had an R in it. Thanks, though :)

maelle commented 4 years ago

ah ok, so no reference I was not understanding :-D Thank you for the explanation!