tomasbjerre / violations-lib

Java library for parsing report files from static code analysis.
Apache License 2.0
148 stars 39 forks source link

CodeClimate issue fingerprint clash #181

Closed darekxan closed 1 year ago

darekxan commented 1 year ago

I've noticed that in CodeClimate output converted from Android Lint's xml outputs several issues have the same fingerprint, despite being separate ones. I've tracked it down to fingerprint calculation, which already takes many properties to account: https://github.com/tomasbjerre/violations-lib/blob/b4bb0214eb6f31ab2a80736cb285c733f285e98c/src/main/java/se/bjurr/violations/lib/model/codeclimate/CodeClimateTransformer.java#L59-L69 however this calculations skips the endColumn, startLine and endLine properties.

I have encountered many lint issues that differ only by startLine or endLine properties.

To my understanding, according to gitlab's CodeQuality specs fingerprint should be unique for each issue. This leads to several issues, despite being unique, having same fingerprint and being reported only once by gitlab code quality.

tomasbjerre commented 1 year ago

Im not currently using Gitlab so I dont really know. But this is intended, see:

tomasbjerre commented 1 year ago

Releasing a fix for this by grouping same fingerprint using other_locations: https://github.com/codeclimate/platform/blob/master/spec/analyzers/SPEC.md#other-locations

Open issue again if not working.