Class DeltaReport
Overview
compute(Path, Path) parses two MethodAtlas CSV files produced by
separate scan runs and returns a DeltaReport.DeltaResult that enumerates every
test method that was added, removed, or modified between the runs. Unchanged
methods are counted but not listed individually.
Method identity
Two records are considered to represent the same method when their
fqcn and method columns match exactly. If a class or method
is renamed between scans, the old name appears as REMOVED and the
new name appears as ADDED. MethodAtlas does not attempt to track
renames.
Comparable fields
For each method present in both scans, the following fields are compared:
loc— lines of code; always comparedtags— JUnit@Tagset; always compared (order-independent)display_name—@DisplayNameannotation value; always compared;null(column absent from the CSV) and""(column present but no annotation on the method) are both treated as "no annotation" and considered equal, so comparing an old-format file against a new-format file does not produce false positives for methods that have no annotation in either scancontent_hash— source fingerprint; compared only when both records have a non-nullvalue (i.e., both scans were run with-content-hash); a hash difference indicates the enclosing class source was editedai_security_relevant— compared only when both records carry a non-nullvalue (both scans used-ai)ai_tags— compared only when both records carry a non-nullvalue; comparison is order-independent
Fields absent from either record (i.e., produced by scans with different flag
sets) are skipped so that a scan with -content-hash can be meaningfully
compared with one that did not use that flag.
CSV format compatibility
The parser handles the MethodAtlas CSV dialect (RFC 4180, comma-delimited,
double-quote escaping). #-prefixed comment lines emitted by
-emit-metadata are skipped; the scan_timestamp metadata value
is extracted and forwarded to DeltaReport.DeltaResult for display. Blank lines
are ignored. Unknown column names are ignored, making the parser
forward-compatible with columns added in future versions.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordThe aggregate result of comparing two MethodAtlas scan outputs. -
Method Summary
Modifier and TypeMethodDescriptionstatic DeltaReport.DeltaResultComputes the difference between two MethodAtlas scan CSV files.
-
Method Details
-
compute
Computes the difference between two MethodAtlas scan CSV files.Both files must be readable and must contain at least a CSV header row with
fqcnandmethodcolumns. Empty files (no data rows) are handled gracefully and produce onlyADDEDorREMOVEDentries as appropriate.- Parameters:
beforeCsv- path to the scan output from the earlier runafterCsv- path to the scan output from the later run- Returns:
- delta result; never
null - Throws:
IOException- if either file cannot be readIllegalArgumentException- if a required column (fqcnormethod) is absent from a file
-