dupree icon indicating copy to clipboard operation
dupree copied to clipboard

extend documentation

Open russHyde opened this issue 5 years ago • 10 comments

  • [x] - can the user disregard specific directories (eg, tests/)
  • [ ] - how to add to / modify the disregarded symbols
  • [ ] - network diagram of duplication in a project / package
  • [ ] - why were the default disregarded symbols selected?
  • [ ] - limitation: only looks at top-level blocks
  • [ ] - ? alternatives

russHyde avatar Jul 04 '19 15:07 russHyde

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?

maelle avatar Nov 18 '19 10:11 maelle

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

russHyde avatar Nov 18 '19 11:11 russHyde

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".

maelle avatar Nov 18 '19 11:11 maelle

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]

russHyde avatar Nov 18 '19 11:11 russHyde

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())

maelle avatar Nov 18 '19 11:11 maelle

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

russHyde avatar Nov 18 '19 11:11 russHyde

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

Thanks for the links!

maelle avatar Nov 18 '19 11:11 maelle

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

maelle avatar Nov 18 '19 12:11 maelle

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

russHyde avatar Nov 18 '19 12:11 russHyde

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

maelle avatar Nov 18 '19 12:11 maelle