CodeDescriptor

A model to represent basic metrics of the code that will be used to show in the GUI and to validate the license restrictions.

The Code Processor must create a CodeDescriptor and pass it up to the Controller before the license validation process.

The members of the code descriptor are:

  • HasSomethingToProcess: a boolean indicating whether or not the code processor found content in the specified input that it can process.

  • Units: the total amount of units counted. Typically, units will be effective lines of code, but each code processor could use different units if required. (lines, bytes, chars, statements, etc.) This data is used to show in the GUI and to validate licenses that require it.

  • UnitsType: the name of the units to be shown in the GUI and reports (typically "Lines of Code")

  • Bytes: the total amount of bytes from all the considered files.

  • Projects: a list of Projects each of them with its name, metrics and its list of files. All files should be reported here. This information is also used to validate licenses that require fingerprints.

Note: if Units or Projects are not provided, the Product will still work, but it wouldn't be able to validate licenses that require the corresponding data (units for LOC or other unit restrictions, and projects for fingerprint restrictions)

Last updated