mibk/dupl

Why is the output non-deterministic?

jmunson opened this issue · 1 comments

I've found that running dupl on the same codebase multiple times produces different results. I'm not sure why this would be the case, any ideas?

Heres some examples to demonstrate what I mean:

>for i in $(seq 1 100);do dupl ~/go/src/github.com/spf13/cobra/ |grep Found;done  |sort |uniq -c
      6 Found total 82 clone groups.
     27 Found total 83 clone groups.
     52 Found total 84 clone groups.
     13 Found total 85 clone groups.
      2 Found total 86 clone groups.
> for i in $(seq 1 100);do dupl ~/go/src/golang.org/x/net/webdav |grep Found;done  |sort |uniq -c
      2 Found total 228 clone groups.
     30 Found total 229 clone groups.
     30 Found total 230 clone groups.
     23 Found total 231 clone groups.
     12 Found total 232 clone groups.
      3 Found total 233 clone groups.

I don't see a way to check the version of dupl I have installed, but I just updated to the latest commit as of the time of me posting this ticket (415e882)

mibk commented

Having it written a while ago, my guess is because of using maps. Anyway I think it definitely should be deterministic. I'm gonna take a look at it when I have time.