Namespaces in the Wrong Units

Rule ID:

namespace_in_wrong_unit

Severity:

high

Namespace declarations below src/erbsland must match the API boundary expressed by their source directory. Mismatches make declarations difficult to find and can accidentally expose implementation details as public API, or hide public declarations in implementation directories.

Correct Placement

For example, erbsland::example::impl belongs below src/erbsland/example/impl. Conversely, erbsland::example must not be declared below that impl directory. Additional directories may group related files without introducing another namespace. Conversely, a helper namespace below impl may group constants and functions in one logical unit without a matching subdirectory; see Guidelines for File Structures for the unit definition and directory-layout rules.

Mechanical Detection

Below src/erbsland, the scanner reports namespaces whose domain or impl component does not match the file path.