Compliance checkpoints
Whether compositions in the codebase follow the must, must-not and should rules declared on their patterns.
Each checkpoint reports pass, warning, fail or skipped. A finding for a checkpoint links its section on this page.
Must rules
No must-rule violations
compliance.must.no_violations
Whether every composition linked to a pattern satisfies that pattern's must rules: a component appears exactly, at least or at most a given number of times.
| Result | When |
|---|---|
| Pass | No violations, with at least one composition checked. |
| Warning | Not reported by this checkpoint. |
| Fail | Any violation. |
| Skipped | No must rules are defined, or no composition matches a must rule pattern, so nothing was checked. |
How to improve. Fix each composition that breaks a must rule.
Must rules exercised
compliance.must.coverage
The share of patterns with must rules that have at least one composition in the codebase to check against.
| Result | When |
|---|---|
| Pass | Every such pattern has compositions. |
| Warning | At least 50% do. |
| Fail | Fewer than 50% do. |
| Skipped | No must rules are defined. |
How to improve. Add compositions for those patterns, or remove must rules that no longer apply.
Must-rule pass rate
compliance.must.pass_rate
The share of must-rule checks that pass, counting one check per rule per composition.
| Result | When |
|---|---|
| Pass | At least 90% pass. |
| Warning | Between 70% and 90%. |
| Fail | Below 70%. |
| Skipped | No must rules are defined, or there are no compositions to check them against. |
How to improve. Fix the failing compositions.
Must-not rules
No forbidden compositions
compliance.must_not.no_violations
Whether any composition linked to a pattern contains a component that the pattern's must_not rules forbid, optionally only with certain props or next to a given component.
| Result | When |
|---|---|
| Pass | No forbidden components found, with at least one composition checked. |
| Warning | Not reported by this checkpoint. |
| Fail | Any forbidden component found. |
| Skipped | No must_not rules are defined, or no composition matches a must_not rule pattern, so nothing was checked. |
How to improve. Remove the forbidden components from those compositions.
Clean composition rate
compliance.must_not.detection_rate
The share of must_not checks that find nothing forbidden, counting one check per rule per composition.
| Result | When |
|---|---|
| Pass | At least 90% are clean. |
| Warning | Between 70% and 90%. |
| Fail | Below 70%. |
| Skipped | No must_not rules are defined, or there are no compositions to check them against. |
How to improve. Remove forbidden components until every check is clean.
Must-not rules exercised
compliance.must_not.coverage
The share of patterns with must_not rules that have at least one composition in the codebase to check against.
| Result | When |
|---|---|
| Pass | Every such pattern has compositions. |
| Warning | At least 50% do. |
| Fail | Fewer than 50% do. |
| Skipped | No must_not rules are defined. |
How to improve. Add compositions for those patterns, or remove must_not rules that no longer apply.
Should rules
Should-rule compliance rate
compliance.should.compliance_rate
The share of should-rule checks that pass, counting one check per rule per composition. A composition that does not contain the rule's component is not counted. Where the component is present, the check covers preferred props (at least half the instances by default, or the rule's minimumAdoption) and a preferred first or last position.
| Result | When |
|---|---|
| Pass | At least 80% are followed. |
| Warning | Between 60% and 80%. |
| Fail | Below 60%. |
| Skipped | No should rules are defined, or no composition contains a component a rule recommends. |
How to improve. Bring compositions in line with the recommendations.
Recommendations followed
compliance.should.adoption_rate
How many should-rule recommendations are not followed. The score drops 10 points per miss.
| Result | When |
|---|---|
| Pass | No more than 2 misses (a score of 80 or more). |
| Warning | 3 to 5 misses. |
| Fail | 6 or more misses. |
| Skipped | No should rules are defined. |
How to improve. Adopt the recommended props and positions where they apply.
Should rules exercised
compliance.should.coverage
The share of patterns with should rules that have at least one composition in the codebase to check against.
| Result | When |
|---|---|
| Pass | Every such pattern has compositions. |
| Warning | At least 50% do. |
| Fail | Fewer than 50% do. |
| Skipped | No should rules are defined. |
How to improve. Add compositions for those patterns, or remove should rules that no longer apply.