Skip to content

feat: add languages to dataflow report#1842

Merged
cfabianski merged 4 commits intomainfrom
feat/add-languages-to-dataflow-report
Oct 29, 2025
Merged

feat: add languages to dataflow report#1842
cfabianski merged 4 commits intomainfrom
feat/add-languages-to-dataflow-report

Conversation

@cfabianski
Copy link
Copy Markdown
Collaborator

@cfabianski cfabianski commented Oct 22, 2025

Description

We now include language statistics in the dataflow report under the languages section. Entries are sorted by usage and expose per-language file counts, total bytes, and the percentage of the codebase they represent. Behind the --include-stats flag we enrich the language aggregation (using go-enry) while keeping the prior LOC-based fallback; without the flag, behavior and payloads remain unchanged. Benchmarks show no measurable regression and security reports continue to operate exactly as before.

Example of output

bearer scan . --include-stats --report dataflow | jq .languages
[
  {
    "language": "Java",
    "lines": 191802,
    "files": 2766,
    "bytes": 11540170,
    "percentage": 70.75
  },
  {
    "language": "HTML",
    "lines": 112172,
    "files": 2783,
    "bytes": 4496835,
    "percentage": 27.57
  },
  {
    "language": "CSS",
    "lines": 7144,
    "files": 3,
    "bytes": 168979,
    "percentage": 1.04
  },
  {
    "language": "JavaScript",
    "lines": 1770,
    "files": 4,
    "bytes": 78468,
    "percentage": 0.48
  },
  {
    "language": "Shell",
    "lines": 316,
    "files": 34,
    "bytes": 21338,
    "percentage": 0.13
  },
  {
    "language": "Batchfile",
    "lines": 118,
    "files": 14,
    "bytes": 5992,
    "percentage": 0.04
  }
]

Checklist

If this is your first time contributing please sign the CLA

  • I've added test coverage that shows my fix or feature works as expected.
  • I've updated or added documentation if required.

@cfabianski cfabianski force-pushed the feat/add-languages-to-dataflow-report branch from 8b0fad4 to 84a1860 Compare October 22, 2025 13:25
cfabianski

This comment was marked as resolved.

@cfabianski cfabianski force-pushed the feat/add-languages-to-dataflow-report branch from 4f00f1f to 244cefb Compare October 22, 2025 13:59
@cfabianski cfabianski force-pushed the feat/add-languages-to-dataflow-report branch 4 times, most recently from a099b45 to c67c10e Compare October 23, 2025 15:16
@cfabianski cfabianski force-pushed the feat/add-languages-to-dataflow-report branch from c67c10e to 5a0f167 Compare October 23, 2025 15:19
@cfabianski cfabianski merged commit e5a9245 into main Oct 29, 2025
9 checks passed
@cfabianski cfabianski deleted the feat/add-languages-to-dataflow-report branch October 29, 2025 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants