Skip to main content

Code reviews rule: Missing custom metadata description

Written by David Martin
Updated this week

Missing custom metadata description

Why is this an issue?

Custom metadata types and records without descriptions make your application harder to maintain:

  • Administrators don't understand the purpose of metadata

  • Developers waste time investigating undocumented metadata

  • Knowledge is lost when original creators leave

  • Compliance audits require documentation

Examples

Example of incorrect metadata:

<CustomMetadata>
<label>ACME Config</label>
<values>
<field>Endpoint__c</field>
<value>https://api.example.com</value>
</values>
<!-- No description -->
</CustomMetadata>

Example of correct metadata:

<CustomMetadata>
<label>ACME Config</label>
<description>Configuration settings for the ACME integration.
Contains API endpoints and authentication settings used by
the AcmeIntegrationService class.</description>
<values>
<field>Endpoint__c</field>
<value>https://api.example.com</value>
</values>
</CustomMetadata>

How can I fix violations?

  1. Add descriptions: Document the purpose and usage of each custom metadata type.

  2. Explain field purposes: Describe what each field controls.

  3. Note dependencies: Mention which code or features rely on the metadata.

When should I disable this rule?

You may dismiss specific violations for temporary or development metadata that will be removed.

Resources

Did this answer your question?