repowiseory/kratos

Code health of ory/kratos

Repowise scores ory/kratos at 6.7 out of 10 for code health, which reads as fair, alongside maintainability 7.5 and static performance 9.9 on the same scale. There are 2,659 open findings across the three pillars, and the lowest-scoring file is migrator.go at 1.0. Scores are computed from complexity, duplication, churn and git fix history, not from a linter.

Findings by severity

209 critical, 306 high, 814 medium, 1,248 low.

Hotspots

78 files are flagged as hotspots. The top 5:

  • persistence/sql/identity/persister_identity.go: 13 commits in the last 90 days from 7 contributors
  • identity/test/pool.go: 6 commits in the last 90 days from 6 contributors
  • identity/handler_test.go: 7 commits in the last 90 days from 7 contributors
  • selfservice/strategy/oidc/strategy_test.go: 8 commits in the last 90 days from 7 contributors
  • schema/validator_test.go: 4 commits in the last 90 days from 3 contributors

Lowest-scoring files

  • oryx/popx/migrator.go: 1.0 out of 10 with 1 bug fix in the last 180 days
  • oryx/popx/transaction.go: 1.0 out of 10 with 1 bug fix in the last 180 days
  • schema/prevalidate.go: 1.4 out of 10 with 3 bug fixes in the last 180 days
  • identity/handler_test.go: 1.7 out of 10 with 5 bug fixes in the last 180 days
  • selfservice/flow/login/handler.go: 1.7 out of 10 with 2 bug fixes in the last 180 days

Checked against bug fixes

Of the 20 files Repowise scores lowest, 20 had a bug fix in the last 180 days. Across all 7,110 scored files, 3.3% had a bug fix in that window.

Dead code and refactoring

Repowise found 273 unused exports. 118 refactoring targets across 118 files would raise the score.

More on kratos: summary and FAQ, codebase overview, architecture.

Related guide: Best dead code detection tools by language