3 ms·
This would be a really really interesting project to do with this data. You could maybe parse the files and run a similarity function of some kind on class and
by orf 3y ago
This would be a really really interesting project to do with this data.
You could maybe parse the files and run a similarity function of some kind on class and method bodies, ignoring identifier names.
- ivanjermakov 3y agoIf only function equivalence was decidable[1]. [1]: Rice's theorem https://en.wikipedia.org/wiki/Rice%27s_theorem https://en.wikipedia.org/wiki/Rice%27s_theorem
- orf 3y agoI've been thinking about this today. Function equivalence is one thing, but detecting similar code fragements is another? Like why not assign a character to each keyword: 'if' = 'i', 'while' = 'w', 'true' = 't', etc. Then reduce code to this, removing all whitespace comments and identifiers. so `if True: while True: pass` would become `itwtp`. then the similarity is just an edit distance between two given strings?