scitools.com

← Architecture catalog

File Namespace is one of Understand's built-in architectures — automatic ways to group a codebase (by directory, git history, language, …) for graphs, metrics, and dependency analysis.

File Namespace

Languages: C++
Group each file by the namespace containing the most definitions.

The goal is to assign the file to the most useful namespace which is assumed to be the one that contains the most definitions since most lines of code would always use the outermost namespace and the most deeply nested might not contain very much (like an anonymous namespace).

For example, this file would be mapped to the "Outer/Inner2" architecture because Inner2 defines the most entities.

  namespace Outer {
    void f0() {}
    namespace Inner1 {
      void f1() {}
      namespace Deepest {
        void f2() {}
      }
    }
    namespace Inner2 {
      void f3() {}
      void f4() {}
      void f5() {}
    }
  }