static constructResults(hstsHeaders) {
    const rawHsts = [...hstsHeaders];
    const allowedDirectives = ['max-age', 'includesubdomains', 'preload'];
    const violations = [];
    const warnings = [];
    const syntax = [];

    if (!rawHsts.length) {
      return {
        score: 0,
        results: [{
          severity: str_(i18n.UIStrings.itemSeverityHigh),
          description: str_(UIStrings.noHsts),
          directive: undefined,
        }],
      };
    }

    // No max-age is a violation and renders the HSTS header useless.
    if (!hstsHeaders.toString().includes('max-age')) {
      violations.push({
        severity: str_(i18n.UIStrings.itemSeverityHigh),
        description: str_(UIStrings.noMaxAge),
        directive: 'max-age',
      });
    }

    if (!hstsHeaders.toString().includes('includesubdomains')) {
      // No includeSubdomains might be even wanted. But would be preferred.
      warnings.push({
        severity: str_(i18n.UIStrings.itemSeverityMedium),
        description: str_(UIStrings.noSubdomain),
        directive: 'includeSubDomains',
      });
    }

    if (!hstsHeaders.toString().includes('preload')) {
      // No preload might be even wanted. But would be preferred.
      warnings.push({
        severity: str_(i18n.UIStrings.itemSeverityMedium),
        description: str_(UIStrings.noPreload),
        directive: 'preload',
      });
    }

    for (const actualDirective of hstsHeaders) {
      // We recommend 2y max-age. But if it's lower than 1y, it's a violation.
      if (actualDirective.includes('max-age') &&
          parseInt(actualDirective.split('=')[1], 10) < 31536000) {
        violations.push({
          severity: str_(i18n.UIStrings.itemSeverityHigh),
          description: str_(UIStrings.lowMaxAge),
          directive: 'max-age',
        });
      }

      // If there is a directive that's not an official HSTS directive.
      if (!allowedDirectives.includes(actualDirective) &&
          !actualDirective.includes('max-age')) {
        syntax.push({
          severity: str_(i18n.UIStrings.itemSeverityLow),
          description: str_(UIStrings.invalidSyntax),
          directive: actualDirective,
        });
      }
    }

    const results = [
      ...violations.map(
          f => this.findingToTableItem(
              f.directive, f.description,
              str_(i18n.UIStrings.itemSeverityHigh))),
      ...warnings.map(
          f => this.findingToTableItem(
              f.directive, f.description,
              str_(i18n.UIStrings.itemSeverityMedium))),
      ...syntax.map(
          f => this.findingToTableItem(
              f.directive, f.description,
              str_(i18n.UIStrings.itemSeverityLow))),
    ];
    return {score: violations.length || syntax.length ? 0 : 1, results};
  }
@param {string[]} hstsHeaders
@return {{score: number, results: LH.Audit.Details.TableItem[]}}