Pass 3 of 3 · Deep dive of PHAROSPass 1 · OverviewPass 2 · How it works
Code Observatory / function
_candidates
codeintel.describe._candidates
PINNED SOURCE Source and edges from the index at this commit. An execution appears only where one was recorded.
PHAROS at 975a38dMIT license
Around this symbol
Search all symbolsLoading
| Symbol | File | Resolved by |
|---|---|---|
| path_role | retrieval.py | through an import |
| Symbol | File | Resolved by |
|---|---|---|
| describe_repository | describe.py | same file |
| Symbol | File | Resolved by |
|---|---|---|
| describe | describe.py | same file |
codeintel.describe._candidatesbackend/app/codeintel/describe.py, lines 77–100Open source
def _candidates(db: Session, repository_id, only_undocumented: bool, limit: int | None): rows = db.execute( select(DocumentChunk, Resource.content_sha) .join(Resource, Resource.id == DocumentChunk.resource_id) .where(DocumentChunk.repository_id == repository_id, DocumentChunk.ast_node_type.in_(KINDS)) .order_by(DocumentChunk.chunk_metadata["path"].as_string(), DocumentChunk.start_line) ).all() cached = { (sha, sym) for sha, sym in db.execute( select(ChunkDescription.content_sha, ChunkDescription.symbol_name) .where(ChunkDescription.content_sha.in_({sha for _, sha in rows if sha})) ) } out = [] for chunk, sha in rows: meta = chunk.chunk_metadata or {} if not sha or (sha, chunk.symbol_name) in cached or path_role(meta.get("path", "")) != "source": continue if only_undocumented and meta.get("docstring"): continue out.append((chunk, sha)) # Undocumented first: they gain most. out.sort(key=lambda item: bool((item[0].chunk_metadata or {}).get("docstring"))) return out[:limit] if limit else outWhat the index recorded
- Signature
def _candidates(db: Session, repository_id, only_undocumented: bool, limit: int | None):- File
backend/app/codeintel/describe.py- Lines
- 77–100
- Parser
- python-ast
- Git blob
9e70d40ab4a4d664b1b0e8b0ac225e7a134fa3f2- Call sites
- 13 named, 3 resolved, 10 left unlinked
- Outside this subset
- 2 more edges reach code outside the graph shown here
