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

LGTM.com - false positive / #2742

Open
ahus1 opened this issue Feb 1, 2020 · 1 comment
Open

LGTM.com - false positive / #2742

ahus1 opened this issue Feb 1, 2020 · 1 comment

Comments

@ahus1
Copy link

ahus1 commented Feb 1, 2020

Description of the false positive

Using next() and myBuilder.eof() will advance the cursor, and will trigger the callback setWhitespaceSkippedCallback, that will increment newLines, therefore this is a false positive.

https://lgtm.com/projects/g/asciidoctor/asciidoctor-intellij-plugin/snapshot/4f6083a0115577e6f8b12b0fbc95fe67e2263673/files/src/main/java/org/asciidoc/intellij/parser/AsciiDocParserImpl.java?sort=name&dir=ASC&mode=heatmap#xa2e95b28c87f047c:1

@aschackmull
Copy link
Contributor

Thank you for your report. When building the SSA representation for fields, we try to account for any call-chain that can end up modifying the field. Unfortunately, callbacks that happen from library code that isn't part of the analyzed code currently aren't handled, which leads to the FP. This is a known problem and something that we're looking into, but the correct fix involves control-flow analysis of the bytecode of the referenced libraries, so it isn't something that we'll have a quick fix for, as we don't analyze bytecode yet.

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

3 participants