Skip to content

08. Reports, CI & Build Check

← Previous: Runtime Components | Next: Profiles & Settings →


Exporting Reports

From the Scene Doctor ⋯ menu, you can export detailed audit data at any time:

  • Export Report (JSON + HTML): Audits all currently opened scenes and exports the results immediately.
  • Audit Build Scenes…: Opens each scene enabled in Unity’s Build Settings sequentially, audits it against the platform profile, exports comprehensive multi-scene telemetry, and restores your previous open scenes cleanly.

Reports are saved to timestamped directories under the project root:

FuzzyOptimizerReports/yyyyMMdd_HHmmss/
├── report.json # Full machine-readable audit data (scores, metrics, rule IDs, issue counts)
└── report.html # Standalone, self-contained HTML visual dashboard (zero external CSS/JS dependencies)

Headless CLI for CI / CD Pipelines

Run automated audits in continuous integration environments (GitHub Actions, GitLab CI, Jenkins) using Unity’s -executeMethod flag:

Terminal window
Unity -batchmode -nographics -projectPath . \
-executeMethod FuzzyLogicLabs.FuzzyOptimizer.Editor.Reports.FuzzyOptimizerCLI.Audit \
-fuzzyProfile Mobile \
-fuzzyScenes build \
-fuzzyMinScore 75 \
-fuzzyFailOnCritical \
-fuzzyOutput Reports/ \
-logFile -

Command Line Arguments

ArgumentValid ValuesDefaultDescription
-fuzzyProfileMobile, StandaloneVR, DesktopMid, DesktopHigh, CustomDesktopMidPlatform budget profile. Custom uses the profile asset assigned in project settings.
-fuzzyProfileAssetAsset path string—Path to a specific OptimizerProfile asset (e.g. Assets/Settings/Handheld.asset). Overrides -fuzzyProfile.
-fuzzyScenesbuild, all, or semicolon/comma-separated pathsbuildbuild audits enabled scenes in Build Settings; all audits every scene under Assets/; or supply explicit file paths.
-fuzzyOutputDirectory pathFuzzyOptimizerReports/<timestamp>Destination folder for report.json and report.html.
-fuzzyMinScoreInteger 0 – 1000 (Disabled)Fails the quality gate if any scene scores below this threshold.
-fuzzyFailOnCriticalFlagOffFails the quality gate immediately if any scene contains a Critical severity issue.

Process Exit Codes

Exit CodeMeaningCI Handling
0PassedAll audited scenes met or exceeded the quality gate criteria.
1Quality Gate FailedOne or more scenes failed the minimum score or had Critical issues. Reasons are logged as errors.
2CLI ErrorInvalid arguments, missing profile asset, or unhandled exception during execution.

Do Not Pass -quit

Do not pass Unity’s -quit command line switch; the FuzzyOptimizerCLI automatically handles editor termination and sets the appropriate process exit code.

GitHub Actions CI Workflow Example

name: Performance Audit Gate
on:
pull_request:
branches: [ main, develop ]
jobs:
audit:
runs-on: self-hosted
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Run FuzzyOptimizer Scene Audit
run: >
"$UNITY_PATH" -batchmode -nographics -projectPath . -logFile -
-executeMethod FuzzyLogicLabs.FuzzyOptimizer.Editor.Reports.FuzzyOptimizerCLI.Audit
-fuzzyProfile DesktopMid
-fuzzyMinScore 70
-fuzzyFailOnCritical
-fuzzyOutput Reports/
- name: Upload Audit Artifacts
uses: actions/upload-artifact@v4
if: always()
with:
name: fuzzy-optimizer-report
path: Reports/

Player Build Check (Build Quality Gate)

FuzzyOptimizer includes an optional Player Build Quality Gate that audits scenes automatically whenever a developer or CI pipeline builds a player binary (BuildPlayer).

Configure this feature in the dashboard Settings tab:

SettingDefaultDescription
Build Check EnabledfalseWhen enabled, intercepts the Unity build pipeline via IProcessSceneWithReport.
Target ProfileDesktopMidPerformance profile used to audit scenes during the build process.
Min Score0 (Disabled)Minimum score required for scenes to pass the build gate.
Fail On CriticalfalseHalts the build immediately if any scene triggers a Critical issue.

Failure Behavior

If a scene violates the quality gate during a player build, FuzzyOptimizer aborts the build process by throwing a BuildFailedException that specifies the failing scene, the offending rules, and the path to the exported HTML report.

All build check settings are serialized to ProjectSettings/FuzzyOptimizerSettings.json, ensuring the entire team enforces the identical build gate.


C# Scripting API

You can trigger programmatic scene audits in custom editor tools:

using FuzzyLogicLabs.FuzzyOptimizer.Editor.Audit;
using FuzzyLogicLabs.FuzzyOptimizer.Editor.Reports;
using FuzzyLogicLabs.FuzzyOptimizer.Runtime.Core;
// 1. Instantiate or load a profile
var profile = OptimizerProfile.CreateDefaultProfile(OptimizerTargetPlatform.Mobile);
// 2. Run the audit against all open scenes
AuditReport report = SceneAuditor.RunAudit(profile);
// 3. Inspect results
Debug.Log($"Scene Health Score: {report.OverallScore}/100");
Debug.Log($"Critical Issues Found: {report.CriticalCount}");
// 4. Export report files to disk
string outputDir = "FuzzyOptimizerReports/CustomExport";
ReportExporter.ExportJson(report, outputDir);
ReportExporter.ExportHtml(report, outputDir);