jdt-codemining icon indicating copy to clipboard operation
jdt-codemining copied to clipboard

Analyze logical coupling through git

Open sirolf2009 opened this issue 7 years ago • 2 comments

How about a code mining feature that tracks which files you probably want to look at when editing a file, analyzed through the git history? There's quite a few resources on this available on the internet:

  • http://ceur-ws.org/Vol-1730/p06.pdf
  • https://elib.uni-stuttgart.de/bitstream/11682/9264/1/jr_thesis_final.pdf
  • https://elib.uni-stuttgart.de/bitstream/11682/8809/1/which_changes_sets_in_git_repositories_are_related.pdf

I also found an implementation of this: https://github.com/adamtornhill/code-maat

sirolf2009 avatar Oct 11 '18 13:10 sirolf2009

I'm sorry I have not understood your idea. Could you attach a draw with your idea?

angelozerr avatar Nov 17 '18 15:11 angelozerr

I was thinking of something like

public class SomeClass {
	
	SomeOtherClass:SomeOtherMethod (80%)
	public void someMethod() {
	}
	
}

In this case, the plugin has detected that whenever someMethod changes in a commit, 80% of the time someOtherMethod will also change in that commit. So you know that these methods are important to each other and if you want to change someMethod, you should probably also look at someOtherMethod to ensure stability. You could also click the code mining to jump to the someOtherMethod and I guess have a settings page with how many methods you'd like to see and the threshold for how coupled they must be before they appear

sirolf2009 avatar Nov 20 '18 09:11 sirolf2009