Skip to main content

Unused metadata and bloat

These checks build a reference graph over the project's metadata and flag components nothing references, objects with too many fields, and fields that duplicate each other.

VULKRO_SF_HYGIENE=1 vulkro-sf scan ./force-app

These checks are off by default; VULKRO_SF_HYGIENE=1 turns them on.

Every finding is a candidate, not a delete instruction. Static source cannot see dynamic SOQL, Type.forName, managed-package callers or references that live only in the org. Before removing anything, search for dynamic references, then stage the removal in a sandbox.

Checks​

Rule IDWhat it finds
SF-UNUSED-001 to SF-UNUSED-020A component with no inbound reference, one rule per kind. Findings are reported under these signals: unused-custom-label, unused-custom-field, unused-apex-class (test classes skipped), unused-flow, unused-permission-set, unused-validation-rule (inactive), unused-email-template, unused-static-resource, unused-page-layout, unused-report, unused-custom-metadata-type, unused-custom-object, unused-custom-setting, unused-report-type, unused-quick-action, unused-list-view, unused-record-type, unused-field-set, unused-compact-layout, unused-workflow-rule (inactive).
SF-BLOAT-001 (object-field-bloat)An object whose custom-field count, or share of candidate-unused fields, crosses a threshold.
SF-BLOAT-002 (duplicate-purpose-fields)Two or more custom fields on one object with the same data type and a near-identical name (Phone__c / Phone_2__c / Alternate_Phone__c, Status__c / Status_New__c).

Fixing​

  • Unused: confirm there is no dynamic reference, then remove it. If the reference is real but dynamic, keep it and add it to your baseline.
  • Field bloat: review the unused fields on the object first, merge near-duplicates and archive fields tied to retired processes.
  • Duplicate-purpose fields: pick the canonical field, move data and automation to it, retire the rest. If two fields really differ, rename them so the difference is clear.

Findings carry the component type, API name and inbound-edge count; bloat findings add the field count and unused ratio.

See also: Flow logic and process mining, Metadata governance