temporalio / temporal
Code health
This codebase scores 6.7 out of 10 for code health, which we rate fair. It also scores maintainability 7.1 and static performance 9.9 out of 10. The three are scored separately and never blended into one number. Risk is concentrated, as it usually is: 300 of 3,156 files are git hotspots, and they average 4.8 — which is where the fixes pay off most.
Do next
5 suggested
6 things worth doing in the week to Oct 6, the last indexed commit, 3 of them now.
Now
- Critical
Simplify
callScalerinservice/matching/scale_manager.gowhile the change is fresh1 commit in the last 7 days added or worsened 1 critical or high finding here, still open. Fixing now costs less than after the next change.
- serious findings
- 1
- critical
- 1
- latest commit
- Dynamic partitioning: add scale manager enabled setting (#12138)
Small effort - High
Tidy 2 functions you changed in
tools/tdbg/scheduleaudit/analyzer.gothis week1 commit in the last 7 days added or worsened 2 critical or high findings here, still open. Fixing now costs less than after the next change.
- serious findings
- 2
- critical
- 0
- latest commit
- Add tdbg schedule audit command (#10929)
Small effort
Worth planning
Break up Invoke (CCN 115, 518 lines)
service/history/api/respondworkflowtaskcompleted/api.go:609
Invoke has many paths; easier to read and change once split, which also removes a duplicate; function changed in 114 commits; its file is imported by 2 files, changed 8 times in 90 days.
- gain
- up to +0.5 health on this file(inferred)
- finding
- Complex method
- size
- CCN 115, 518 lines, nests 4 deep
- severity
- critical
Medium effort, worth a checkBreak up GetOrPollWorkflowMutableState (CCN 41, 202 lines)
service/history/api/get_workflow_util.go:225
GetOrPollWorkflowMutableState nests deeply; easier to read and change once split, which also removes a duplicate; function changed in 17 commits; its file is imported by 82 files.
- gain
- up to +1.5 health on this file(inferred)
- finding
- Nested complexity
- size
- CCN 41, 202 lines, nests 6 deep
- severity
- high
Medium effort, worth a checkStart breaking up bringLocalEventsUpToSourceCurrentBranch (CCN 50, 270 lines)
service/history/ndc/workflow_state_replicator.go:1514
bringLocalEventsUpToSourceCurrentBranch is long and branchy; easier to read and change once split, which also removes a duplicate; function changed in 20 commits; its file is imported by 11 files, changed 8 times in 90 days.
- gain
- up to +0.4 health on this file(inferred)
- finding
- Brain method
- size
- CCN 50, 270 lines, nests 3 deep
- severity
- critical
Medium effort, worth a check
- Lines of code
- 755.3K
Recent activity
All commitsCommits
- a2de6d8bFix Init for workflow root component created via NewMutableS… (#12292)2w ago
- 7ac80efeSkip deployment registration for worker commands task queues (#12381)2w ago
- 1427718aFeat: admin batch enhancements (#12264)2w ago
- e06367b1Add tdbg schedule audit command (#10929)2w ago
- 506d00f9Fix SignalWithStart bypassing continue-as-new backoff (#11810)2w ago
- 4db93cd7Unexport functional test base (#12377)2w ago
Decisions
- Implement AdminService.GetDLQTasksproposed · 2w ago
- Generate migration task via frontend with per-namespace rate limitingproposed · 2w ago
- Add batch workflow refresh tasks via Admin API and Batched System Worker activityproposed · 2w ago
- Remove ref input from manual docker build workflowproposed · 2w ago
- Resolve docker image tags from git refs and auto-detect CLI versionproposed · 2w ago
- Replace gogo/protobuf with google/protobufproposed · 2w ago
Everything we found
6,721 open
Every detector's open count by area, each with its worst example. An inventory, not a to-do list: the actions above are the part worth doing.
- worst item is critical severity. Code health5,438Change entropy · service/matching/matching_engine.go61 findings · 8.0 deducted
- worst item is medium severity. Refactoring368generateGitHubSummary+1.2 health, S effort · tools/flakereport/writer.go
- worst item is medium severity. Doc drift10docs/architecture/circuit-breaker.mdLink points at #what-actually-gets-isolated, which docs/architecture/circuit-breaker.md no longer declares.
- worst item is medium severity. Decisions341tests/activity_standalone_test.go41 awaiting review · 300 hotspots ungoverned
- worst item is medium severity. Ownership562service/history/workflow/timeskipping.go92% single-owner concentration, 9 commits in 90d
- worst item is low severity. Dead code2NewEmbeddedActivityUnreachable function (6 lines)
Composition
Open the graph- go99%
- shell<1%
- makefile<1%
- terraform<1%
Explore this codebase
- Docs4,306 pages across 17 modules
- ChatAsk this codebase a question and get an answer with its sources.
- Files3,156 files with per-file docs, health and history
- ArchitectureDependency graph, layers, and 33 entry points
- Code healthPer-file scores, 7,417 open findings, coverage and refactoring targets
- Knowledge graphEntities, communities, and the paths between them
- Change couplingFiles that keep changing together, mined from commit history
- CommitsChange-risk ranked history with agent provenance
- ContributorsBus factor, per-file maintainers, and the human/agent split
- StatsSize class, origin, lifetime churn, rhythm and records
- CostsWhat indexing this snapshot cost, by model and by run.