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

Implement as a SpotBugs detector #4

Open
jrivard opened this issue Apr 22, 2020 · 1 comment
Open

Implement as a SpotBugs detector #4

jrivard opened this issue Apr 22, 2020 · 1 comment

Comments

@jrivard
Copy link

jrivard commented Apr 22, 2020

Seems like this would be a good spotbugs check to identify recursion that could easily be improved by the programmer. Spotbugs doesn't modify the output but can produce a warning when such a condition exists which would be helpful.

https://spotbugs.github.io/

@Sipkab
Copy link
Owner

Sipkab commented Apr 22, 2020

I think that an extension for SpotBugs can be appropriate that warns about non tail-recursive method calls. I think it should not perform further investigation whether or not the recursion could be easily improved to be made tail recursive.

How could we determine if an improvement is easy? General code suggestions seem to be of scope for this project.

Thinking about this again, based on what conditions should we report a warning for a recursive method call? We issue a warning if it is non-tail-recursive? That could generate too many warnings for other kinds of recursive functions.

Maybe we should issue a warning, if we encounter a seemingly tail recursive call, and it cannot be optimized due to limitations like virtual functions or others?

This may need more specifics. I'll look into this in the future if I have available time, but can't make a promise.

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

No branches or pull requests

2 participants