scitools.com

← Metric catalog

Objects Used 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

API ID: CountObjectsUsed
Languages: Any
Targets: Functions

The number of times this function uses objects

Example:

    int my_global = 10;
    void uses(int x)
    {
      int y, z;
      if (x == 1);           // + 1 Parameters count
      if (x == 2);           // + 1 Duplicates count
      if (y == 1);           // + 1 Locals count
      if (y == 2);           // + 1 Duplicates count
      if (my_global == 1);   // + 1 Globals count
      if (my_global == 2);   // + 1 Duplicates count
    }                        // CountObjectsUsed = 6
    

Compare to CountObjectsUsedUnique which counts unique objects this function uses.