For certain project I want to make statistics like list of public methods and functions. Great option might be using CppDepend and it's build-in query language.

Our (legacy) project base has applications. Each application is in it's own directory, has project file and some subdirectories with sources. Certain subdirectories are shared in multiple applications (using svn:externals). My goal is count methods and functions in such shared directories only once.

For example if file my_file.h contains three functions and is checked out to three different local directories I still want to add only 3 to my statistic and not 9.

Is there a way to tell cpp what directories/files are checked out to multiple local directories to count them only once?


To avoid counting the same methods you can add the distinct filter to the cqlinq query like this:

from m in JustMyCode.Methods.Distinct(m=>m.FullName)
select m

So each method will be counted once, or you can improve the query to avoid filtering methods with the same signature but are not the same by adding a filter of the source file name

from m in JustMyCode.Methods.Distinct(m=>new {m.FullName,m.SourceDecl.SourceFile.FileName})
select m