Added a Value Analysis check to Assignment Check Smart Generate. Pretty difficult as I needed to temporarily insert an if statement at the caret to get an IReferenceExpression, run Value Analysis, and then cancel insertion. Worried about performance.
Considered how to detect code similarites to highlight common code blocks. Common code blocks could be extracted into methods which would increase maintainablility.
Each important element of a code block; statement, invocation, assignment etc. could be represented as an integer. A code block would then be a list of integers. I could then use Levenshtein distance to compute the difference between two code blocks. If the distance is small, the code blocks are similar.
It is a nice idea, but probably not workable in real life.
1 comment:
Hi, Jakob
I've just found your blog.
I'm glad that you reused Agent Smith's installer:).
About code similarities. When I was reflectoring Resharper, I think I've seen code that finds similarities, it was just absent in R# interface.
--Sergey Zyuzin.
Post a Comment