in reports/src/main/java/nl/obren/sokrates/reports/landscape/statichtml/LandscapeReportGenerator.java [112:163]
private void addBigSummary(LandscapeAnalysisResults landscapeAnalysisResults) {
landscapeReport.startDiv("margin-top: 32px;");
LandscapeConfiguration configuration = landscapeAnalysisResults.getConfiguration();
int thresholdContributors = configuration.getProjectThresholdContributors();
addInfoBlock(FormattingUtils.getSmallTextForNumber(getProjects().size()), "projects",
thresholdContributors > 1 ? "(" + thresholdContributors + "+ contributors)" : "");
int extensionsCount = getLinesOfCodePerExtension().size();
addInfoBlock(FormattingUtils.getSmallTextForNumber(extensionsCount), extensionsCount == 1 ? "file extension" : "file extensions", "");
addInfoBlock(FormattingUtils.getSmallTextForNumber(landscapeAnalysisResults.getMainLoc()), "lines of code (main)", "");
int commitsCount = landscapeAnalysisResults.getCommitsCount();
if (commitsCount > 0) {
addInfoBlock(FormattingUtils.getSmallTextForNumber(commitsCount), "commits", "");
}
List<ContributorProject> contributors = landscapeAnalysisResults.getContributors();
long contributorsCount = contributors.size();
if (contributorsCount > 0) {
int thresholdCommits = configuration.getContributorThresholdCommits();
addPeopleInfoBlock(FormattingUtils.getSmallTextForNumber((int) contributorsCount), "contributors",
(thresholdCommits > 1 ? "(" + thresholdCommits + "+ commits)" : ""));
addPeopleInfoBlock(FormattingUtils.getSmallTextForNumber(getRecentContributorsCount(contributors)), "recent contributors",
"(past 30 days)");
addPeopleInfoBlock(FormattingUtils.getSmallTextForNumber(getRookiesContributorsCount(contributors)), "active rookies",
"(started in past year)");
}
landscapeReport.addLineBreak();
if (configuration.getCustomMetrics().size() > 0) {
configuration.getCustomMetrics().forEach(customMetric -> addCustomInfoBlock(customMetric));
landscapeReport.addLineBreak();
}
addSmallInfoBlockLoc(FormattingUtils.getSmallTextForNumber(landscapeAnalysisResults.getTestLoc()), "LOC (test)", null);
addSmallInfoBlockLoc(FormattingUtils.getSmallTextForNumber(landscapeAnalysisResults.getGeneratedLoc()
+ landscapeAnalysisResults.getBuildAndDeploymentLoc()
+ landscapeAnalysisResults.getOtherLoc()), "LOC (other)", null);
int recentContributorsCount6Months = getRecentContributorsCount6Months(contributors);
int recentContributorsCount3Months = getRecentContributorsCount3Months(contributors);
if (recentContributorsCount3Months > 0 || recentContributorsCount6Months > 0) {
addSmallInfoBlockPeople(FormattingUtils.getSmallTextForNumber(recentContributorsCount6Months), "contributors (6 months)", null);
addSmallInfoBlockPeople(FormattingUtils.getSmallTextForNumber(recentContributorsCount3Months), "contributors (3 months)", null);
}
if (configuration.getCustomMetricsSmall().size() > 0) {
configuration.getCustomMetricsSmall().forEach(customMetric -> {
addSmallInfoBlock(customMetric.getValue(), customMetric.getTitle(), customMetric.getColor(), customMetric.getLink());
});
}
landscapeReport.endDiv();
landscapeReport.addLineBreak();
addCustomTags(configuration);
}