Open junaruga opened 6 years ago
This report is by a static code analysis tool in our company (Maybe Coverity Scan).
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 :)
Sure, @korny . I respect your decision. It's up to you.
Fix small issues for
lib/coderay/scanners/groovy.rb
.inline_block_paren_depth
is initialized asnil
. But the codeinline_block_paren_depth += 1
,inline_block_paren_depth -= 1
,inline_block_paren_depth == 0
has a possibility to raise unintendedNoMethodError
. It looks good to initializeinline_block_paren_depth
is initialized as0
or add checks before the codes.string_delimiter
can benil
as a possibility. Adding checks looks better.