-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Develop comprehensive FindRelatedPrimitives.ql tool queries for each supported language to discover CodeQL classes, predicates, and types relevant to a source code location.
Query Output Schema
| primitiveType | primitiveName | definitionFile | definitionLine | relevanceScore |
Implementation Design
-
Query Structure (
server/ql/{lang}/tools/src/FindRelatedPrimitives/)FindRelatedPrimitives.ql: Main entry point query- Parameterized by:
file,startLine,endLine,startColumn,endColumn
-
Primitive Discovery Logic
- AST Types: Find CodeQL classes that match AST nodes at location
- Type Predicates: Discover
getType(),getAQualifiedName()accessors - Dataflow Nodes: Map to
DataFlow::Nodesubtypes when applicable - Taint Sources/Sinks: Identify if location matches known sources/sinks
- Control Flow: Find relevant
ControlFlowNodeandBasicBlocktypes
-
Relevance Scoring
- Direct AST match: score 100
- Parent/child AST types: score 75
- Related dataflow concepts: score 50
- Tangentially related types: score 25
-
Per-Language Implementation
Required for:actions,cpp,csharp,go,java,javascript,python,ruby,swift
Acceptance Criteria
- Query implemented for all 9 languages in
server/ql/{lang}/tools/ - Unit tests with
.expectedfiles for each language - Results ranked by relevance score
- Integration with
codeql_query_runtool for execution
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels