open-telemetry / opentelemetry-collector
Code health
Hotspots average 5.6, the place fixes pay off most.
Explore this codebase
- Code health map32hotspots across 2,311 files
- Ownership1,326sole-owned files: one author, no second reader
- Architecture21modules, 8 entry points
- Decisions40recorded, of which 0 in force and 40 background
- Refactoring114open opportunities, one per file
- TestsNo coverage report yet. Run your tests with coverage on, then add the report:
AlsoDocsChatFilesKnowledge graphChange couplingCommitsStatsCosts
Do next · 3
3 things worth doing in the week to Oct 27, the last indexed commit, 1 of them now.
Now
- High
Start breaking up mergeFrom (CCN 51, 132 lines): first lift lines 235-317
internal/schemagen/model.go:235
mergeFrom has many paths; easier to read and change once split; function changed in 11 commits; its file is imported by 16 files, changed 9 times in 90 days.
- gain
- +1.2 health on this file(inferred)
- health recoverable
- +1.2(inferred)
- size
- CCN 51, 132 lines
- steps
- 2 (2 mechanical)
Medium effort
Worth planning
Break up UpdateReceivers (CCN 49, 155 lines)
service/internal/graph/graph.go:530
UpdateReceivers has many paths; easier to read and change once split, which also removes a duplicate; its file is imported by 6 files.
- gain
- up to +1.0 health on this file(inferred)
- finding
- Complex method
- size
- CCN 49, 155 lines, nests 4 deep
- severity
- high
Medium effort, worth a checkStart breaking up run (CCN 57, 167 lines): first lift lines 253-267
cmd/mdatagen/internal/command.go:253
run has many paths; easier to read and change once split; function changed in 5 commits; its file is imported by 1 file, changed 5 times in 90 days.
- gain
- up to under +0.1 health on this file(inferred)
- finding
- Complex method
- size
- CCN 57, 167 lines, nests 4 deep
- severity
- high
Medium effort, worth a check
Improve what Repowise can see
Add a test coverage report
Without one, Repowise cannot tell tested code from untested code, so every test-related action says “unknown”.
- line coverage
- Unknown, no report
Small effort
Everything we found
6 areas
Every detector's open count by area. The actions above are the part worth doing.
- Code health907 open findingsCriticalChange entropy · cmd/mdatagen/internal/command.go19 findings · 9.7 deducted
- Refactoring114 open opportunitiesLowmergeFrom+0.8 health, M effort · internal/schemagen/model.go
- Doc drift13Mediumcmd/schemagen/README.mdDocument shows `make schemagen`, but no such target is declared.
- Decisions0 drifting from the codeMediumcmd/mdatagen/internal/cfggen/generation_test.goHigh-churn file with no governing decision
- Ownership1,326 sole-owned filesMediumcmd/mdatagen/internal/cfggen/generation.goOne author, no second reader
- Dead code1LowGenTestProfilesWrapperUnreachable function (3 lines)