Customize Data Coupling Report

The Data Coupling report is based on a template called ccreport.template that you can find in the following folder:

Raw data

This template is made of 2 parts:
  • The HTML part that is the common part of all reports,
  • A JavaScript part that sets the tables and call graph depending of 2 variables initialized dynamically when the report is creating:
    var data = {{json}};	    // the raw data
    var d = new Date({{date}})   // the date of the generation
Raw data is composed of 4 sections at the top level:
  • A summary of the Data Coupling metrics:
    • nbGlobalVariables is the number of global variables found in the application.
    • nbDefUses is the number of Def/Use pairs found in the application.
    • nbDefUsesCovered Def/Use pairs found in the application that have been covered by at least one test.
    • nbVariablesWithoutDefUse is the number of global variables that have no Def/Use pairs in the application.
    • variablesWithoutDefUse is the list of global variables that have no Def/Use pairs in the application.
    Control Coupling metrics
  • The list of the modules, each of them has the following information:
    • Name is the short name of the C file,
    • Fullname is the name and path of the C file,
    • uuid is a unique identifier of the module,
    • unknown is set to true is the module is not part of the information you provided (there is only one unknown module that gathers all the call to functions that are not in the known modules),
    • functions is the list of the unique identifiers of functions of the module.
    Modules are listed as hashmap with the uuid, as follows:
  • The list of functions including following information:
    • name is the name of the C function,
    • line is the first line of the function in the module,
    • id is the number used in .tsf file to identify this function,
    • stacksize is the stack size computed during the execution if this option has been set (otherwise -1),
    • uuid is a unique identifier of the function,
    • module is a unique identifier of the module in which the function is declared,
    • calls is the list of the calls in this function. Each of them have the following information:
      • calling_uuid is the unique identifier of the calling function,
      • called_uuid is the unique identifier of the called function,
      • line is the line number of the call in the module,
      • col is the column number of the call in the module,
      • same_module is set to true id the called function is in the same module that the calling function.
    • level is a number that represent the level of the function in the call graph, starting to 0.
    • calledby is the list of unique identifiers of functions that call this one.
  • Functions are listed as hashmap with the uuid, as following: Functions are listed as hashmap with the uuid
  • In the list of variables, each variable contains the following information:
    • name is name of the global variable.
    • line is line number of the declaration of the global variable in the compilation unit.
    • moduleid is the unique identifier of the compilation unit where this variable is declared.
    • defs is an array of defs of this global variable. Each def has the following information:
      • variablename is the name of the global variable.
      • linelocal is the line number of the declaration of the local variable in the compilation unit (-1 if this variable is not a local variable).
      • line is the line number of the def in the compilation unit.
      • col is the column number of the def in the compilation unit.
      • function is the name of the function where there is this def.
      • moduleid is the unique identifier of the compilation unit where there is this def.
      • isdef is true if it is a def, otherwise false.
      • where is "bloc", "cond" or "case_" depending of where this def is.
      • variabletype is "global", "local" or "param" depending of the type of variable.
      • covered is true if it is covered by at least one test, otherwise false.
    • uses is an array of uses of this global variable. Each use has the same information than a def.
    • nbDefUses is the number of def/use pair for this variable.
    • testcases is an array of array of test case descriptions. It is a two-dimension array as the first diemnsion is for the defs and the second for the uses. Each test case contains the following information:
      • name is the name of the test case.
      • requirements is an array of requirement id that this test case covered.
    Control couplings are listed as an array, as follows: control flow