DataDog / datadog-static-analyzer

Datadog Static Analyzer
https://docs.datadoghq.com/static_analysis/
Apache License 2.0
100 stars 12 forks source link

Clean up serialization of violations on the server. #514

Closed jasonforal closed 2 weeks ago

jasonforal commented 3 weeks ago

What problem are you trying to solve?

For our taint analysis implementation, we need to refactor the Violation struct to be able to represent both single region (what we support currently) violations as well as "code flow" violations.

While doing so, I noticed that ServerViolation is a manual copy of Violation, created so we can serialize the values differently on the server. This is no longer necessary, so we might as well clean it up.

What is your solution?

ServerViolation was introduced because we needed the edit_type serialization to remain snake_case, but the kernel needed it to be camelCase so serde_v8 could parse stella violations.

This was made unnecessary by https://github.com/DataDog/datadog-static-analyzer/pull/382, which changed the naming away from "editType".

Alternatives considered

What the reviewer should know