New Code Files is one of the source-code metrics Understand computes across 17+ languages — browse them in the GUI, export and track them, or script them with the Python API.
New Code Files
| API ID | CountDeclFileCodeNew |
| Targets | Architectures Project |
| Languages | C++ |
| Categories | Compare Contents |
| Cost | Cached |
Number of new code files, compared to the comparison database.
Counts code files in the current database but not in the comparison database. See Code Files for what counts as a code file. Since changes come from a textual diff, a code file must have Lines to count. For an architecture or the project, each of its files is counted, and a file added to or removed from an architecture counts as new or removed.
For example, an architecture holding these files in each version:
| Comparison database | Current database | Status |
|---|---|---|
classes.cpp | classes.cpp | changed |
functions.cpp | functions.cpp | changed |
legacy.cpp | removed | |
util.h | util.h | same |
version.h | version.h | changed |
config.h | new | |
extra.cpp | new | |
main.cpp | new | |
shapes.cpp | new | |
shapes.h | new |
extra.cpp, main.cpp, and shapes.cpp are new code files, so CountDeclFileCodeNew = 3. config.h and shapes.h are new too, but they're header files.
See Removed Code Files for the reverse of this metric, Changed Code Files for code files in both versions that differ, and Code Files for the total count. See Compare two versions of a project ↗ for how entities are compared, and New Lines, Removed Lines, and Changed Lines for how much a code file changed.