Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.


An enforcer for some opinionated rules about coupling in C++

This is an exercise that is helping to refactor a large, old C++ codebase (along with

Because this codebase exhibits high coupling (specifically, a god object, an all-static class, and a few other highly coupled classes all of which contain methods or parts of methods that belong to each-other), I am writing this to output a sort of refactoring roadmap and as a kind of scorecard. I have already reduced one 15kloc source file from 50 violations of these current rules to 1, resulting in an object that can finally exist in a unit test.

The last rule, banning coupling to specific namespaces is intended as a way of holding coupling back once some level of decoupling has been achieved. How well this works in practice is a social, rather than a technological problem. It can't be worse that what's been tried before however.

Currently enforces the following rules:

  • Expressions that generate non-const references to global storage are not allowed.
  • Bare new and delete operators are not allowed.
  • Namespaces may be specified where non-abstract classes are not allowed.
  • Basic detection of expressions generating references to structs and classes in banned namespaces, except from functions or methods defined in those namespaces.


An enforcer for some opinionated rules about coupling in C++






No releases published


No packages published