{% extends "base.html" %} {% block title %}{{ _("Repository") }}{% endblock %} {% block content %} {% macro capped(items) -%} {% if items|length > listed %}
{% trans count=items|length - listed %}{{ count }} more{% endtrans %}
{% endif %} {%- endmacro %} {% macro change(tile, points=false) -%} {% if tile.change is none %}{{ _("No earlier update to compare with.") }}{% elif points %}{% trans change="%+d"|format(tile.change) %}{{ change }} points since the last update{% endtrans %}{% else %}{% trans change="%+d"|format(tile.change) %}{{ change }} since the last update{% endtrans %}{% endif %} {%- endmacro %} {% macro trend(tile) %} {% if tile.points %} {% set count = tile.trend_text.split(", ")|length %} {% endif %} {% endmacro %}

{{ _("Repository") }}

{{ _("What the repository is: its history, its releases, its code and its facts. Read from the code and its history, without calling your assistant.") }}

{% if report is not none and report.activity and report.activity.days_start %} {% endif %}
{% if report is none %}
{% if unavailable %}

{{ _("The statistics aren't available just now") }}

{{ _("Codetrail couldn't read the target's data; the log says why.") }}

{% else %}

{{ _("No facts yet") }}

{{ _("Update the guide once: reading the code is free, and the statistics come from it.") }}

{% endif %}
{% else %} {% set activity, releases, size = report.activity, report.releases, report.size %}
{{ _("Age") }} {% if age is none %} —{{ _("The history couldn't be read just now.") }} {% else %} {% set years, months = age %} {% if not years and not months %}{% trans count=[(today - activity.first).days, 0]|max %}{{ count }} day{% pluralize %}{{ count }} days{% endtrans %}{% else %}{% if years %}{% trans count=years %}{{ count }} year{% pluralize %}{{ count }} years{% endtrans %}{% endif %}{% if years and months %}, {% endif %}{% if months %}{% trans count=months %}{{ count }} month{% pluralize %}{{ count }} months{% endtrans %}{% endif %}{% endif %} {% trans date=activity.first.isoformat() %}First commit on {{ date }}{% endtrans %} {% endif %}
{% set tile = tiles["commits"] %}
{{ _("Commits") }} {% if tile.value is none %} —{{ _("The history couldn't be read just now.") }} {% else %} {{ tile.value.numerator|number }} {% trans count=activity.merges %}{{ count }} merge{% pluralize %}{{ count }} merges{% endtrans %} {{ change(tile) }} {{ trend(tile) }} {% endif %}
{{ _("Releases") }} {% if releases is none %} —{{ _("Not available just now.") }} {% elif not releases.tags %} 0{{ _("No tags on the branch.") }} {% else %} {% set latest = releases.tags[0] %} {{ releases.tags|length|number }} {% trans name=latest.name, date=latest.date|day %}Latest: {{ name }}, on {{ date }}{% endtrans %} {% endif %}
{% set tile = tiles["code_lines"] %}
{{ _("Code") }} {% trans count=tile.value.numerator, lines=tile.value.numerator|number %}{{ lines }} line{% pluralize %}{{ lines }} lines{% endtrans %} {% trans count=size.languages|length %}in {{ count }} language{% pluralize %}in {{ count }} languages{% endtrans %} {{ change(tile) }} {{ trend(tile) }}
{% set tile = tiles["test_share"] %}
{{ _("Tests") }} {% if tile.percent is not none %}{{ tile.percent }}%{% else %}—{% endif %} {% trans numerator=tile.value.numerator|number, denominator=tile.value.denominator|number %}{{ numerator }} of {{ denominator }} lines{% endtrans %} {% if tile.value.denominator %}{{ change(tile, points=true) }}{% endif %} {{ trend(tile) }}

{{ _("Timeline") }}

{% if activity is none or activity.first is none %}

{{ _("The history couldn't be read just now; the log says why.") }}

{% else %}

{{ _("The branch's whole history, by author date in UTC. Only dates and counts are read: no author or message.") }}

{{ _("The charts need the page's script; their numbers are in the tables below.") }}

{{ _("First commit") }}{{ activity.first.isoformat() }}
{{ _("Latest commit") }}{{ activity.latest.isoformat() }} · {% trans count=[(today - activity.latest).days, 0]|max %}{{ count }} day ago{% pluralize %}{{ count }} days ago{% endtrans %}
{{ _("Weeks with a commit") }}{% trans active=activity.active_weeks|number, weeks=activity.weeks|number %}{{ active }} of {{ weeks }}{% endtrans %}
{{ _("Longest quiet stretch") }}{% if activity.longest_gap %}{% set start, end = activity.longest_gap %}{% trans count=(end - start).days, start=start.isoformat(), end=end.isoformat() %}{{ count }} day, from {{ start }} to {{ end }}{% pluralize %}{{ count }} days, from {{ start }} to {{ end }}{% endtrans %}{% else %}—{% endif %}
{% if activity.cut %}

{% trans count=history_limit|number %}The timeline shows the latest {{ count }} commits; the counts cover them all.{% endtrans %}

{% endif %}
{{ _("Commits per month and per year, as numbers") }} {% for month, count in all_months %}{% endfor %}
{{ _("Month") }}{{ _("Commits") }}
{{ month }}{{ count|number }}
{% for year, count in activity.years %}{% endfor %}
{{ _("Year") }}{{ _("Commits") }}
{{ year }}{{ count|number }}
{% endif %}
{% if activity and activity.days_start %}

{{ _("Activity, day by day") }}

{{ _("The last 53 weeks, a square per day, shaded by its commits.") }}

{{ _("The charts need the page's script; their numbers are in the tables below.") }}

{{ _("Weeks with a commit") }}
{% trans active=activity.active_weeks|number, weeks=activity.weeks|number %}{{ active }} of {{ weeks }}{% endtrans %}
{{ _("Longest quiet stretch") }}
{% if activity.longest_gap %}{% set start, end = activity.longest_gap %}{% trans count=(end - start).days %}{{ count }} day{% pluralize %}{{ count }} days{% endtrans %}{% else %}—{% endif %}
{% if weekday_name %}
{{ _("Busiest weekday") }}
{{ weekday_name }}
{% endif %}
{{ _("Latest commit") }}
{{ activity.latest.isoformat() }}

{% endif %}

{{ _("Commit types") }}

{% set types = report.types %} {% if types is none %}

{{ _("The commit messages couldn't be read just now; the log says why.") }}

{% else %}

{% trans matched=types.matched, measured=types.measured %}{{ matched }} of the latest {{ measured }} commit subjects match the target's commit_type_pattern, such as feat(web): add a page.{% endtrans %}

{% if not types.used %}

{{ _("The repository doesn't appear to use typed commit subjects.") }}

{% else %} {% set widest = types.types[0][1] if types.types else 0 %} {% if types.scopes %}

{{ _("Scopes") }}

{% endif %} {% endif %} {% endif %}

{{ _("Releases") }}

{% if releases is none %}

{{ _("The releases couldn't be read just now; the log says why.") }}

{% elif not releases.tags %}

{{ _("No releases: the branch has no tags.") }}

{% else %}

{{ _("The tags that point into the branch's history. A tag gitleaks flags is withheld.") }}

{% call(tag) capped(releases.tags) %}{{ tag.commit[:7] }}{{ tag.name }}{% if tag.message %}
{{ tag.message.split("\n", 1)[0] }}
{{ tag.message }}
{% endif %}
{{ tag.date|day }}{% endcall %} {% endif %}

{{ _("Where change happens") }}

{% set churn = report.churn %} {% if churn is none %}

{{ _("The history couldn't be read just now; the log says why.") }}

{% else %}

{% trans count=churn.commits %}Over the latest {{ count }} commit, merges left out. Only files Codetrail may read are named.{% pluralize %}Over the latest {{ count }} commits, merges left out. Only files Codetrail may read are named.{% endtrans %}

{{ _("Each tile's size is its lines of code; its shade, the commits that changed it.") }}

{{ _("The charts need the page's script; their numbers are in the tables below.") }}

{% for level, count in churn.left_out.items() %}{% if count %}{% endif %}{% endfor %}
{{ _("Fewer commits") }}{% for step in range(5) %}{% endfor %}{{ _("more") }}{{ _("Mostly inferred rationale: where an ADR or a README would help most") }}
{% if churn.area_months %}

{{ _("Change over time, by area") }}

{{ _("Commits per month in each guide area over the last year.") }}

{% for month in churn.months %}{% endfor %} {% for page_id, cells in churn.area_months %} {% for count in cells %}{% if count is none %}{% else %}{% endif %}{% endfor %} {% endfor %}
{{ _("Area") }}{{ month_names[month[5:]|int - 1] }}{% if loop.first or month[5:] == "01" %} {{ month[:4] }}{% endif %}
{{ area_titles.get(page_id, page_id) }}–{{ count if count else "" }}

{% endif %}
{{ _("Where change happens, as tables") }}

{{ _("Guide areas") }}

{% if churn.areas %}

{{ _("An area with much change and mostly inferred rationale is where an ADR or a README would help most.") }}

{% for spot in churn.areas[:listed] %} {% endfor %}
{{ _("Area") }}{{ _("Commits") }}{{ _("Documented") }}{{ _("Inferred") }}
{{ spot.page.title }}{{ spot.commits|number }}{{ spot.documented }}{{ spot.inferred }}
{% else %}

{{ _("Areas are counted once your assistant has written the guide's area pages.") }}

{% endif %} {% if churn.files %}

{{ _("Most changed files") }}

    {% for spot in churn.files[:largest_files] %}
  • {{ spot.name }}{{ spot.count|number }}
  • {% endfor %}

{{ _("Most changed folders") }}

    {% for spot in churn.folders[:listed] %}
  • {{ spot.name }} · {{ spot.count|number }}
  • {% endfor %}
{% endif %}

{{ _("Commit size") }}

{% if churn.median_files is none %}

{{ _("No commits to measure yet.") }}

{% else %}

{% trans median="%g"|format(churn.median_files), p90="%g"|format(churn.p90_files) %}Files a commit changes: {{ median }} at the median, {{ p90 }} at the 90th percentile.{% endtrans %}

{% for height in bar_heights(churn.size_histogram) %}
{{ churn.size_histogram[loop.index0]|number }}{{ ["1", "2", "3", "4–5", "6–10", "11–20", "21+"][loop.index0] }}
{% endfor %}
{{ _("Commits by the files they change") }}
{% endif %}

{{ _("Quiet code") }}

{% if churn.quiet %}

{% trans count=churn.quiet_files, days=quiet_days %}{{ count }} file of code no commit has changed in the last {{ days }} days, by folder.{% pluralize %}{{ count }} files of code no commit has changed in the last {{ days }} days, by folder.{% endtrans %}

    {% for spot in churn.quiet[:listed] %}
  • {{ spot.name }} · {{ spot.count|number }}
  • {% endfor %}
{% else %}

{% trans days=quiet_days %}Every file of code changed in the last {{ days }} days.{% endtrans %}

{% endif %}
{% endif %}

{{ _("Code size") }}

{{ _("The files Codetrail may read, without the excluded ones. A file's language comes from its name; documents are the files matching the target's document_globs, and tests those matching its test_globs.") }}

{% if size.languages %} {% set segments = language_segments(size.languages) %} {% if size.code_lines %} {% endif %}
{{ _("Languages, as a table") }} {% for row in size.languages[:listed] %} {% endfor %}
{{ _("Language") }}{{ _("Files") }}{{ _("Lines") }}
{{ row.language }}{{ row.files|number }}{{ row.lines|number }}
{% endif %} {% if size.largest %}

{{ _("Largest files") }}

{% endif %}

{{ _("Facts") }}

{% set inventory = report.inventory %} {% if inventory.since %}

{% trans date=inventory.since.taken_at[:10] %}What Codetrail's extractors found, by kind. Codetrail's history of this repository starts on {{ date }}: packages present then are counted as there from the start.{% endtrans %}

{% endif %} {% if inventory.kinds %} {% endif %} {% if inventory.arrived %}

{{ _("Dependencies that arrived") }}

{% call(item) capped(inventory.arrived) %}{{ item.package }}{{ item.snapshot.taken_at[:10] }} · {{ item.snapshot.commit[:7] }}{% endcall %} {% endif %} {% if inventory.left %}

{{ _("Dependencies that left") }}

{% call(item) capped(inventory.left) %}{{ item.package }}{{ item.snapshot.taken_at[:10] }} · {{ item.snapshot.commit[:7] }}{% endcall %} {% endif %}
{% endif %}
{% endblock %}