cqfn / aibolit

Static Analyzer for Java Code with Machine Learning in Mind
https://pypi.org/project/aibolit/
51 stars 17 forks source link

SuppressWarning doesn't work sometimes #585

Closed g4s8 closed 4 years ago

g4s8 commented 4 years ago

When I ignore P31 warning in method https://github.com/artipie/asto/blob/9f398e8e566e3b44806f4e7825443ed80c0b9bd4/src/main/java/com/artipie/asto/fs/FileStorage.java#L156 with

    @SuppressWarnings("aibolit.P31")
    public CompletableFuture<Void> save(final Key key, final Content content) {

It doesn't work and aibolit reports this issue:

aibolit recommend --folder src/main/java  --format=long --full --suppress=P21,P13,P22,P20_5,P20_7
Show all patterns
/home/projects/github.com/artipie/asto/src/main/java/com/artipie/asto/fs/FileStorage.java score: 0.2
/home/projects/github.com/artipie/asto/src/main/java/com/artipie/asto/fs/FileStorage.java[183]: Send Null (P31: 0.20 1/1)
Total score: 0.20, files seen: 1, ncss 1

The line of warning is: https://github.com/artipie/asto/blob/9f398e8e566e3b44806f4e7825443ed80c0b9bd4/src/main/java/com/artipie/asto/fs/FileStorage.java#L181

Also, I have same issue with P20_5 and P20_7 patterns.