diff --git a/htmlSanityCheck-core/src/main/java/org/aim42/htmlsanitycheck/collect/PerRunResults.java b/htmlSanityCheck-core/src/main/java/org/aim42/htmlsanitycheck/collect/PerRunResults.java
index e210a9a6..b3b66185 100644
--- a/htmlSanityCheck-core/src/main/java/org/aim42/htmlsanitycheck/collect/PerRunResults.java
+++ b/htmlSanityCheck-core/src/main/java/org/aim42/htmlsanitycheck/collect/PerRunResults.java
@@ -5,24 +5,24 @@
import java.util.Objects;
/**
- * Collects checking results of 1..n html files which are checked together in one "run".
+ * Collects checking results of 1..n HTML files which are checked together in one "run".
*
- * Can keep results spanning more than one file (e.g. unused-image-files).
+ * Can keep results spanning more than one file (e.g., unused-image-files).
*/
public class PerRunResults implements RunResults {
- public final static Long ILLEGAL_TIMER = -7353315L;
+ public static final Long ILLEGAL_TIMER = -7353315L;
// magic number - also used in tests
- private final static Long TIMER_STILL_RUNNING = 42L;
+ private static final Long TIMER_STILL_RUNNING = 42L;
// unused images is the only check concerning all pages...
private final List resultsForAllPages;
- // checking time is important - therefore we maintain a timer
+ // checking time is important - therefore, we maintain a timer
private final Long startedCheckingTimeMillis;
private Long finishedCheckingTimeMillis;
/**
- * constructs a container for all checking results, including:
+ * Constructs a container for all checking results, including
* + checking results for every page (contained in @see SinglePageResults instances)
* + results for the rather quirky @see UnusedImagesChecker
* + a simple timer to validate the checks ran fast enough
@@ -36,7 +36,7 @@ public PerRunResults() {
}
/**
- * return the List of results for the pages
+ * Return the List of results for the pages
*/
@Override
public List getResultsForAllPages() {
@@ -44,14 +44,14 @@ public List getResultsForAllPages() {
}
/**
- * stop the checking timer
+ * Stop the checking timer
*/
public void stopTimer() {
finishedCheckingTimeMillis = System.currentTimeMillis();
}
/**
- * query the timer
+ * Query the timer
* if timer has not yet been stopped - return a crazy number
*/
@Override
@@ -67,13 +67,12 @@ public Long checkingTookHowManyMillis() {
/**
- * adds one kind of checking results.
+ * Adds one kind of checking results.
*
* @param pageResults : checking results for a single HTML page
*/
public void addPageResults(SinglePageResults pageResults) {
assert resultsForAllPages != null;
-
resultsForAllPages.add(pageResults);
}
@@ -86,7 +85,7 @@ public int nrOfPagesChecked() {
}
/**
- * returns the total number of checks performed on all pages
+ * Returns the total number of checks performed on all pages
*/
@Override
public int nrOfChecksPerformedOnAllPages() {
@@ -94,12 +93,10 @@ public int nrOfChecksPerformedOnAllPages() {
return resultsForAllPages.stream()
.map(SinglePageResults::nrOfItemsCheckedOnPage)
.reduce(Integer::sum).orElse(0);
-
-
}
/**
- * returns the total number of findings on all pages
+ * Returns the total number of findings on all pages
*/
@Override
public int nrOfFindingsOnAllPages() {
diff --git a/htmlSanityCheck-core/src/main/java/org/aim42/htmlsanitycheck/report/ConsoleReporter.java b/htmlSanityCheck-core/src/main/java/org/aim42/htmlsanitycheck/report/ConsoleReporter.java
index a5cda908..9c15b160 100644
--- a/htmlSanityCheck-core/src/main/java/org/aim42/htmlsanitycheck/report/ConsoleReporter.java
+++ b/htmlSanityCheck-core/src/main/java/org/aim42/htmlsanitycheck/report/ConsoleReporter.java
@@ -64,11 +64,11 @@ protected void reportOverallSummary() {
}
@Override
- protected void reportPageSummary(SinglePageResults pageResult) {
- printer.accept(String.format("Summary for file %s%n", pageResult.getPageFileName()));
- printer.accept(String.format("page path : %s", pageResult.getPageFilePath()));
- printer.accept(String.format("page title : %s", pageResult.getPageTitle()));
- printer.accept(String.format("page size : %d bytes", pageResult.getPageSize()));
+ protected void reportPageSummary(SinglePageResults singlePageResults) {
+ printer.accept(String.format("Summary for file %s%n", singlePageResults.getPageFileName()));
+ printer.accept(String.format("page path : %s", singlePageResults.getPageFilePath()));
+ printer.accept(String.format("page title : %s", singlePageResults.getPageTitle()));
+ printer.accept(String.format("page size : %d bytes", singlePageResults.getPageSize()));
}
@Override
diff --git a/htmlSanityCheck-core/src/main/java/org/aim42/htmlsanitycheck/report/HtmlReporter.java b/htmlSanityCheck-core/src/main/java/org/aim42/htmlsanitycheck/report/HtmlReporter.java
index cca23366..49e4317d 100644
--- a/htmlSanityCheck-core/src/main/java/org/aim42/htmlsanitycheck/report/HtmlReporter.java
+++ b/htmlSanityCheck-core/src/main/java/org/aim42/htmlsanitycheck/report/HtmlReporter.java
@@ -63,9 +63,9 @@ public void initReport() {
}
/*
- We need some static files next to the report html.. css, js and logo stuff.
+ We need some static files next to the report HTML, CSS, js and logo stuff.
- Originally I posted this as a question to the gradle forum:
+ Originally I posted this as a question to the Gradle forum:
http://forums.gradle.org/gradle/topics/-html-checking-plugin-how-to-copy-required-css-to-output-directory
Answers were:
@@ -144,7 +144,7 @@ private String gitPropertiesAsComments() {
/*
- * copy css, javaScript and image/icon files to the html output directory,
+ * copy CSS, JavaScript and image/icon files to the HTML output directory,
*
*/
private void copyRequiredResourceFiles(String outputDirectoryPath, List requiredResources) {
@@ -283,22 +283,22 @@ private static String infoBoxFooter() {
}
@Override
- protected void reportPageSummary(SinglePageResults pageResult) {
- String pageID = CreateLinkUtil.convertToLink(pageResult.getPageFileName());
+ protected void reportPageSummary(SinglePageResults singlePageResults) {
+ String pageID = CreateLinkUtil.convertToLink(singlePageResults.getPageFileName());
write(String.format(
"%n%nResults for %s
%n",
- pageID, pageResult.getPageFileName()
+ pageID, singlePageResults.getPageFileName()
));
write(String.format(
"location : %s %n",
- pageResult.getPageFilePath(), pageResult.getPageFilePath()
+ singlePageResults.getPageFilePath(), singlePageResults.getPageFilePath()
));
- int nrOfItemsChecked = pageResult.nrOfItemsCheckedOnPage();
- int nrOfFindings = pageResult.nrOfFindingsOnPage();
+ int nrOfItemsChecked = singlePageResults.nrOfItemsCheckedOnPage();
+ int nrOfFindings = singlePageResults.nrOfFindingsOnPage();
int percentageSuccessful = SummarizerUtil.percentSuccessful(
nrOfItemsChecked,
@@ -308,7 +308,7 @@ protected void reportPageSummary(SinglePageResults pageResult) {
write(infoBoxHeader());
- int pageSize = pageResult.getPageSize();
+ int pageSize = singlePageResults.getPageSize();
String sizeUnit = (pageSize >= 1_000_000) ? "MByte" : "kByte";
String pageSizeStr = String.valueOf(SummarizerUtil.threeDigitTwoDecimalPlaces(pageSize));
@@ -366,8 +366,8 @@ protected void reportSingleCheckDetails(SingleCheckResults checkResults) {
}
/**
- * Tries to find a writable directory. First tries dirName,
- * if that does not work takes User.dir as second choice.
+ * Tries to find a writable directory.
+ * First try `dirName`, if that does not work, take `User.dir` as second choice.
*
* @param dirName : e.g. /Users/aim42/projects/htmlsc/build/reports/htmlchecks
* @return complete path to a writable file that does not currently exist.
@@ -400,11 +400,8 @@ protected void closeReport() {
write("