}
// adds module to the statistics tree
private void addModuleToTree(final ModuleStats moduleStats) {
ICoverageObject root = StatsTreeModel.getInstance().getRoot();
final IConfiguration config = CoveragePerformer.getPerformer().getConfig();
final String ppath = ErlangEngine.getInstance().getModelUtilService()
.getProject(config.getProject()).getWorkspaceProject().getLocation()
.toString();
String mpath = config.getModule(moduleStats.getLabel()).getFilePath();
mpath = mpath.substring(ppath.length());
log.info(ppath);
log.info(mpath);
final String[] parts = mpath.split("/");
root.setLiniesCount(root.getLinesCount() + moduleStats.getLinesCount());
root.setCoverCount(root.getCoverCount() + moduleStats.getCoverCount());
for (int i = 1; i < parts.length - 1; i++) {
ICoverageObject tmp = root.findChild(parts[i]);
if (tmp == null) {
tmp = new StatsTreeObject(ObjectType.FOLDER);
tmp.setLabel(parts[i]);
}
tmp.setLiniesCount(tmp.getLinesCount() + moduleStats.getLinesCount());
tmp.setCoverCount(tmp.getCoverCount() + moduleStats.getCoverCount());
root.addChild(parts[i], tmp);
root = tmp;
}
root.addChild(moduleStats.getLabel(), moduleStats);