Objects Used/Set/Modified 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.
Objects Used/Set/Modified
API ID: CountObjectsUsedSetModifiedLanguages: Any
Targets: Functions
The number of uses, sets, or modifications to objects by this function
Example:
int my_global = 10;
void combined(int x)
{
int y, z;
x ++; // + 1 Parameters count
if (x > 10) // + 1 Duplicates count
x = 0; // + 1 Duplicates count
y ++; // + 1 Locals count
if (y > 10) // + 1 Duplicates count
y = 0; // + 1 Duplicates count
my_global ++; // + 1 Globals count
if (my_global > 10) // + 1 Duplicates count
my_global= 0; // + 1 Duplicates count
} // CountObjectsUsedSetModified = 9
Compare to CountObjectsModifiedUnique which counts unique objects this function uses, sets, and/or modifies.