---
title: Avoid Non Existent Annotations
description: "**Impact area** Scalability **Severity** Medium **Affected element** Apex Class ## Rule ID SF-COGN-COMPLEX ## Impact Apex supported non-existent annotations for legacy reasons. In the future, such non-existent annotations could result in broken apex code that will not compile.  Remediation Replace…"
url: "https://community-staging.qualityclouds.com/qcdocs/qcr/rules/avoid-non-existent-annotations/"
updated: "2025-03-21"
category: PMD Rules
---

# Avoid Non Existent Annotations

**Impact area**

Scalability

**Severity**

Medium

**Affected element**

Apex Class

## Rule ID

SF-COGN-COMPLEX

## Impact

Apex supported non-existent annotations for legacy reasons. In the future, such non-existent annotations could result in broken apex code that will not compile. 

Remediation

Replace legacy annotations with newer ones.

### Time to fix

20 min

## References

This rule is linked to [AvoidNonExistentAnnotations](https://pmd.github.io/pmd/pmd_rules_apex_errorprone.html#avoidnonexistentannotations)
