Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lack of support for the refactoring using conditional expression transformation #681

Open
simpt5 opened this issue Mar 16, 2024 · 3 comments

Comments

@simpt5
Copy link

simpt5 commented Mar 16, 2024

Tested tools and version:

Refactoring Aware Commit Review Chrome Extension (Version: 2.0.4).
RefactoringMiner (Version 3.0.4) maven dependency.

Description:

During the usage of RefactoringMiner, I found a refactoring case using conditional expression transformation that can’t be detected. Could it possibly be supported in the future maybe?

Commit URL: dromara/hutool@1d4ac7d

File URL: dromara/hutool@1d4ac7d#diff-e9a28972da0c69b8a3c84ac4d14c9c911bb58f552aef78049f00909468cbf1be

The following refactoring for conditional expression in the above commit can’t be detected.

image

@tsantalis
Copy link
Owner

@simpt5
The corresponding if statements are actually matched. I am not sure if this is a refactoring type.
It can be considered as Simplifying Boolean Expressions

image

@simpt5
Copy link
Author

simpt5 commented Mar 19, 2024

Yes, it is actually can be treated as a boolean expression transformation, which transform boolean expression using some rules without changing the program behaviors. It is indeed not a typical refactoring type as others. Since those transformations are based on rules and performed on the boolean expression, I am wondering if those could be detected (if it is worth to detect) using some strategies?

@tsantalis
Copy link
Owner

@simpt5
It is definitely possible to implement this in RefactoringMiner and get it reported with a new refactoring type Simplify Boolean Expression.
I can add it as a new feature request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants