Different code types within TICS

TICS has support for showing different code types, which allows you to distinguish between different parts of the code being analyzed by TICS and will also allow you to distinguish between these code types in the viewer. Currently, TICS has support for the following code types:

Configuring code types

There are various ways to configure these code types. For all the code types, it is possible to set an ARCHIVE file that marks parts of your code base as being a special code type based on its paths. To give an easy example, you may want to have the following split on your file paths:

See the ARCHIVE.txt reference guide on how to configure different code types within your ARCHIVE.txt files.

Alternatively, it is also possible to do a check on the content of your files by configuring a CONTENT filter. For instance, you may want all your files that start with

/*
 * <autogenerated>
 */

to be detected as, and analyzed as, generated code. Then you are able to configure this by setting a content filter in the FILEFILTERS option. For more details, see the documentation of the FILEFILTERS option.

Finally, it is also possible to exclude regions of generated code from files that would otherwise be considered production code via the GENERATED mechanism in SERVER.yaml. Note that this is only used to exclude generated regions from analysis; you should not use it to fully detect generated files. For more information see the documentation of the GENERATED option.

Filtering on code types in the viewer

After a TICS analysis has been done with any settings set to distinguish different types of code within the project, the viewer can then distinguish by code type. For instance, code type can now be used in a filter expression. It will also show up as a possibility to group/filter by in the TICS viewer. For instance, the following example shows code grouped by Test and Production code, where a clear difference is visible in the quality:

image

Note that in the case you have changed your ARCHIVE or CONTENT filters, these changes will not be propagated to the viewer until your next TICSQServer run with CHANGEDFILES.