Apex test coverage
Salesforce requires 75% Apex coverage across the org to deploy to production. The audit shows coverage per class, so you know which classes need tests before the next deploy. Source: Apex code coverage (Salesforce Developers).
A Salesforce technical debt audit grades your Apex, flows, LWC (Lightning Web Components) and metadata A to F in about 10 minutes. Each finding comes with a drafted fix.
Acme Corp · Code Quality Score
567 Apex classes · 144 flows · 23 LWC · 6 grades
The scan reads your source and checks it against the Salesforce Well-Architected standard.
Clientell AI, the AI agent for Salesforce admins, scans your org read-only, drafts each fix and asks before it changes anything in production.
Each one has a cause, a risk and a fix path.
Salesforce requires 75% Apex coverage across the org to deploy to production. The audit shows coverage per class, so you know which classes need tests before the next deploy. Source: Apex code coverage (Salesforce Developers).
Workflow Rules lost Salesforce support on 31 Dec 2025, but active ones keep running. Each one competes with the Flow that should have replaced it. Source: Workflow Rules & Process Builder End of Support (Salesforce Help).
Custom fields (the __c fields on Account, Opportunity and other objects) made for an old project, never filled in and never reported on. They still take up page layout space and count against the field limit. Each is listed with a dependency check.
Draft flows nobody activated, paused flows nobody cleaned up, copies of copies. A SOQL query on FlowDefinitionView where ActiveVersionId is null finds flows with no active version. Each one clutters dependency analysis and slows every metadata search.
Click a domain to inspect specific issues, severity, and root cause. This is sample data from a demo org.
Every issue grouped by root cause. Sandbox-tested fix per group.
Run it free for 14 daysSix dimensions, mapped to Salesforce Well-Architected. Every issue routes to a fix.
The audit reads ApexClass, ApexTrigger, FlowDefinitionView, LightningComponentBundle, WorkflowRule and field metadata. Each of the six domains gets a grade from A to F. The grades follow the Salesforce Well-Architected standard. Your architect can use them to defend the next refactor budget.
SOQL (Salesforce Object Query Language) queries in loops, DML (data manipulation language, the insert and update statements) in loops, hardcoded record IDs and classes declared without sharing. These four patterns cause silent production failures. Salesforce stops a transaction at 100 SOQL queries or 150 DML statements. The audit scans your Apex source and flags each risky line with a fix. Source: Apex governor limits (Salesforce Developers).
Coverage per class, classes with stale or skipped tests, and the gap to the deploy gate. You can spot-check it in Setup under Custom Code, Apex Classes, Estimate your organization’s code coverage. Salesforce needs 75% Apex coverage across the org to deploy to production. Source: Apex code coverage (Salesforce Developers).
Workflow Rules and Process Builder processes lost Salesforce support on 31 Dec 2025 (EOL means end of life). Each active one still runs and can compete with your Flow logic. Source: Workflow Rules & Process Builder End of Support (Salesforce Help).
Unused custom fields, inactive flows still in metadata, profiles never assigned to a user, and page layouts no record uses. Each asset gets a dependency check and a safe-to-remove status.
Two Apex triggers on one object can fire in any order, which causes race conditions. The audit groups ApexTrigger records by TableEnumOrId and lists every object with more than one trigger. It proposes a one-trigger pattern with handler classes and sample code.
| Grade | Band | What it means | Action |
|---|---|---|---|
| A | Top band | Well-architected. Strong Apex coverage. No governor risks. One trigger per object. No end-of-life automation. | Maintain. Annual audit. |
| B | Upper band | Healthy baseline. The Salesforce coverage gate is met. Minor cleanup left. | Quarterly cleanup sprint. |
| C | Middle band | At risk. Coverage is slipping. Some governor risks. End-of-life automation still active. | Cleanup sprint this quarter. |
| D | Lower band | Significant debt. Deploys are risky. Coverage is below the Salesforce gate. | Pause non-critical work. Cleanup priority 1. |
| F | Bottom band | Production risk. The test suite cannot vouch for a deploy. Race conditions are likely. | Full audit and architect review now. |
Debt stays quiet until a deploy fails or Apex hits a governor limit, such as the cap on SOQL queries in one transaction.
A flaky test suite or low coverage makes every deploy a gamble. Run all tests in Setup under Custom Code, Apex Test Execution to see yours. The audit shows coverage per class and names the classes that need new tests to clear the deploy gate.
Code that runs fine on a few records can trip governor limits on a bulk load. Look for the LIMIT_USAGE_FOR_NS lines in the debug log. Common causes are SOQL in loops, DML in loops and nested triggers. The audit finds every one with a line number. Source: Apex governor limits (Salesforce Developers).
Their knowledge left with them. Check the LastModifiedById field on your ApexClass records: if those users are gone, nobody owns that code. The audit writes the architect brief nobody had time to write.
Salesforce caps custom fields per object by edition. Open Object Manager, then Fields & Relationships, to see your count. When you are close, some of those fields are probably dead. The audit lists every unused field with usage stats and a safe-to-remove status.
Record IDs hardcoded from their sandbox, which break in production. Apex classes named after their internal tools. No comments. The audit maps what you inherited and proposes a cleanup order.
Five deliverables. Architect-grade reports plus admin-actionable cleanup queues.
Six domains, six grades, one weighted overall score, mapped to Salesforce Well-Architected categories. Export it as PDF or XLSX for architect review and budget defense.
Every SOQL-in-loop, DML-in-loop, hardcoded ID and without-sharing class. Each has a line number, a severity and a proposed rewrite. Export to CSV for your ticket queue.
Coverage per class, the classes under the 75% gate, and test class scaffolds for the gaps. It gets you to deploy-ready coverage faster. Source: Apex code coverage (Salesforce Developers).
Every Workflow Rule and Process Builder process past end of support, paired with its Flow successor. Each migration script is tested in a sandbox.
Unused custom fields, inactive flows, orphan profiles and dead layouts. Each is tagged safe to remove, with its dependencies. Clientell AI drafts the removal.
What architects and CIOs ask before a technical debt audit.
It grades the code and metadata in your org from A to F across six domains: Apex Classes, Apex Triggers, Flows, LWC Components, Workflow Rules and Metadata. It flags governor risks, hardcoded IDs, coverage gaps, end-of-life automation and unused metadata. The scan takes about 10 minutes.
Salesforce requires at least 75% Apex coverage across the org to deploy to production, and every trigger needs some coverage. Aim higher than the minimum so one failing class does not block a deploy. See the Salesforce Apex developer guide for the exact rule. Source: Apex code coverage (Salesforce Developers).
Governor risks (SOQL in loops, DML in loops, queries without limits), security bypasses (classes without sharing, hardcoded IDs) and multiple triggers per object. It also finds coverage gaps and dead metadata such as unused fields, inactive flows and orphan profiles.
Often, yes. Salesforce ended support for Workflow Rules and Process Builder on 31 Dec 2025 (Salesforce Help, "Workflow Rules & Process Builder End of Support"). Existing ones still run but get no bug fixes. The audit lists each one with its Flow migration path. Source: Workflow Rules & Process Builder End of Support (Salesforce Help).
Each domain gets a score weighted by issue severity and impact. Test coverage, governor risk count, sharing model compliance and code smell density all count. The score maps to a letter from A to F, as in the grade table above.
Optimizer produces a static report with general recommendations. This audit grades your code, finds governor risks at the source level and builds a coverage roadmap. It also drafts a fix for each finding.
Yes. Each governor risk and code smell comes with a proposed rewrite based on bulk patterns and a trigger handler framework. You review the diff in a sandbox. Clientell AI asks before it changes anything in production.
It is the architecture guidance Salesforce publishes on security, performance, reliability and maintainability (Salesforce Architects, "Well-Architected"). Every finding maps to one of its categories. Your architect, auditor and CIO can all read the same labels. Source: Well-Architected (Salesforce Architects).
It reads your custom code and configuration. It does not grade managed package code, which you cannot change anyway. Installed packages appear in the inventory with license and usage stats but stay out of the quality score.
It depends on org size and how much debt there is. Clientell AI drafts the test classes, EOL migration scripts and dead metadata cleanup for you to review.
Audits, guides and services for teams that want clean deploys.
The long guide to governor risks, test coverage and EOL migration.
Read moreAuditSister audit on the automation side: flows, triggers and workflow rules per object.
Read moreAuditPermission hygiene and security review. Pairs with this audit for a full org review.
Read moreServiceThe broader audit that covers all six dimensions.
Read moreAuditAutomation overlap is the debt that blocks AI agents most.
Read moreProductAfter the cleanup, ship the fixes with a diff preview and rollback.
Read moreProductThe agent that writes the test classes and refactors the audit finds.
Read moreServiceContinuous tech debt monitoring instead of point-in-time audits.
Read moreCompareAlternatives to Copado for deploys and code review.
Read moreTrust + security posture
Most technical debt traces back to automation sprawl. Map the overlap first.
Modern deployment workflow that catches debt before it lands in production.
Permission sprawl is debt in another shape. Audit both dimensions.
Deployment debt blocks AI rollout. Score readiness before buying Agentforce.
Last reviewed October 2026
A-F grades, a governor risk list, a coverage roadmap and an EOL migration queue. Run it free for 14 days, no card.
14-day free trial · No credit card required