Skip to content

Computed Data and Data Layers

Computed.js - the derived-data engine

Raw rows read from the spreadsheet are never used directly by reports or checks. Instead, callers request named "compute keys" (for example issues_for_reports_all or top_3_failing_criterias_wcag_21) and Computed.js resolves the dependency graph and calculates only what is needed.

The key data structure is computeStructure_, an 8-level array. Level 1 has no dependencies; each subsequent level may depend on keys from earlier levels. computeData_ walks the levels in order, so dependencies are always satisfied before dependents run.

The file also owns the definitions of the accessibility standards (WCAG 2.0/2.1, Revised Section 508, EN 301 549, EE additions), the issue validation rules, and all per-scenario / per-criteria / per-status aggregations that feed the reports, VPAT/ACR, slides, and quality checks.

Engine

Function Description
computeData_(currentSheetData, templateSheetData, computeKeys) Main entry point. Expands the requested keys into their full dependency set, runs every needed compute function in level order, and returns only the explicitly requested keys.
resolveComputeKeyDependencies_(key) Recursively returns a key plus all of its transitive dependencies; throws on unregistered keys.
mergeArrayValuesNoDuplicate_(origArray, arr) Merges dependency lists without duplicates.
getWCAGSuffixForComputed_(wcagVerNum) Maps a WCAG version to the computed-key suffix (_wcag_21 / _wcag_20). Deprecated.

Standards and criteria

Function Description
getWCAGCriteriaFromJson_ / get508CriteriaFromJson_ / get301CriteriaFromJson_ / getEEAdditionsCriteriaFromJson_ Flatten the bundled standards JSON into dictionaries keyed by criteria ref-id (display name, URL, conformance level).
computeCriteriaWCAG20_ / computeCriteriaWCAG21_ / computeCriteria508_ / computeCriteria301_ / computeCriteriaEEAdditions_ Compute functions for the per-standard criteria dictionaries. WCAG 2.1 is built from the Template spreadsheet's criteria tab rather than the bundled JSON.
computeCriteriaAllPossible_ Merges all standards into one combined dictionary, used for the Results sheet's data-validation dropdowns.
computeWCAG21OnlyCriteriaRefIds_ The criteria new in WCAG 2.1 (present in 2.1 but not 2.0).
get508CriteriaObjByDisplayName_ / get301CriteriaObjByDisplayName_ / getWCAGCriteriaObjByDisplayName_ Look up a criteria object by the display name stored in the Results sheet.
addOrEnrichCriteriaInDict_, getNumFromEn301RefId_ Small dictionary and ref-id helpers.

Scenarios

Function Description
computeScenariosWithStepsNumbered_ Adds numbered step strings to every scenario.
computeScenariosNoAdHoc_ The canonical scenario list: Ad hoc removed, sequential num added.
computeScenariosAllPossible_ All numbered scenarios plus the Ad hoc scenario (synthesized if missing). Used for the scenario dropdown validation.
isScenarioWithUnorderedSteps(scenarioName) True when a scenario's steps have no meaningful order and should not be numbered.
isScenarioHasAnyStepsNameValid(scenarioName) True when a scenario accepts free-text steps (currently Ad hoc).
addStepsNumsForScenarioObject_, getScenarioStepStringWithNumber_ Step formatting helpers.

Issue filtering and validation

Function Description
computeIssuesWithDraftsMarked_ / computeIssuesNoDraft_ Tag and filter out draft (effectively empty) issue rows. An issue is a draft when Unique Title, Details, Issue Title, and Image/Video are all blank (isIssueDraft_).
computeIssuesWithValidations_ Attaches _missing_required_fields and _invalid_fields to each non-draft issue.
issueMissingRequiredValues_(issue) Lists empty required columns (id, browser, testing tool, scenario, steps, title, issue title, EE status, issue owner, external resource; Steps may be blank for Ad hoc issues).
issueInvalidValues_(...) The single largest validator in the codebase (~320 lines). Validates that the ID is numeric and that Browser / Testing Tool / Scenario / Steps / Success Criteria / Issue Title / Status match the configured lists.
computeIssuesForReportsAll_ Non-Ad-hoc issues with a reportable EE Status (blocking/major/minor/advisory; not Fixed/Closed).
computeIssuesForReportsGenerationWCAG21_ / ...WCAG20_ Reportable issues logged under a WCAG criteria of the given version.
computeIssuesForVPATGeneration508_ / ...301_ Reportable failing issues logged under a 508 / EN 301 criteria, for the ACR.
computeIssuesForQualityChecks_ Fully valid non-Ad-hoc issues, the set the quality checks inspect.
computeIssuesWithErrors_ Reportable issues with missing or invalid fields; drives the reports pre-flight error list.
computeIssuesForPreviewResults_ Non-draft, non-hidden issues enriched for the Preview UI: Drive file id, 300px and 1600px thumbnail URLs, and title/notes rendered from markdown to HTML.
computeIssueTitlesAllPossible_ Every issue title across every criteria, for the Issue Title dropdown fallback.
computeActiveRowIssueId_ The issue _id of the user's currently selected Results row (powers "follow my cursor" in Preview).
computeAuditIsWebNotSoftware_ True when the Audit Scope is "Web + mobile browser"; drops 508 Chapter 5 / EN 301 Chapter 11 from the ACR.

Aggregations

Each aggregation follows the same pattern: a generic function plus thin ...WCAG21_ / ...WCAG20_ compute-key wrappers.

Function Description
computeIssuesByScenarioByStatus_ (+ NoAdvisory_ variant) Scenario → status → issues map (optionally excluding Advisory).
computeIssuesByScenarioByStepByStatus_ Scenario → step → status → issues, for step-level tables.
computeFeaturedIssuesByScenario_ Per scenario, the issues flagged "Featured".
computeIssuesByCriteriasByStatus_ / computeIssuesByCriterias_ / computeIssuesByCriteriaByStatusByTitle_ Criteria-keyed groupings.
computeIssuesByIssueTitleByStatus_ / computeIssuesByStatus_ Title-keyed and flat status groupings.
computeImportantIssueByScenario_ The single most important issue per scenario (worst status first) for summary slides.
computeCriteriasSortedByFailingIssuesCount_ / computeIssueTitlesSortedByIssuesCount_ Sorted failure rankings.
computeTop3FailingCriterias_ / computeTop3FailingIssues_ The top-3 lists used in reports.
computeVPATIssuesCriteriaInfo_ (+ 508_, En301_, Combined_ variants) Per-criteria conformance level and remarks for the ACR, including 508 and EN 301 criteria calculated as combinations of WCAG criteria.
computeNaOrSupportInfo_ Resolves each criteria's supported / NA remark template from the "Report: NA or Support - v3" sheet and substitutes variables. Emits a sentinel error value when the selected scenario is wrong or missing, which the reports pre-flight check looks for.

Sheets_data.js - the sheet read layer

Every feature starts by calling sheetsData(ssId, extractionConfig) to pull only the tabs it needs. The file also defines dataDefaultOptions (per-tab extraction defaults) and sheetsConfig (physical layout: header row counts, start columns, frozen columns, and the canonical Results column order). Nothing else in the codebase should read raw ranges from the audit tabs directly.

Function Description
sheetsData(ssId, extractionConfig) Entry point. Opens the spreadsheet (or reuses the active one), dispatches each requested key to its extractor, and returns {key: extractedData}.
getAuditUser_ Returns the current Google account (feeds role info into the HTML app).
getAuditSs_ The spreadsheet object plus id, URL, and name.
getAuditSheets_ All tabs, plus an audit_sheets map indexing the known audit tabs by logical key.
getIssues_ The Results tab as issue objects via getResultsTabEntries_, honoring the mark_hidden_rows option.
getReportNaOrSupportV3_ The "Report: NA or Support - v3" tab as a criteria-keyed object of {is_supported, details}.
getReportNotes_ Legacy report-notes reader (the notes now live on the Configuration tab).
getScenarios_ The Scenarios tab read column-wise (each scenario is a column: name, overview, then steps).
getConfiguration_ The Configuration tab's key/value pairs, applying per-key options (string vs array, EE-formatted dates).
getPlatformBrowserScope_ The "Platform / Browser by scope" tab, notably the third-party company and product lists with URLs.
getReviewReport_ The Review Report tab: the current home of the Platform/Browser, Testing Tools, and Technologies lists used to validate issue rows.
issueSpecialField_(field, suffix) Builds synthetic field names like title__to_html, the convention for computed fields on issue objects.

Google_drive_data.js - the Drive data layer

The Drive-side counterpart of sheetsData. Currently the only key is audit_reports_folder, the folder where generated reports are written.

Function Description
googleDriveData_(data, config) Key-dispatch entry point mirroring sheetsData.
getAuditReportsFolder_(data) Returns {folder, id, url} for the audit's reports folder.
_getCurSSReportsFolder_NEW(data) Finds the spreadsheet's parent Drive folder, then finds or creates the <Product Name> Report subfolder. Throws user-facing messages when the spreadsheet sits in Drive root or Product Name is unset.

Results tab parser (src/resultsSheet/getResultsTabEntries.ts)

A single TypeScript parser that turns the raw Results tab into structured objects used by reports, the preview UI, and the AI review feature.

Function Description
getResultsTabEntries_(resultsSheet, isToMarkHiddenRows) Reads every row and column (display values plus formulas) and returns {data: ResultsTabEntry[], columns_indexes}. Headers are translated through the colNames map into system names such as title and ee_status. Derived fields are added: ...__url from HYPERLINK formulas, steps__order_num plus a stripped step name, a boolean featured from the checkbox column, source_code wrapped in a markdown code fence and converted to HTML, and a numeric _id. When isToMarkHiddenRows is true it calls the advanced Sheets API and sets _filtered_from_view per row.