polystat / odin

Object Dependency Inspector
10 stars 2 forks source link

Errors fall into `message` but not in `exception` #38

Closed APotyomkin closed 2 years ago

APotyomkin commented 2 years ago

Error message, that Odin is not able to analyze something fall into a message section:

{"results":[{"ruleId":"AnOdin","message":"Odin is not able to analyze the code, due to:\nSymbol value-of-before-f not declared"}]}

But should fall into an exception section:

{"results":[{"ruleId":"AnOdin","exception":"Optional[Odin is not able to analyze the code, due to:\nSymbol value-of-before-f not declared]"}]}
fizruk commented 2 years ago

@nikololiahim Please, update the reporting mechanism here, and in Polystat (see https://github.com/polystat/polystat/issues/44).

Ideally, each analyser should be producing a list of "results":

case class OdinAnalyzerResult(name: String)
case class OdinAnalyzerResultOK(name : String) extends OdinAnalyzerResult(name)
case class OdinAnalyzerResultDefectDetected(name : String, message : String) extends OdinAnalyzerResult(name)
case class OdinAnalyzerResultException(name : String, exception : String) extends OdinAnalyzerResult(name)

Then, each analyser should return a list of results List[OdinAnalyzerResult] and pass to polystat for rendering an output.

Please, also see https://github.com/polystat/polystat/issues/49 to understand how this should be later transformed into a SARIF output.