RefactoringMiner icon indicating copy to clipboard operation
RefactoringMiner copied to clipboard

Cannot detect Extract Method when multiple conditions are extracted to if else condition into a new method

Open mkshiblu opened this issue 3 years ago • 1 comments

Problem

Refactoring Miner was not able to detect that getData was extracted from dataAttr

Steps to Reproduce

  1. Go to https://github.com/mkshiblu/practice/commit/d521357223d71fb57dba9d61afbe84a6d2672ac5
  2. Run the chrome extension

Observed Behavior

  • No refactorings are reported by RefactoringMiner.

Java Diff

image

Note

  • The Above Java Example Test Code is a close recreation to this. Checkout it for some interesting comments from the developer.

  • Source code is compilable because of the addition of mock classes.

mkshiblu avatar Jul 15 '22 20:07 mkshiblu

This is a rather rare scenario, which would take a lot of effort to implement. Supporting the matching of conditional expressions with if statements is interesting though.

tsantalis avatar Aug 10 '22 21:08 tsantalis