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

Review convert if/ternary expression analyzer comment in leap year #235

Open
kahgoh opened this issue Nov 5, 2024 · 3 comments
Open

Review convert if/ternary expression analyzer comment in leap year #235

kahgoh opened this issue Nov 5, 2024 · 3 comments
Assignees

Comments

@kahgoh
Copy link
Member

kahgoh commented Nov 5, 2024

The analyzer produces the comment Consider converting the if-statement(s) and/or ternary expressions into a single expression using the && and || operators. for the solution return (year % 100 == 0) ? (year % 400 == 0) : (year % 4 == 0);.

The solution seems valid (so the analyzer shouldn't produce the comment).

@jagdish-15
Copy link

Hey @kahgoh, could you assign the issue to me?

@jagdish-15
Copy link

Hello @kahgoh,

I've raised two PRs related to this issue — one on java-analyzer and another on website-copy.

I'm still unsure about the analyzer tests for the java-analyzer PR. Could you please clarify what's expected in terms of testing? Also, let me know if there's anything else that needs to be updated or adjusted in either of the PRs.

@kahgoh
Copy link
Member Author

kahgoh commented Apr 9, 2025

I think we need to update the tests - there's a few failing in the CI. If I'm not mistaken, the sample for the ternary test, we would expect to receive to get the new ternary comment because the last case returns a boolean literal. But, we also need to add one a test for the return (year % 100 == 0) ? (year % 400 == 0) : (year % 4 == 0); solution, which I think should receive no analyzer comments.

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