- Notifications
You must be signed in to change notification settings - Fork113
Make the code in scanner/groovy.rb robust.#228
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:master
Are you sure you want to change the base?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
junaruga commentedFeb 23, 2019 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
This report is by a static code analysis tool in our company (Maybe Coverity Scan). |
korny commentedFeb 23, 2019
Mmh. I don’t think there’s really a bug here, since I never got an error with the current version even with thorough testing (see the scanner test suite). While I agree with the first change, the second one would slow down the scanner. I don’t think we need such checks unless someone can actually produce an error here :) |
junaruga commentedFeb 24, 2019
Sure,@korny . I respect your decision. It's up to you. |
Fix small issues for
lib/coderay/scanners/groovy.rb.inline_block_paren_depthis initialized asnil.But the code
inline_block_paren_depth += 1,inline_block_paren_depth -= 1,inline_block_paren_depth == 0has a possibility to raise unintendedNoMethodError.It looks good to initialize
inline_block_paren_depthis initialized as0or add checks before the codes.string_delimitercan benilas a possibility. Adding checks looks better.