repowisetemporalio/temporal

temporalio / temporal

gomaina2de6d8755.3K linessynced 2w ago
Since the previous index, 3mo ago-47 files+0.1 code health+0.8 hotspot health

Code health

6.7out of 10Fair

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 callScaler in service/matching/scale_manager.go while the change is fresh

    1 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)
  • High

    Tidy 2 functions you changed in tools/tdbg/scheduleaudit/analyzer.go this week

    1 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)

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
    worth a check
  • Break 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
    worth a check
  • Start 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
    worth a check
Lines of code
755.3K

Recent activity

All commits

Everything we found

6,721 open
  • go99%
  • shell<1%
  • makefile<1%
  • terraform<1%

Explore this codebase