Skip to main content

Module analytics

Module analytics 

Source
Expand description

Analytics module for the ICB server.

Provides functions that compute various metrics over a CodePropertyGraph, such as function and class statistics, complexity estimations, lines‑of‑code, and per‑file summaries. These metrics are consumed by the /api/functions, /api/classes, and /api/files endpoints.

§Metrics

  • complexity – number of AST nodes reachable via AstChild edges.
  • loc – lines of code (end_line - start_line + 1) for the function/class, useful when AST children are unavailable (Clang).

Structs§

ClassMetric
A single class metric.
FileMetric
Per‑file summary.
FunctionMetric
A single function (or method) metric.

Functions§

collect_class_metrics
Collects metrics for every class node.
collect_file_metrics
Creates per‑file aggregate metrics.
collect_function_metrics
Computes metrics for every function and class node in the graph.