Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions USER_GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -1247,9 +1247,9 @@ same source location.
| `--kind <kind>` | `definition`, `references`, `callers`, `callees`, `symbols`, `hotspots`, `unused`, `validate` | Filter by kind (case-insensitive; `--kind FUNCTION` is treated as `--kind function`). `definition` / `symbols` / `hotspots` / `unused` use symbol kinds (`function`, `lambda`, `async_function`, `generator`, `async_generator`, `test.method`, `class`, `struct`, `interface`, `protocol`, `enum`, `property`, `event`, `delegate`, `namespace`, `import`); `references` accepts all indexed reference kinds (`call`, `instantiate`, `subscribe`, `attribute`, `annotation`, `type_reference`); `callers` / `callees` accept only the call-graph kinds (`call`, `instantiate`, `subscribe`) and reject non-call-graph kinds (`--kind attribute` / `--kind annotation` / `--kind type_reference`) with a usage error — metadata rows are attributed to the enclosing body-range symbol rather than the annotated target, and `type_reference` rows are compile-time type-position edges (declaration types, generic constraints, `is`/`as`/`instanceof`, XML-doc `cref`) rather than runtime calls, so `callers` / `callees` cannot answer either correctly; use `references --kind attribute` / `references --kind annotation` / `references --kind type_reference` instead. `references` defaults to every indexed reference kind so metadata usages remain visible, while `callers` / `callees` / `hotspots` / `impact` default to the call-graph kinds only (`call`, `instantiate`, `subscribe`) and exclude metadata edges (`attribute`, `annotation`, `type_reference`). Identical constructor `call` + `instantiate` rows at one physical site still collapse; `validate` uses issue kinds such as `bom` |
| `--rank-by <weighted\|count\|kind>` | `callers`, `callees` | Choose the caller/callee ranking model. `weighted` is the default and scores `instantiate=3.0`, `call=1.0`, `subscribe=0.1`; `count` sorts by raw `reference_count`; `kind` groups by reference kind first, then count. |
| `--body` | `definition`, `references`, `callers`, `callees`, `impact`, `inspect` | Include reconstructed body content or capped graph-location excerpts |
| `--count` | `search`, `definition`, `references`, `callers`, `callees`, `symbols`, `files`, `find`, `impact`, `unused`, `hotspots` | Return only counts. `search` / `definition` / `references` / `callers` / `callees` / `symbols` / `files` / `find` / `unused` ignore `--limit` and return authoritative totals; `impact` and `hotspots` still report the visible page count and may truncate with `--limit` (with `--json`: a single count object; commands that expose file counts add `files`) |
| `--count` | `search`, `definition`, `references`, `callers`, `callees`, `symbols`, `files`, `find`, `impact`, `unused`, `hotspots` | Return only counts. `search` / `definition` / `references` / `callers` / `callees` / `symbols` / `files` / `find` / `unused` / `hotspots` ignore `--limit` and return authoritative totals; only `impact` still reports the visible page count and may truncate with `--limit` (with `--json`: a single count object; commands that expose file counts add `files`) |
| `--group-by <symbol\|file\|statement>` | `hotspots` | Choose the hotspot grouping unit. The default is `symbol` for non-SQL scopes and `statement` for `--lang sql`, preserving SQL's statement-oriented grouping; JSON includes `grouped_by` so mixed-language callers can verify the active unit. `file` rolls symbol hotspot volume up to target files. |
| `--group-by-name` | `hotspots` | Collapse rows that share the same `(name, kind)` across files into one representative result while preserving `definition_sites` / `paths` metadata in JSON. The top-level JSON `count` is the number of returned name/kind groups after `--limit`; use `definition_site_total` for the grouped definition-site total, each hotspot's `reference_count` for raw incoming references, and the count-only JSON `files` field for distinct files. Hotspot ordering uses a weighted invocation score (`call` / `instantiate` = 1.0, `subscribe` = 0.3) while still showing the raw reference count; metadata-only edges such as `attribute`, `annotation`, and `type_reference` remain excluded from default hotspots. |
| `--group-by-name` | `hotspots` | Collapse rows that share the same `(name, kind)` across files into one representative result while preserving `definition_sites` / `paths` metadata in JSON. Per-group `paths` samples are capped at 20 entries; `paths_truncated` signals that more definition paths exist. In normal JSON, the top-level `count` is the number of returned name/kind groups after `--limit`; with `--count`, `count`, `files`, and `definition_site_total` are full totals that ignore `--limit`. Use each hotspot's `reference_count` for raw incoming references. Hotspot ordering uses a weighted invocation score (`call` / `instantiate` = 1.0, `subscribe` = 0.3) while still showing the raw reference count; metadata-only edges such as `attribute`, `annotation`, and `type_reference` remain excluded from default hotspots. |
| `--with-paths` | `impact` | Emit a `paths` array on each caller listing the shortest call chains `[resolvedRoot, intermediate..., callerName]`. Same-depth diamond convergence (e.g. `A → B → foo` and `A → C → foo`) surfaces both routes that the default dedup collapses. Per-row cap (10) keeps JSON payloads bounded; `paths_truncated` signals overflow. Off by default; default behavior is unchanged. |
| `--start <line>` | `excerpt` | Start line for excerpt reconstruction (max: 10000000) |
| `--end <line>` | `excerpt` | End line for excerpt reconstruction (defaults to `--start`; max: 10000000) |
Expand Down Expand Up @@ -3537,9 +3537,9 @@ raw match density を正確に測る、といった理由で全 raw chunk hit
| `--lang <lang>` | クエリ系 | 言語でフィルタ(大文字小文字を区別しない。`--lang Python` は `--lang python` と同じ扱い)。`c#`、`cs`、`kt`、`kts` のような一般的な別名も受け付ける。未知の値を指定すると、人間向け出力の 0 件応答に `Available: <言語一覧>` ヒントが付く。 |
| `--kind <kind>` | `definition`, `references`, `callers`, `callees`, `symbols`, `hotspots`, `unused`, `validate` | 種別でフィルタ(大文字小文字を区別しない。`--kind FUNCTION` は `--kind function` と同じ扱い)。`definition` / `symbols` / `hotspots` / `unused` は symbol kind(`function`、`lambda`、`async_function`、`generator`、`async_generator`、`test.method`、`class`、`struct`、`interface`、`protocol`、`enum`、`property`、`event`、`delegate`、`namespace`、`import`)、`references` は全ての reference kind(`call`、`instantiate`、`subscribe`、`attribute`、`annotation`、`type_reference`)を受け付ける。`callers` / `callees` は call-graph 種別のみ(`call`、`instantiate`、`subscribe`)を受け付け、非 call-graph 種別(`--kind attribute` / `--kind annotation` / `--kind type_reference`)は usage error で拒否する — metadata 行は注釈対象そのものではなく body-range 上の外側シンボルに帰属し、`type_reference` は宣言型・generic 制約・`is`/`as`/`instanceof`・XML-doc `cref` といった compile-time な型位置エッジであり実行時呼び出しではないため、`callers` / `callees` はいずれの kind にも正しく答えられない。metadata / 型位置参照の列挙は `references --kind attribute` / `references --kind annotation` / `references --kind type_reference` を使う。`references` の既定は全 reference kind を表示して metadata 参照も見えるままにするが、`callers` / `callees` / `hotspots` / `impact` の既定は call-graph kind(`call`、`instantiate`、`subscribe`)のみで、`attribute` / `annotation` / `type_reference` のような metadata edge は除外する。同じ物理位置にある constructor の `call` + `instantiate` 重複行は引き続き集約する。`validate` は `bom` などの issue kind を使う |
| `--body` | `definition`, `references`, `callers`, `callees`, `impact`, `inspect` | 再構成した本文、または上限付きの graph 位置抜粋を含める |
| `--count` | `search`, `definition`, `references`, `callers`, `callees`, `symbols`, `files`, `find`, `impact`, `unused`, `hotspots` | 件数だけを返す。`search` / `definition` / `references` / `callers` / `callees` / `symbols` / `files` / `find` / `unused` は `--limit` を無視した総件数を返し、`impact` と `hotspots` は visible page count のままで `--limit` によって切り詰められることがある(`--json` 併用時は単一の count オブジェクト。files 件数を出すコマンドは `files` も返す) |
| `--count` | `search`, `definition`, `references`, `callers`, `callees`, `symbols`, `files`, `find`, `impact`, `unused`, `hotspots` | 件数だけを返す。`search` / `definition` / `references` / `callers` / `callees` / `symbols` / `files` / `find` / `unused` / `hotspots` は `--limit` を無視した総件数を返し、`impact` だけは visible page count のままで `--limit` によって切り詰められることがある(`--json` 併用時は単一の count オブジェクト。files 件数を出すコマンドは `files` も返す) |
| `--group-by <symbol\|file\|statement>` | `hotspots` | hotspot の集計単位を選ぶ。既定は非 SQL scope では `symbol`、`--lang sql` では既存の statement-oriented grouping を保つため `statement`。JSON には `grouped_by` が入り、mixed-language 呼び出しでも現在の単位を確認できる。`file` は symbol hotspot の参照量を対象ファイル単位にまとめる。 |
| `--group-by-name` | `hotspots` | ファイルをまたいで同じ `(name, kind)` を共有する行を代表1件に集約し、JSON では `definition_sites` / `paths` metadata を保持したまま返す。top-level JSON の `count` は `--limit` 適用後に返された name/kind group 数であり、grouped definition-site 合計は `definition_site_total`、生の incoming reference 数は各 hotspot の `reference_count`、distinct file 数は count-only JSON の `files` field を参照する。hotspot の順位付けは重み付き invocation score(`call` / `instantiate` = 1.0、`subscribe` = 0.3)を使い、生の reference count も引き続き表示する。`attribute` / `annotation` / `type_reference` のような metadata-only edge は既定の hotspots から除外されたまま。 |
| `--group-by-name` | `hotspots` | ファイルをまたいで同じ `(name, kind)` を共有する行を代表1件に集約し、JSON では `definition_sites` / `paths` metadata を保持したまま返す。group ごとの `paths` sample は 20 件に制限し、さらに definition path がある場合は `paths_truncated` を返す。通常 JSON の top-level `count` は `--limit` 適用後に返された name/kind group 数であり、`--count` 併用時の `count`、`files`、`definition_site_total` は `--limit` を無視した総数を返す。生の incoming reference 数は各 hotspot の `reference_count` を参照する。hotspot の順位付けは重み付き invocation score(`call` / `instantiate` = 1.0、`subscribe` = 0.3)を使い、生の reference count も引き続き表示する。`attribute` / `annotation` / `type_reference` のような metadata-only edge は既定の hotspots から除外されたまま。 |
| `--with-paths` | `impact` | 各 caller に `paths` 配列を付け、`[resolvedRoot, 中間..., callerName]` の順で最短呼び出し経路を列挙する。同 depth で複数経路が収束するダイヤモンド(例: `A → B → foo` と `A → C → foo`)でも、既定 dedup で潰れる経路をすべて表示する。1 行あたりの保持上限は 10 経路で、超過時は `paths_truncated` を `true` にする。既定では出力しないため、フラグ未指定時の挙動は変更しない。 |
| `--start <line>` | `excerpt` | 抜粋再構成の開始行(最大: 10000000) |
| `--end <line>` | `excerpt` | 抜粋再構成の終了行(省略時は `--start` と同じ、最大: 10000000) |
Expand Down
16 changes: 16 additions & 0 deletions changelog.d/unreleased/2991.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
category: fixed
issues:
- 2991
affected:
- src/CodeIndex/Database/DbSymbolReader.cs
- tests/CodeIndex.Tests/DbReaderTests.cs
---

## English

- **C# property hotspots no longer use repo-wide bare-name counts for common member names (#2991)** — `hotspots` now keeps C# properties such as record component `Equal` on the conservative in-target counting path, so unrelated same-name local references no longer inflate property rankings.

## 日本語

- **C# property hotspot が一般的なメンバー名をリポジトリ全体の bare-name 件数で過集約しないよう修正しました (#2991)** — `hotspots` は record component の `Equal` のような C# property を保守的な in-target counting 経路に保つため、無関係な同名ローカル参照で property ranking が膨らまなくなりました。
20 changes: 20 additions & 0 deletions changelog.d/unreleased/3153.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
category: fixed
issues:
- 3153
affected:
- src/CodeIndex/Database/DbSymbolReader.cs
- src/CodeIndex/Cli/QueryCommandRunner.cs
- src/CodeIndex/Cli/ConsoleUi.cs
- src/CodeIndex/Models/QueryResults.cs
- tests/CodeIndex.Tests/QueryCommandRunnerSymbolTests.cs
- USER_GUIDE.md
---

## English

- **`hotspots --count` now ignores display limits (#3153)** — count-only hotspots use dedicated total-count queries for symbol, file, and same-name group modes, so `--limit` no longer caps `count`, `files`, or grouped `definition_site_total`.

## 日本語

- **`hotspots --count` が表示上限に制限されないよう修正しました (#3153)** — count-only hotspots は symbol、file、same-name group の各 mode で専用の総件数 query を使うため、`--limit` が `count`、`files`、grouped `definition_site_total` を切り詰めなくなりました。
20 changes: 20 additions & 0 deletions changelog.d/unreleased/3159.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
category: fixed
issues:
- 3159
affected:
- src/CodeIndex/Database/DbSymbolReader.cs
- src/CodeIndex/Cli/JsonOutputContracts.cs
- src/CodeIndex/Cli/QueryCommandRunner.cs
- src/CodeIndex/Models/QueryResults.cs
- tests/CodeIndex.Tests/QueryCommandRunnerSymbolTests.cs
- USER_GUIDE.md
---

## English

- **Grouped hotspot path samples are now bounded (#3159)** — `hotspots --group-by-name --json` caps each group's `paths` array at 20 entries and reports `paths_truncated` when additional definition paths exist, keeping same-name aggregates from producing very large JSON payloads.

## 日本語

- **Grouped hotspot の path sample に上限を設けました (#3159)** — `hotspots --group-by-name --json` は各 group の `paths` 配列を 20 件に制限し、追加の definition path がある場合は `paths_truncated` を返すため、同名集約で JSON payload が過大にならなくなりました。
2 changes: 1 addition & 1 deletion src/CodeIndex/Cli/CliFlagSchema.cs
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ private static IReadOnlyList<CliFlag> BuildAll()
new() { Name = "--with-paths", Description = "Impact: include shortest call chains per caller", Commands = Set("impact") },
new() { Name = "--reverse", Description = "Reverse direction (show dependents)", Commands = Set("deps") },
new() { Name = "--group-by", ValuePlaceholder = "<symbol|file|statement>", Description = "Hotspots: choose grouping unit", Commands = Set("hotspots") },
new() { Name = "--group-by-name", Description = "Hotspots: collapse same-name rows; count is name/kind groups", Commands = Set("hotspots") },
new() { Name = "--group-by-name", Description = "Hotspots: collapse same-name rows; JSON paths capped per group", Commands = Set("hotspots") },
new() { Name = "--check", Description = "Verify status freshness/readiness", Commands = Set("status") },
new() { Name = "--config", Description = "Print effective configuration with source attribution", Commands = Set("status") },
new() { Name = "--stale-after", ValuePlaceholder = "<duration>", Description = "Status: freshness age threshold (e.g. 30m, 2h, 7d)", Commands = Set("status") },
Expand Down
4 changes: 2 additions & 2 deletions src/CodeIndex/Cli/ConsoleUi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1058,7 +1058,7 @@ private static void PrintFlagReference(Action<string> WriteHelpLine)
Console.WriteLine(" --severity <s> validate only: filter issues by severity: info, warning, error");
Console.WriteLine(" --visibility <v[,v]> Filter symbols/definitions/unused/hotspots by visibility: public, protected, internal, private");
WriteHelpLine(" --exclude-visibility <v[,v]> Exclude symbols/definitions/unused/hotspots by visibility");
WriteHelpLine(" --count Count only; search/definition/references/callers/callees/symbols/files/find/unused ignore --limit, impact/hotspots still use visible page counts");
WriteHelpLine(" --count Count only; search/definition/references/callers/callees/symbols/files/find/unused/hotspots ignore --limit, impact still uses visible page counts");
Console.WriteLine(" --since <datetime> Filter to files modified since this timestamp (ISO 8601)");
Console.WriteLine(" --no-dedup search only: return every raw overlapping chunk hit (debug/density)");
WriteHelpLine($" --require-before/--require-after <query> search only: keep primary matches only when the guard query appears within --guard-window lines before/after the match (default {DbReader.DefaultSearchGuardWindow}, max {DbReader.MaxSearchGuardWindow})");
Expand All @@ -1068,7 +1068,7 @@ private static void PrintFlagReference(Action<string> WriteHelpLine)
WriteHelpLine(" --max-hops <n> Max BFS hops for impact analysis, inclusive (default: 5; --max-hops 2 returns callers at hop 1 and 2; --max-hops 0 resolves the symbol without traversing callers)");
Console.WriteLine(" --depth <n> Deprecated alias for --max-hops");
Console.WriteLine(" --reverse Reverse direction for deps (show dependents)");
WriteHelpLine(" --group-by-name hotspots: collapse rows sharing (name, kind) across files; JSON count is the number of name/kind groups, not reference, file, or definition-site count");
WriteHelpLine(" --group-by-name hotspots: collapse rows sharing (name, kind) across files; JSON paths are capped per group with paths_truncated");
WriteHelpLine(" --with-paths impact: also emit `paths` per caller — the shortest call chains [root, ..., caller] (diamond graphs surface every converging route, capped per row)");
WriteHelpLine(" unused reflection note C# nameof/typeof and direct reflection member-name literals such as GetMethod(\"Foo\") are indexed; dynamically constructed reflection names may need manual review");
WriteHelpLine(" Note: if a query itself starts with '-', pass it with --query <query> or -- <query>; for option values that start with '--', use --opt=<value>.");
Expand Down
3 changes: 2 additions & 1 deletion src/CodeIndex/Cli/JsonOutputContracts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,8 @@ internal sealed record GroupedSymbolHotspotJsonResult(
string? Visibility,
string? Container,
int DefinitionSites,
List<string> Paths);
List<string> Paths,
bool PathsTruncated);

internal sealed record VersionInfoJsonResult(
[property: JsonPropertyName("name")] string Name,
Expand Down
Loading
Loading