psycofdj / coverxygen

Generate doxygen's documentation coverage report
GNU General Public License v3.0
49 stars 11 forks source link

false count produced when the header file starts with a long comment #15

Closed uthidata closed 5 years ago

uthidata commented 5 years ago

In our project we have to start every file with a copyright notice that looks like this:

/*
 * Project name
 * Copyright()...
 * ...
*/

Coverxygen falsely produces a 0 count at the beginning of the comment. This happens in every file with such comment.

psycofdj commented 5 years ago

@uthidata thanks for the report

Can you give the doxygen's xml output for a minimal test case showing this bug ? (a file that I can put in coverxygen/coverxygen/test/data/ and work with for coding a fix)

uthidata commented 5 years ago

Sure, here is the source file I use to test and the output xml folder. coverxygen_bugtest.zip Here is how it looks like with the generated html image

psycofdj commented 5 years ago

@uthidata thanks for the data

coverxygen behave as expected. It reports that the symbol testfile.cpp which have type file is undocumented (and it is actually undocumented).

You can generate the json version of the report to see this clearly: python3 -m coverxygen --xml-dir ./coverxygen_bugtest/xml/ --src-dir ./coverxygen_bugtest --format json-v3 --output -

Now two options:

  1. You don't want to see the red warning at line 1 in lcov-compatible output : then I suggest to exclude to symbol type file using the program argument --kind
  2. You want to comment the file itself: then you can add the following section after your licence header:
<my header section>

/**                                                                                                                                                                                                              
 * @file testfile.cpp                                                                                                                                                                                            
 * @brief This file contains some foobar stuff                                                                                                                                                                                                   
 * @details                                                                                                                                                                                                      
 *                                                                                                                                                                                                               
 * blablabla
 */

<rest of my file>
uthidata commented 5 years ago

Thank you for the solutions. It works. Some of my colleagues were having the same problem, would you accept a PR for a FAQ addressing this?

psycofdj commented 5 years ago

Sure, a F.A.Q. section in the root readme.md would be nice. Please also add the new section to top table of content.

Thank you