This CLI tool convert repositories into tree-structured data and calculate their similarity.
Download from here
$ repotr tree make \
--repository-path <path to repository root dir> \
--language <repository's main language> \
--output <tree-structured datafile name>
$ repotr tree compare <path to datafile1> <path to datafile2>