yocto-lens is a lightning-fast, terminal-based Static Code Analysis, Style Review, and Recipe Health Auditing engine built specifically for Yocto Project and OpenEmbedded layers.
As an advanced BitBake linter, Yocto Lens helps embedded Linux developers proactively identify security vulnerabilities, maintainability regressions, layer dependency bottlenecks, patch quality concerns, and metadata style violations before they break your CI/CD pipelines or target hardware builds.
- BitBake Recipes & Appends:
.bband.bbappendconfiguration files - Patch Modifications:
.patchand upstream diff structures - Layer Definitions:
conf/layer.confboundaries
Designed for absolute portability: Yocto Lens acts as a standalone utility working seamlessly across any workspace layout. It does not depend on KAS configurations, massive Docker containers, repo manifests, or specific environmental variables.
β οΈ Note:yocto-lensis under active development. Expect rapid feature expansion, performance scaling, and frequent updates.
Our core static analysis rules evaluate structural correctness, security configurations, build reproducibility, and system integration risks.
- Vulnerability Scans: Detects floating
SRCREV, high-riskAUTOREVusage, and insecureSRC_URIprotocols (e.g., unencrypted HTTP). - Secrets Detection: Scans metadata lines for hardcoded credentials, API tokens, and credentials.
- Path Sanitation: Flags host-specific absolute filesystem paths leaking into compilation contexts.
- Orphan Asset Identification: Automatically finds dangling
.bbappendconfigurations missing baseline targets. - Layer Layer Validation: Evaluates structural problems like duplicate recipe definitions across overlapping layers.
- Dependency Analysis: Maps missing
LAYERSERIES_COMPATdeclarations, missingBBFILE_COLLECTIONS, isolated layer instances, and cyclic layer dependency faults. - License Compliance: Identifies absent
LICENSEorLIC_FILES_CHKSUMentries, highlights explicit GPLv3 package inclusions, and surfaces customCLOSEDlicense tracking warnings.
Ensure your code complies with OpenEmbedded syntax guidelines to enforce high readability and automated review hygiene.
- Descriptive Validation: Finds variables lacking essential
SUMMARYorDESCRIPTIONdocumentation fields. - Formatting Controls: Enforces rigid variable assignment ordering rules, line length restrictions, and strips trailing whitespaces.
- Syntax Optimization: Migrates and flags legacy syntax strings such as the outdated overrides notation (
_append,_prepend,_remove). - Conventions Compliance: Checks recipe file names against canonical naming rules and verifies compliance of internal patch metadata headers.
- Upstream Standards: Verifies mandatory
Upstream-Statusconfigurations and authenticatesSigned-off-bydeveloper signatures. - Structure Audits: Isolates invalid contextual diff blocks, strips accidental structural secrets, and confirms CVE validation criteria.
- Switch instantly between dedicated Static Analysis, Style Check, and Recipe Health execution tabs.
- Real-time calculation engine computing granular health scores and population leaderboards.
- Features a high-fidelity inline Inspector Panel, deep-dive detail views, and lightning-fast search filters.
- Fully supports raw console telemetry data output pipelines via JSON and SARIF formatting exports.
Navigate to the Yocto Lens Releases Page and download the optimized binary tailored for your workstation operating system.
chmod +x yocto-lens
./yocto-lens <path_to_yocto_layer>.\yocto-lens.exe <path_to_yocto_layer>To scan a target project root folder recursively, supply the explicit workspace destination:
yocto-lens <path_to_yocto_layer>Evaluate cross-layer dependencies or naming anomalies simultaneously by declaring multiple arguments:
yocto-lens meta-custom meta-product meta-securityExecute analytical evaluations without starting the interactive terminal layout layer:
yocto-lens --no-tui /path/to/meta-custom# Target only structural vulnerabilities and security flags
yocto-lens --no-tui --mode static /path/to/meta-custom
# Enforce code styling standards exclusively
yocto-lens --no-tui --mode style /path/to/meta-custom# Generate comprehensive JSON formats for internal reporting
yocto-lens <path_to_yocto_layer> --json report.json
# Produce industry-standard SARIF data for GitHub Security Code Scanning integration
yocto-lens <path_to_yocto_layer> --sarif report.sarif| Shortcut Key | Triggered Navigation Action |
|---|---|
β / β |
Navigate active metadata findings sequentially |
Enter |
Expand the deep-dive diagnostic inspector panel view |
Esc |
Return safely to the preceding dashboard menu grid |
/ |
Initialize inline global fuzzy text filtering pattern |
s / Tab |
Pivot application context between static analysis and styling diagnostics |
h |
Launch the overarching Recipe Health Score leaderboard matrix |
q |
Immediately terminate the interactive TUI application safely |
Type / directly during a runtime session to execute live queries across all generated reports. The searching mechanics query properties including:
- Rule ID & String Contexts
- Severity Classifications (
HIGH,WARN,INFO) - Category Classifications & Exact Filenames
- Target Directory Strings, Layers, and Diagnostic Messages
# Search Query Examples:
license
autorev
bbappend
patch
secret
style
HIGH
srcuri
Ensure your development machine has Go (Golang) version 1.22+ successfully configured.
# Clone the repository
git clone https://github.com/prashantdivate/yocto-lens.git
cd yocto-lens
# Compile localized architecture release structures
go build -o yocto-lens ./cmd/yocto-lensgit clone https://github.com/prashantdivate/yocto-lens.git
cd yocto-lens
go build -o yocto-lens ./cmd/yocto-lensRun:
./yocto-lens /path/to/meta-customYocto Lens is already being used to automate metadata quality checks in Yocto BSP development workflows.
| Project | Usage |
|---|---|
| Dynamic Devices BSP | CI validation and metadata quality checks |
Yocto Lens is already being integrated into automated Yocto validation pipelines.
Example:
- Dynamic Devices BSP Layer
CI Integration Script:
https://github.com/DynamicDevices/meta-dynamicdevices-bsp/blob/main/scripts/yocto-lens-ci.sh
./yocto-lens --no-tui --mode static --json yocto-lens.json --sarif yocto-lens.sarif .Community feature inquiries, architectural bug tracking reports, and open GitHub Pull Requests are highly encouraged.
If Yocto Lens reduces your code review overhead or hardens your build environments, please consider dropping a project β!
This system is licensed entirely under the MIT Open Source License.

