Skip to content

v3.1.0

Latest

Choose a tag to compare

@KebanFiru KebanFiru released this 24 Jun 12:36
7f17146

New Features

Date range filtering for all chart granularities
"By Days of the Week" and "By Hour of Day" views now show the date range picker just like Daily / Weekly / Monthly / Yearly. Selecting a date range recomputes weekday and hourly aggregates from the filtered daily data instead of showing all-time totals.

Commit Activity chart converted to bar chart
The "Commits" dataset in the Repo Analytics commit activity chart is now rendered as a bar/column chart instead of a line chart, making it easier to compare commit volume across time periods.

Branch-aware Repository Analytics
The Repo Analytics tab now scopes to the current branch, just like Contributors and Language stats. On a feature branch it shows only commits between the merge-base and HEAD, with a branch badge in the section header. On main/master it shows full repository history as before.

Extension icon
Added a PNG icon (resources/codecount.png) shown on the VS Code Marketplace and extension panel. The Activity Bar uses a separate monochrome SVG (resources/codecount-icon.svg) that adapts to the active theme color.

Bug Fixes

Author name parsing with pipes
parseContributorLog used split('|') to separate author name from email, which broke for names containing a | character. Fixed by using lastIndexOf('|') so the email is always taken from the last segment regardless of the name content.

Branch badge shown incorrectly on main/master
The contributor stats branch badge was displayed even when on main/master, and also when merge-base detection silently failed. The badge now only appears when the current branch is not main/master and a merge-base was successfully resolved.

vscode.RelativePattern raw string base
File watchers for .git/HEAD, refs/heads/**, and packed-refs were constructed with a raw string path as the RelativePattern base. The API requires a vscode.Uri — fixed to pass vscode.Uri.file(gitDirPath).

rev-parse called twice
getContributorStats called rev-parse --abbrev-ref HEAD twice in different code paths. Refactored to call it once and reuse the result.

Toggle button showed literal ${effectiveStats.length} text
The "Show all N contributors" button collapsed back to the literal placeholder string ${effectiveStats.length} in the browser because the click handler used a single-quoted JS string instead of a template literal. Fixed by storing the count in a data-count attribute and reading it at runtime.

linesByWeekday / linesByHour only counted additions
The "Avg Lines/Commit" metric in the "By Days of the Week" and "By Hour of Day" chart views was computed from added lines only. Fixed to accumulate added + deleted, making it consistent with the avgLinesChangedPerCommit metric elsewhere.

aggregateByHour avgLines inconsistent with totals
The scaled avgLines array was computed as hourAvgLines[i] * scale rather than added[i] / commits[i], which diverged from the actual totals due to integer rounding. Fixed to derive avgLines from the already-computed added and commits arrays.

Sidebar showed no path to full history on feature branches
When on a feature branch the Contributors sidebar node filtered to branch-only contributors with no way to reach full-repo history. A "Branch view — Dashboard shows full history" info node (with a click-to-open-dashboard link) is now shown below the contributor count when branch filtering is active.

Branch-aware Language Distribution dashboard
The "Line Count by Language" and "Detailed Language Breakdown" cards in the Languages tab now show the same ⎇ branch-name / ⎇ all branches badge as Contributors and Repo Analytics. The underlying data was already branch-scoped; this change makes the active scope visible to the user. LanguageStatsResult now carries an optional branch field for this purpose.

Branch sections fall back to full history when the branch has no new commits
All three branch-aware sections (Language Distribution, Contributors, Repo Analytics) previously showed empty data when on a feature branch that had not yet received any commits (e.g. all changes were still unstaged). They now detect this case via rev-list --count mergeBase..HEAD and fall back to showing full repository history with the "all branches" badge, identical to main/master behaviour.

Removed

  • getContributorStatsAll() — dead code with no callers; removed along with its private helper getContributorStatsFromGitAll().

Internal refactoring

  • Extracted isDefaultBranch() private helper — eliminates the hardcoded main/master/origin/main/origin/master list that was duplicated in getLanguageStats and getContributorStats
  • Extracted resolveMergeBase() private helper — eliminates the sequential try/catch merge-base probe that was also duplicated across both methods
  • Extracted emptyRepoAnalytics(available) private helper — eliminates the duplicate empty-result literal in the early-return and catch paths of getRepoAnalytics