JavaScript: calls through a CommonJS destructured require are never resolved (express: 63 call edges from 11,733 call sites)
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 55/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- javascript
- 領域
- devtools
調査の方向性
Reproduce the issue with graphify <path> --code-only, followed by cluster-only --no-label, using the CommonJS example in expressjs/express (lib/utils.js and lib/response.js). Start by tracing how the resolved import binding is handled at the plain identifier call site; done means the graph includes a calls edge from the calling function to normalizeType(), with coverage for this destructured require form.
索引モデルが issue の本文から書いたものです。
説明
Summary
For CommonJS code, graphify resolves the import of a function but not calls through the imported binding. The result is that JavaScript projects get almost no calls edges, while the same analysis on other languages produces one to two orders of magnitude more.
Measurement
Same command on eight well-known repos (graphify <path> --code-only, then cluster-only --no-label). Call sites counted by walking each file's tree-sitter AST for the language's own call node type; call edges counted from graph.json:
| Repo | Language | Call sites | calls edges |
ratio |
|---|---|---|---|---|
| JamesNK/Newtonsoft.Json | C# | 48,070 | 13,487 | 28% |
| google/gson | Java | 23,468 | 5,337 | 23% |
| spf13/cobra | Go | 4,430 | 934 | 21% |
| BurntSushi/ripgrep | Rust | 17,103 | 3,270 | 19% |
| psf/requests | Python | 2,687 | 453 | 17% |
| gin-gonic/gin | Go | 9,414 | 1,346 | 14% |
| pallets/flask | Python | 3,963 | 386 | 10% |
| expressjs/express | JavaScript | 11,733 | 63 | 1% |
express's whole graph contains 11 calls and 52 indirect_call edges across 404 nodes and 119 callable nodes.
Concrete case
expressjs/express at current HEAD:
// lib/utils.js:61
exports.normalizeType = function(type){ ... };
// lib/response.js:27
var normalizeType = require('./utils').normalizeType;
// lib/response.js:587
this.set('Content-Type', normalizeType(key).value);
Everything here is literal: a literal require path, a literal property, and a plain identifier call.
In the resulting graph.json, the node lib_utils_normalizetype has exactly two incoming edges:
response.js --imports--> normalizeType()
lib/utils.js --contains--> normalizeType()
There is no calls edge from lib/response.js to normalizeType(), even though the import was resolved correctly — so the resolver clearly knows where the symbol lives.
Expected
A calls edge from the calling function in lib/response.js to normalizeType() in lib/utils.js.
Why it matters
The import edge being present while the call edge is missing means the information needed to resolve the call is already available; only the call-site binding is not being made. Any consumer doing reachability or call-graph work on JavaScript gets a graph that is essentially call-free — a "no path found" result on a JS project currently means very little.
The var x = require('./m').x destructuring form is extremely common in CommonJS, so this is likely not an edge case.
Environment
- graphify
0.9.65(PyPIgraphifyy) - Python 3.14, Windows 10
expressjs/expressdefault branch, shallow clone 2026-09-22
- 主要言語
- Python
- スター
- 124k
- フォーク
- 11.9k
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Graphify-Labs/graphify のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
Graphify-Labs/graphify#4241 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
Graphify-Labs/graphify#3763 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
Graphify-Labs/graphify#3611 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Nix supportオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
Graphify-Labs/graphify#3193 · リアクション 2 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
Graphify-Labs/graphify#2871 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
Graphify-Labs/graphify の issue をすべて見る
似ている issue
-
docs(types): update the collection binding note now that typed collections shipped in pycubrid 1.9.0オープンdocumentation priority: low size: S
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
cubrid-lab/sqlalchemy-cubrid#768 ·
メンテナーはふだん 1 日以内に返信
-
bug help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
documentation
難易度 1/5 1時間未満 初心者へのやさしさ 65/100
ansys/pydpf-core#3547 ·
メンテナーはふだん 1 日以内に返信
-
core
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
vectorize-io/hindsight#5457 ·
メンテナーはふだん 1 日以内に返信
-
[Bug]: LangChain drops OpenAI Responses text blocks from session recording対応中かも @ktz03 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
volcengine/OpenViking#5806 ·
メンテナーはふだん 1 日以内に返信