Main Content

Simulink.CloneDetection.generateReport

Generate clone detection report

Since R2023b

Description

[status,reportFilePath] = Simulink.CloneDetection.generateReport(cloneResults) generates an HTML report from the identified clone results cloneResults, and returns the status and the full path reportFilePath of the generated report.

example

[status,reportFilePath] = Simulink.CloneDetection.generateReport(cloneResults,reportType) generates a report in the format specified by reportType.

[status, reportFilePath] = Simulink.CloneDetection.generateReport(cloneResults,reportType,reportFilePath) saves the generated report in the folder specified by reportFilePath.

Examples

collapse all

Generate an HTML report for the clones in the ex_detect_clones model and save the report in the current working folder.

  1. Find clones in the model ex_detect_clones.

    openExample("ex_detect_clones");
    cloneResults = Simulink.CloneDetection.findClones("ex_detect_clones");
    
  2. Generate HTML report in the current working folder.

    [status, reportFilePath] = Simulink.CloneDetection.generateReport(cloneResults)
    
    status =
       1
    
    reportFilePath =
        'C:\Users\Desktop\Demo\Clone Detection Report - ex_detect_clones.html'

Generate a PDF report for the clones in the ex_detect_clones model and save the report in the current working folder.

  1. Find clones in the model ex_detect_clones.

    openExample("ex_detect_clones");
    cloneResults = Simulink.CloneDetection.findClones("ex_detect_clones");
    
  2. Generate the report in the current folder.

    [status, reportFilePath] = Simulink.CloneDetection.generateReport(cloneResults,"pdf")
    
    status =
       1
    
    reportFilePath =
        'C:\Users\Desktop\Demo\Clone Detection Report - ex_detect_clones.pdf'

Input Arguments

collapse all

Identified clone results, specified as a Simulink.CloneDetection.Results object.

File type of the generated report, specified as "html" or "pdf".

Example: "pdf"

Full file path of report to generate, specified as a strings or character vector. Specify the location to save the report. By default, the report is saved in the current working folder.

Example: "C:\MyProject\Reports\CDResults\"

Output Arguments

collapse all

Report generation status, returned as either 1 or 0. 1 indicates that the report generation is successful and 0 indicates that the report generation is failed.

Full file path of the generated report, returned as a character vector.

Version History

Introduced in R2023b