Skip to content

Commit 9b679b7

Browse files
CyberSecDefclaude
andcommitted
Calculate count placeholders instead of hard-coding them
- HomeController: count CCIs from the current U_CCI_List_2024.xml (the file the /cci page already uses) instead of the stale U_CCI_List.xml, so the homepage CCI count agrees with the table (3,551 -> 5,100). - baselines + plans: derive the "20 families" / "20 family plans" counts in the OG/meta strings from the data already passed to the templates (families|length, plans|length) so they can't go stale; the plans family list is now generated from plans|keys too. - Homepage control count now displays as a floor-to-hundred "300+" via (controls_count // 100) * 100, so it rounds gracefully and self-updates. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 40a48ce commit 9b679b7

4 files changed

Lines changed: 9 additions & 7 deletions

File tree

cyber.trackr.live/src/Controller/HomeController.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ private function countControlsV5(): int
4545

4646
private function countCciItems(): int
4747
{
48-
$path = realpath(__DIR__ . "/../../resources/data/cci/U_CCI_List.xml");
48+
// Use the current 2024 CCI list — the same file the /cci page parses, so the
49+
// homepage count agrees with the table instead of trailing the older list.
50+
$path = realpath(__DIR__ . "/../../resources/data/cci/U_CCI_List_2024.xml");
4951
if ($path === false) return 0;
5052
$raw = @file_get_contents($path);
5153
return $raw === false ? 0 : substr_count($raw, '<cci_item ');

cyber.trackr.live/templates/home/index.html.twig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<form class="hero-search rise delay-4" onsubmit="return window.app.heroSubmit(event)" role="search">
2323
<i class="bi bi-search hero-search__icon" aria-hidden="true"></i>
2424
<input id="hero-search-input" type="search" class="hero-search__input"
25-
placeholder="Search {{ stig_count|number_format }} STIGs, {{ controls_count|number_format }} controls, {{ cci_count|number_format }} CCIs&hellip;"
25+
placeholder="Search {{ stig_count|number_format }} STIGs, {{ (controls_count // 100) * 100 }}+ controls, {{ cci_count|number_format }} CCIs&hellip;"
2626
aria-label="Search the library" autocomplete="off">
2727
<button type="button"
2828
id="hero-bookmark-trigger"
@@ -63,7 +63,7 @@
6363
API operational
6464
</span>
6565
<span class="hero__trust-item">
66-
{{ stig_count|number_format }} STIGs &middot; {{ controls_count|number_format }} controls &middot; {{ cci_count|number_format }} CCIs
66+
{{ stig_count|number_format }} STIGs &middot; {{ (controls_count // 100) * 100 }}+ controls &middot; {{ cci_count|number_format }} CCIs
6767
</span>
6868
</div>
6969
</section>
@@ -170,7 +170,7 @@
170170
<a href="{{ path('rmf_v5_view') }}" class="tile span-5">
171171
<span class="eyebrow">NIST Controls</span>
172172
<h2 class="tile-title">800-53 <em>r5</em></h2>
173-
<p class="tile-meta">{{ controls_count|number_format }} controls &middot; current revision</p>
173+
<p class="tile-meta">{{ (controls_count // 100) * 100 }}+ controls &middot; current revision</p>
174174
<i class="tile-arrow bi bi-arrow-up-right" aria-hidden="true"></i>
175175
</a>
176176

cyber.trackr.live/templates/plans/index.html.twig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{% extends 'base.html.twig' %}
22

33
{% block title %}Plans &mdash; Cyber Trackr{% endblock %}
4-
{% block og_title %}RMF Plan Generator — 20 family plans, schema-driven{% endblock %}
5-
{% block og_description %}20-family RMF plan generator — CM, AC, AU, IA, IR, CP, SI, CA, SC, RA, SA, PE, PS, MA, MP, AT, PL, SR, PT, PM. Word + JSON output, browser-only.{% endblock %}
4+
{% block og_title %}RMF Plan Generator — {{ plans|length }} family plans, schema-driven{% endblock %}
5+
{% block og_description %}{{ plans|length }}-family RMF plan generator — {{ plans|keys|join(', ')|upper }}. Word + JSON output, browser-only.{% endblock %}
66
{% block og_image_name %}plans{% endblock %}
77

88
{% block body %}

cyber.trackr.live/templates/rmf/baselines.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
{% block title %}Baseline Coverage &mdash; Cyber Trackr{% endblock %}
55
{% block og_title %}Baseline coverage heat map — NIST 800-53 Rev 5{% endblock %}
6-
{% block og_description %}NIST 800-53 r5 baseline coverage heat map: 20 families × Low/Moderate/High/Privacy. Hover any cell for its control list; click to deep-link into the catalog.{% endblock %}
6+
{% block og_description %}NIST 800-53 r5 baseline coverage heat map: {{ families|length }} families × Low/Moderate/High/Privacy. Hover any cell for its control list; click to deep-link into the catalog.{% endblock %}
77
{% block og_image_name %}baselines{% endblock %}
88

99
{% block body %}

0 commit comments

Comments
 (0)