cqfn / veniq

Veniq uses Machine Learning to analyze source code, find possible refactorings, and suggest those that seem optimal

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Synth. dataset: remove duplicated method invocations

KatGarmash opened this issue · comments

Why

We observed the following case of function invocations in the original code used for synthtic dataset: an method extrMethod(); is called from different places (different methods) within the same class. This is a case of code duplication. It may be that the reason extrMethod was defined as a separate method is precisely because of code duplication, and not because it is a semantically cohesive piece of code which can serve as a good example of ExtractMethod refactoring.

What we want

Eliminate the factor of code duplication in our synthetic dataset on LM/EM.

Proposed solution

Simplest and least nuanced solution: do not inline methods that are invoked more than once with a give class.