Code health of langchain-ai/langchain
Repowise scores langchain-ai/langchain at 6.7 out of 10 for code health, which reads as fair, alongside maintainability 7.8 and static performance 9.9 on the same scale. There are 3,509 open findings across the three pillars, and the lowest-scoring file is base.py at 1.0. Scores are computed from complexity, duplication, churn and git fix history, not from a linter.
Findings by severity
218 critical, 724 high, 885 medium, 1,682 low.
Hotspots
58 files are flagged as hotspots. The top 5:
- libs/partners/openrouter/langchain_openrouter/data/_profiles.py: 69 commits in the last 90 days from 3 contributors
- libs/partners/anthropic/tests/unit_tests/test_chat_models.py: 21 commits in the last 90 days from 29 contributors with 18 recent bug fixes
- libs/partners/anthropic/langchain_anthropic/chat_models.py: 20 commits in the last 90 days from 41 contributors with 15 recent bug fixes
- libs/partners/openai/tests/unit_tests/chat_models/test_base.py: 22 commits in the last 90 days from 40 contributors with 21 recent bug fixes
- libs/partners/openai/langchain_openai/chat_models/base.py: 20 commits in the last 90 days from 78 contributors with 17 recent bug fixes
Lowest-scoring files
- libs/partners/openai/langchain_openai/chat_models/base.py: 1.0 out of 10 with 17 bug fixes in the last 180 days
- libs/partners/anthropic/langchain_anthropic/chat_models.py: 1.0 out of 10 with 15 bug fixes in the last 180 days
- libs/core/langchain_core/runnables/base.py: 1.0 out of 10 with 4 bug fixes in the last 180 days
- libs/core/langchain_core/messages/utils.py: 1.0 out of 10 with 5 bug fixes in the last 180 days
- libs/core/langchain_core/language_models/chat_models.py: 1.0 out of 10 with 7 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 2,654 scored files, 9.9% had a bug fix in that window.
Dead code and refactoring
Repowise found 19 unused exports. 121 refactoring targets across 121 files would raise the score.
More on langchain: summary and FAQ, codebase overview, architecture.