We present scg-cli, a~command line tool facilitating software comprehension. The tool extracts semantic information about code structure and dependencies from the Java and Scala projects, and structures it as a~Semantic Code Graph (SCG), an information model underlying scg-cli. The SCG data, once written into a~portable, open protobuf-based format, can be used by the scg-cli command line tool to obtain project metrics, find the most critical code entities, and compute project partitionings. The results of this analysis and the SCG data can be exported for further investigation by external tools such as Gephi software (visualization) and, notably, as a Jupyter Notebook environment with helper APIs to enable advanced analysis of the project using data analytics methods. We explain functionalities of the scg-cli tool and demonstrate its capabilities by showing an example analysis of an open-source Java project commons-io.
翻译:我们提出scg-cli,一个促进软件理解的命令行工具。该工具从Java和Scala项目中提取关于代码结构与依赖关系的语义信息,并将其组织为语义代码图(SCG)——scg-cli底层的信息模型。SCG数据被写入基于protobuf的可移植开放格式后,可由scg-cli命令行工具用于获取项目指标、定位最关键的代码实体以及计算项目划分。分析结果及SCG数据可导出供外部工具进一步研究,例如Gephi软件(可视化),尤其可作为带有辅助API的Jupyter Notebook环境,以便运用数据分析方法对项目进行高级分析。我们通过展示对开源Java项目commons-io的示例分析,阐释scg-cli工具的功能并演示其能力。