-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* working to get a more encompasing/ yet minimally required github token in place - not yet working * added missing metadata and set to null * set gitleaks pass results to null * Added trivy to the dev container dockerfile. Modified gitleaks to have null metadata is check passes * hadolint metadata is set to null if no dockerfiles found * modified hadolint to pick up any file with 'dockerfile' in filename * set metadata to null in cases where it's n/a * starting to clean up accessibility checks as its not easy to query from db * starting to similfy web accessibility code * accessibility scan works as before, but moved out page close out of the page evaluation loop. * minor clean up before mutation refactor. * changed api to be false and not null in github cloned repo check. * returned programming languages to empty array if none, in order to have it displayed in db * Added to do note for all languagues to change color to size or percentage
- Loading branch information
1 parent
8d8e7b3
commit a291617
Showing
7 changed files
with
133 additions
and
54 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// processAxeReport.js | ||
|
||
export function processAxeReport(axeReport, pageToEvaluate) { | ||
const webEndpointAxeResults = {}; | ||
|
||
for (let i = 0; i < axeReport.length; i++) { | ||
const camelize = s => s.replace(/-./g, x => x[1].toUpperCase()) | ||
const criterion = axeReport[i]; | ||
const criterionKey = Object.keys(criterion )[0]; | ||
const criterionValue = criterion [criterionKey]; | ||
const criterionKeyCamelCase = camelize(criterionKey); | ||
if (!webEndpointAxeResults[pageToEvaluate]) { | ||
webEndpointAxeResults[pageToEvaluate] = {} | ||
} | ||
if (typeof criterionValue.checkPasses === 'boolean') { | ||
criterionValue.checkPasses = criterionValue.checkPasses.toString() | ||
} | ||
webEndpointAxeResults[pageToEvaluate][criterionKeyCamelCase] = { | ||
checkPasses: criterionValue.checkPasses, | ||
metadata: criterionValue.metadata, | ||
} | ||
} | ||
|
||
return Object.keys(webEndpointAxeResults).map(page => ({ | ||
url: page, | ||
...webEndpointAxeResults[page], | ||
})); | ||
} | ||
|