Justification Files
You can provide justifications in companion files, in a simple text format. No access and change to source code is necessary with this workflow.
Justification files are included in HTML reports with option
-include-justifications
followed by the file name.
A justification file is structured on two levels. A new source file is refered with a line starting with an "@". After that, each line starts with the line number of the counter to be justified.
The key
CTC++ Justify
must be omitted, everything else follows the
structure of justifications in source code. Empty lines and every line not starting with
an "@" or a number are
ignored.@C:\users\chandlerbing\dev-projects\alpha\src\transponster.c
122 True | DEFENSIVE: Must be present because of development guideline, never reached.
198 False | Endless Loop: Part of system design.
621 | DEFENSIVE: Default cannot be reached, enumeration used.
@C:\users\chandlerbing\dev-projects\alpha\src\wenus.c
13 Function | SmallFunction: No test needed due to low complexity.
HTML reports generated with justifications provide a helper function to collect new justifications in correct format via clipboard to companion files.
Note: Mappings provided with
-map-source-identification
are also applied to
file identfications. Hence you can reference source files in a justification file
depending to your workflow:- If you do not want and need to use
-map-source-identification
, take the full paths to source files as reference. - If you are already using
-map-source-identification
with a common, equally named root likealpha
in build paths and paths during report generation, you can record the files with the full path or with a "non real" path fragment likealpha\src\write_helpers.c
. The latter version helps share justification files with other users. - If you do not have an equally named root in decentralized repositories and you
want to share justification files, others (or you) have to add one or more
mapping with
-map-source-identification
.