-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #710 from SSWConsulting/bad-urls
Show correct broken link counts
- Loading branch information
Showing
7 changed files
with
18 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,7 @@ exports.sendAlertEmail = async (email, emailConfig, scanSummary) => { | |
from: '[email protected]', // sender address | ||
to: email, // list of receivers | ||
subject: `SSW CodeAuditor Scan Result - ${scanSummary.url}`, // Subject line | ||
html: `<h2 style="color: red">Hi there,</h2><p>This is the result from SSW CodeAuditor scan on ${scanSummary.url} on ${fns.format(new Date(scanSummary.buildDate), 'dd MMM yyyy, hh:mm aaaa')}</p><p>⏳ Duration: ${scanSummary.scanDuration} seconds</p><p>🚨 Broken Links: ${scanSummary.totalUnique404} / ${scanSummary.totalScanned} Bad links</p><p>⚠️ HTML Warnings: ${scanSummary.htmlWarnings}</p><p>❌ HTML Errors: ${scanSummary.htmlErrors}</p><p>See https://codeauditor.com/build/${scanSummary.runId} for full scan result</p><p><This is the automated alert email from SSW CodeAuditor></p>`, | ||
html: `<h2 style="color: red">Hi there,</h2><p>This is the result from SSW CodeAuditor scan on ${scanSummary.url} on ${fns.format(new Date(scanSummary.buildDate), 'dd MMM yyyy, hh:mm aaaa')}</p><p>⏳ Duration: ${scanSummary.scanDuration} seconds</p><p>🚨 Broken Links: ${scanSummary.uniqueBrokenLinks} / ${scanSummary.totalScanned} Bad links</p><p>⚠️ HTML Warnings: ${scanSummary.htmlWarnings}</p><p>❌ HTML Errors: ${scanSummary.htmlErrors}</p><p>See https://codeauditor.com/build/${scanSummary.runId} for full scan result</p><p><This is the automated alert email from SSW CodeAuditor></p>`, | ||
}); | ||
} | ||
|
||
|
@@ -418,7 +418,7 @@ exports.processBrokenLinks = ( | |
const __getBadResults = (allUrls) => | ||
allUrls | ||
// Allow successful 2xx status code range (200-299) | ||
.filter((url) => !(url["StatusCode"]?.startsWith('2') && url["StatusCode"]?.length === 3)) | ||
.filter((url) => !((url["StatusCode"]?.startsWith('2') || url["StatusCode"]?.startsWith('3')) && url["StatusCode"]?.length === 3)) | ||
.map((x) => ({ | ||
src: x.Source || "", | ||
dst: x.Destination || "", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters