Customize Control Coupling Report

The Control Coupling report is based on a template called ccreport.template that you can find in the folder <install>/lib/reports.
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

Raw data is composed of 4 sections at the top level:
  • A summary of the Control Coupling metrics:
    • nbcc is the number of Control Coupling found in the application,
    • nbcovered is the number of Control Coupling found in the application that have been covered by at least one test,
    • nbccShortest and nbcoveredShortest are the same for the shortest Control Coupling,
    • nbccLongest and nbcoveredLongest are the same for the longest Control Coupling,
    • filtered is set to true if the report has been generated with a filter (shortest or longest),
    • filtered_longest is set to true if the report has been generated with a filter longest (set only if filter is true).

    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 the functions, each of them have the 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
  • The list of the Control Couplings, each of them have the following information:
    • calls is the list of successive calls that composed this control coupling, 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.
      • isShortest is set to true if the control coupling is a shortest one.
      • isLongest is set to true if the control coupling is a longest one.
      • 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 if the called function is in the same module that the calling function.
    • testcases is the list of test cases that covered the control coupling, each of them have the following information:
      • name is the name of the test case.
      • requirements is the list of requirements that is covered by this test case.

    Control couplings are listed as an array, as follows:

    Control coupling list

Feedback