Maximum level of packages#

Maximum level per packages

Description#

Maximum level per packages.

The rule parameter is an integer with the maximum authorized depth for nested packages. Default value is 2.

Rationale#

This enforces compliance with a specific modeling standard by placing an upper bound on the depth of nested packages.

Verification#

It retrieves the Level of packages metric associated to each package. It fails if a chain of nested packages exceeds the maximum authorized depth.

Resolution#

Modify the offending packages to reduce maximum depth, as detailed in the rule failure message.

Customization#

This rule depends on the Level of packages metric, that must be included in the package. If you customize the ID of this metric, you must provide it when instantiating the rule, using the parameter metric_id.

Cf. Customization for an example.