Skip to content

Edge Filter

The Edge Filter adds up the attributes of all edges that touch a file and writes the result onto the file as a metric. Edge metrics, such as pairingRate from the Code Maat Importer, are then available like any other file metric for the area, height and color of the buildings.

Terminal window
ccsh edgefilter edges.cc.json.gz -o visual_edges.cc.json

The output of the Edge Filter is always uncompressed, so this writes visual_edges.cc.json.

OptionDescription
FILEthe cc.json file with edges
--path-separator=<pathSeparator>path separator (default /)
-o, --output-file=<outputFile>output file, or empty for stdout; always uncompressed
-h, --helpshow the help and exit
Usage: ccsh edgefilter [-h] [-o=<outputFile>]
[--path-separator=<pathSeparator>] FILE

For every file, the filter takes all edges that start or end at it and combines each edge attribute into one metric of the same name:

  • Absolute attributes, such as avgCommits, are summed.
  • Relative attributes, such as pairingRate, are averaged.

An attribute without a type counts as absolute. The results are whole numbers. The edges themselves stay in the output, and a file that an edge names but the map lacks is added as a node.

Two edges touch app/codeCharta.html:

FromTopairingRateavgCommits
app/codeCharta.htmlapp/codeCharta.scss5610
app/testVille.htmlapp/codeCharta.html428

pairingRate is relative and avgCommits absolute, so after the filter the file carries (excerpt of the metrics lens):

"6b185a8cc9433de8": { "pairingRate": 49, "avgCommits": 18 }

app/codeCharta.scss and app/testVille.html each touch only one edge and keep its values.