RefactoringMiner icon indicating copy to clipboard operation
RefactoringMiner copied to clipboard

[JavaRecreation of JS Extract Method] Rename variable is not detected when the declaration type is var and unused

Open mkshiblu opened this issue 3 years ago • 0 comments

Problem

Refactoring Miner was not able to detect that variable d was renamed to responseData.

Steps to Reproduce

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

Observed Behavior

  • Only extract method settle was reported by RefactoringMiner.

Expected Behavior

  • The rename variable d to responseData should have been reported.

Java Diff

image

Original JS Diff

image

** Original Js commitURl**

https://github.com/axios/axios/commit/d23f9d5d4782e5849362895f8b648ed587999706#diff-586c04c24608b86a074073c5514cc195be5c4c87ddb56da233f6d998ada4159f

Note

  • Changing var to String didn't produce the rename var refactoring.
  • The variable is unused.
  • Another commit with the same variable with usage where refactoringminer detects correctly even if the type var

https://github.com/mkshiblu/practice/commit/190e9a7dc72807c8077e007419478e429c526e02

image

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

mkshiblu avatar Jul 15 '22 19:07 mkshiblu