Ericsson / CodeCompass

CodeCompass is a software comprehension tool for large scale software written in C/C++ and Java
https://codecompass.net
GNU General Public License v3.0
497 stars 96 forks source link

Endpoints for module-level C++ metric types #718

Closed intjftw closed 2 months ago

intjftw commented 3 months ago

As we discussed, endpoints for module-level C++ metric types are also required. I added a new endpoint to query all available module-level metric types and all stored metrics for one module. There are no module-level metrics implemented for now, so testing is difficult. @mcserep please help me out on what else we might need, and how should I modify the endpoint if needed.

mcserep commented 3 months ago

@intjftw In my view (and as discussed on the previous meetings), there are 3 type of metrics, but 2 of them are really similar, so they can be merged.

File and module related metrics are basically the same, as CodeCompass identifies both of them with a file ID. I see no reason for differentiate between them, and this would only introduce code redundancy.
Thus, endpoints for querying ASTnode and File level metrics should be sufficient. (The latter including support for module metrics.)

On the other hand, we discussed the additional need for a higher abstraction level endpoint which does not receive an ASTNodeID or a FileID as an input parameter, but a file / directory path instead. Then, all file and AST node related metrics under that path should be returned. So e.g. if the path is module path, I would like to get: