aboutcode-org / deltacode

DeltaCode: compare two codebase scans (from ScanCode) to detect significant changes.
http://www.aboutcode.org/
20 stars 27 forks source link

Add deltas_count field #79

Closed steven-esser closed 6 years ago

steven-esser commented 6 years ago

We should have a deltas_count field in JSON output, similar to scancode-toolkit

May need some discussion as to how to handle the -a option

johnmhoran commented 6 years ago

@majurg For your feedback, here's a JSON excerpt showing how my current draft handles the total count ("deltas_count_total": 8,) and the -a option ("deltas_count_unmodified": 7,):

{
  "deltacode_notice": [string omitted on GH for brevity],
  "deltacode_options": {
    "new_scan_path": "C:/code/nexb/dev/deltacode/tests/data/cli/scan_1_file_moved_new.json",
    "old_scan_path": "C:/code/nexb/dev/deltacode/tests/data/cli/scan_1_file_moved_old.json",
    "--all-delta-types": true
  },
  "deltacode_version": "1.0.0.post43.c2af0b2",
  "deltacode_errors": [],
  "deltas_count_total": 8,
  "deltas_count_unmodified": 7,
  "deltas": [
    {
      "factors": [
        "moved"
      ],

. . .
steven-esser commented 6 years ago

@johnmhoran I think we should just have a single deltas_count field that is simply the number of delta objects that will be found in the "payload" (deltas:)

So in the case where everything is unmodified, this number would be 0 if there was no -a flag given.

johnmhoran commented 6 years ago

👍