scitools.com

← Metric catalog

Unique Objects Set 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.

Unique Objects Set

API ID: CountObjectsSetUnique
Languages: Any
Targets: Functions

The number of unique objects set by this function

Example:

    int my_global = 10;
    void sets(int x)
    {
      int y, z;
      x = 1;           // + 1 Parameters count
      x = 2;           //     Duplicates do not count
      y = 1;           // + 1 Locals count
      y = 2;           //     Duplicates do not count
      my_global = 1;   // + 1 Globals count
      my_global = 2;   //     Duplicates do not count
    }                  // CountObjectsSetUnique = 3
    

Compare to CountObjectsSet which counts all sets to objects by this function.