UniqueStaticBlockId
Makes sure that all static blocks have a distinct ID defined.
Two static blocks are considered duplicates when they share the same id and identical arbitrary parameters. Blocks with the same id but different arbitrary parameters (such as variant) are treated as distinct.
Anchor to ExamplesExamples
The following examples contain code snippets that either fail or pass this check.
Anchor to ✗ Fail✗ Fail
In the following example, there are two static blocks using the same ID:
In the following example, the blocks share the same ID and identical arbitrary parameters:
Anchor to ✓ Pass✓ Pass
In the following example, the two static blocks have distinct IDs:
In the following example, the blocks share the same ID but have different arbitrary parameters, making them distinct:
Anchor to OptionsOptions
The following example contains the default configuration for this check:
| Parameter | Description |
|---|---|
enabled | Whether this check is enabled. |
severity | The severity of the check. |
Anchor to Disabling this checkDisabling this check
Disabling this check isn't recommended.