The Analysis Pipeline
When you runskylos ., here’s what happens:
Phase 1: Discovery
Skylos starts by mapping your project:__pycache__, .git, venv, .venv, node_modules, build, dist
These are skipped because they contain non-source files or third-party code you don’t control.
Phase 2: Parsing
Each file is parsed into an Abstract Syntax Tree (AST)—a structured representation of your code: From the AST, Skylos extracts:| Extraction | What It Captures |
|---|---|
| Definitions | Functions, classes, methods, variables, imports |
| References | Function calls, attribute access, name lookups |
| Framework signals | Decorators, base classes, magic patterns |
Why AST, Not Regex?
Regex can’t understand code structure:Phase 3: Analysis Engines
Skylos runs multiple analysis engines in parallel:Reference Graph Builder
Creates a map of what calls what: Any definition with zero incoming edges is potentially dead code.Taint Analysis Engine
Traces data flow from sources to sinks: The taint “flows” through assignments. When it reaches a sink, we flag it.Complexity Calculator
Walks function bodies counting decision points:Secret Scanner
Pattern-matches against known credential formats:Phase 4: Confidence Scoring
Not every “unused” definition is actually dead. Skylos scores confidence based on signals: This is why Skylos has far fewer false positives than tools that do simple “is it referenced?” checks.Phase 5: Output & Gating
Results are formatted and optionally checked against gate policies:Performance
Skylos is designed for speed:| Optimization | How It Helps |
|---|---|
| Parallel file parsing | Multi-core AST parsing |
| Single-pass collection | Definitions and references in one walk |
| Lazy taint analysis | Only runs when --danger is enabled |
| Early filtering | Exclusions applied before parsing |
- 10K LOC: < 2 seconds
- 100K LOC: < 10 seconds
- 1M LOC: < 60 seconds
Extensibility
Skylos uses a rule-based architecture:rules/danger/— Security rulesrules/quality/— Complexity, nesting, structurerules/secrets.py— Credential detection
