This guide walks you through the full path from "I have nothing" to "the analyzer runs on my code". It is written for people who are new to Delphi.
You will end up with:
- the standalone Windows app (
StaticCodeAnalyser.d12.exe) - the IDE plugin (loaded into Delphi 12 every time you open it)
- Windows 10 or 11 (64-bit).
- About 25 GB free disk (RAD Studio is big).
- An internet connection (for the download and for git).
- An Embarcadero account (free).
- About 45 minutes total. Most of that is the RAD Studio installer.
You need Delphi 12 Athens (also called RAD Studio 12). The free Community Edition is enough.
- Go to https://www.embarcadero.com/products/delphi/starter.
- Click "Download Free Trial" or "Community Edition".
- Sign in with your Embarcadero account (create one if you do not have it).
- Run the installer (
RADStudio_Athens_setup.exe). - Pick:
- Personality: Delphi (you do not need C++Builder).
- Platforms: Windows 32-bit AND Windows 64-bit (you need both).
- Languages: English is fine.
- Extras (optional): GetIt-Package-Manager — leave the default.
- Wait. The download is ~6 GB; the install adds another ~12 GB.
- After install, start RAD Studio. Accept the EULA on first run.
You should now see the Delphi IDE with a "Welcome" tab. Close any example projects it opens.
You need git for Windows: https://git-scm.com/download/win.
Open Command Prompt or PowerShell in the folder where you keep your code, then run:
cd D:\projects
git clone https://github.com/nrodear/StaticCodeAnalyser.git
cd StaticCodeAnalyserYou can pick any path. In this guide we assume D:\projects\StaticCodeAnalyser.
The project ships as a project group that contains 4 sub-projects (engine, shared UI, standalone app, IDE plugin).
- In Delphi, click menu File → Open Project.
- Browse to
D:\projects\StaticCodeAnalyser. - At the bottom of the dialog, change "Files of type" to
"Delphi project group (
*.groupproj)". - Pick
StaticCodeAnalyser.d12.groupprojand click Open.
On the right side you now see the Project Manager window with these sub-projects:
SCA.Engine— the scanning engine.SCA.SharedUI— UI components used by both standalone and plugin.StaticCodeAnalyser.d12— the standalone EXE.StaticCodeAnalyser.IDE.d12— the IDE plugin (a BPL package).
Delphi shows a green bold font for the active sub-project. You will switch the active project as needed below.
The standalone is a plain .exe. You run it from the command line or
double-click it.
64-bit is the default and what we recommend.
In the Project Manager:
- Expand
StaticCodeAnalyser.d12(click the small arrow). - Expand Target Platforms.
- Right-click
Windows 64-bit (Win64)→ click Activate. - Right-click
Configuration→ Release → click Activate.
If you want the 32-bit EXE instead, pick Windows 32-bit (Win32).
Tip: if you change your mind later, just right-click another platform and click Activate again — you can build both versions any time.
- In the Project Manager, right-click
StaticCodeAnalyser.d12(the project name itself, not Target Platforms). - Click Build (or Compile if Build is greyed out).
- Wait ~30 seconds. Watch the Messages window at the bottom.
When it finishes with "Success", your EXE is here:
D:\projects\StaticCodeAnalyser\Output\Win64 Release\StaticCodeAnalyser.d12.exe
(For Win32: Output\Win32 Release\…. For Debug builds: …\Win64 Debug\….)
The compiler sets a 1 MB stack. Deep Pascal files can hit that limit and crash. Open PowerShell in the project folder and run:
tools\patch-stack-size.ps1 "Output\Win64 Release\StaticCodeAnalyser.d12.exe"The script prints Patched ... SizeOfStackReserve: 1 MB -> 32 MB.
You must rerun this after every fresh build.
The plugin is a .bpl (Borland Package Library) that Delphi loads at
startup.
The plugin runs inside the Delphi IDE, which is 32-bit. So the plugin must be 32-bit.
- In the Project Manager, expand
StaticCodeAnalyser.IDE.d12. - Expand Target Platforms.
- Right-click
Windows 32-bit (Win32)→ Activate. - Switch the active config to Release (right-click
Configuration→ Release → Activate). - Right-click
SCA.Engine(in Project Manager) → Build. The plugin needs the engine package; build it first. - Right-click
SCA.SharedUI→ Build. - Right-click
StaticCodeAnalyser.IDE.d12→ Build.
You now have three .bpl files in
C:\Users\Public\Documents\Embarcadero\Studio\23.0\Bpl\:
SCA.Engine.bplSCA.SharedUI.bplStaticCodeAnalyser.IDE.d12.bpl
- Click menu Tools → Options.
- On the left, click IDE → Packages → Design Packages.
- Click Add….
- Browse to
C:\Users\Public\Documents\Embarcadero\Studio\23.0\Bpl\, pickStaticCodeAnalyser.IDE.d12.bpl, click Open. - Make sure the checkbox next to it is on.
- Click OK.
- Close and restart Delphi.
After restart, the IDE shows a new dockable window: View → Static Code Analysis.
If the menu entry is missing, the plugin failed to load. Check View → Window List… or read the splash-screen errors carefully.
The standalone is the easiest way to confirm things work.
For a quick smoke test you can scan the project itself.
Double-click the EXE you built, OR from the command line:
cd D:\projects\StaticCodeAnalyser
"Output\Win64 Release\StaticCodeAnalyser.d12.exe"A window with stats cards (Errors / Warnings / Hints / …) and an empty grid opens.
- In the Path field at the top, type or paste your folder
(e.g.
D:\projects\StaticCodeAnalyser\SCA.Engine\sources). - Click the Analyse button.
- Wait — for small projects: 1-5 seconds. For large ones: up to a minute.
The grid fills with findings. Each row shows: file, method, line, severity, rule, message. Double-click a row to open the file at the correct line (Notepad or your default Pascal viewer).
- The Filter field on top accepts substrings of the file or rule.
- Click any column header to sort.
- Click a stat card (Errors / Warnings / Hints) to keep only that severity.
Use the Export buttons (top-right) to save as HTML, JSON, SARIF (for SonarQube), or copy to clipboard for Jira/Markdown.
If you completed section 5, the plugin is already loaded.
Menu View → Static Code Analysis.
A dockable window appears (drag the title bar to dock it next to the Project Manager or as a tab at the bottom).
- Open any
.pasfile in the editor. - In the Static Code Analysis window, click the File button.
- The current file is scanned. Findings show in the grid.
- Open your project (
.dproj) in Delphi. - In the Static Code Analysis window, click the Analyse button.
- The whole project is scanned. May take seconds to a minute.
Click any row in the grid: the editor jumps to that file and line and highlights the offending code with a colored marker in the gutter.
Right-click any finding → Suppress with // noinspection. The
plugin writes a comment above the line that hides exactly this rule
at this place. The finding disappears on the next scan.
If you hover over a finding row, a tooltip shows a Before / After code example: how the problem looks, and how the fix looks.
| Symptom | Most likely cause |
|---|---|
| "Build failed: unresolved external" | You built the plugin before the engine. Build SCA.Engine first, then SCA.SharedUI, then the plugin. |
| Plugin menu entry is missing after restart | Wrong platform (you built Win64 instead of Win32) or wrong path in Tools → Options → Packages. |
| Standalone crashes after a few seconds on a large project | Stack-size patch not applied. Re-run tools\patch-stack-size.ps1. |
| EXE complains "file not found" on launch | You moved the EXE out of its Output\… folder. Either put it back, or copy the .dcu/.bpl files with it. |
| "Cannot find SCA.Engine.bpl" when the plugin loads | The plugin sees SCA.Engine.bpl via the Delphi-search path. Build SCA.Engine for the same platform (Win32) and configuration (Release). |
- Configure the analyzer: open
analyser.iniin%APPDATA%\StaticCodeAnalyser\. You can setProfile=(which rules run),MinSeverity=,MinConfidence=, etc. The file has comments. - Connect to SonarQube: see sonarHowto.md.
- Run from the command line / CI: see the
--helpoutput of the standalone EXE. Useful flags:--profile,--report-sarif,--quiet,--time-detectors. - Try the German UI: in the analyser window, switch language to Deutsch in the toolbar.
- GitHub issues: https://github.com/nrodear/StaticCodeAnalyser/issues
- Embarcadero docs (for general Delphi questions): https://docwiki.embarcadero.com/RADStudio/en/Main_Page