This coding rule is only available for Java projects.

Note that compiled code must be available.

Source code complies to an architectural model when it fully adheres to a set of architectural constraints. Setting an architectural constraint allows you to set patterns to flag forbidden references between classes.

Here are some examples of patterns:

TheĀ Architectural constraint template, provided by the Sonar rule engine, allows you to define as many architectural constraint rules as desired:


When creating a custom rule based on this architectural rule template, you must specify the access constraints:


Your newly created rule can now be used and activated in any desired quality profile: