Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added man/images/git-license-metrics-report.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added man/images/git-license-metrics-select.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added man/images/git-license-metrics-start.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions man/manual-style.tex
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@
\usepackage{fancyvrb,newverbs,xcolor}
\usepackage{xcolor}

% Keep figures where they are placed in the text
\usepackage{float}
\floatplacement{figure}{H}

% Wider number columns in the table of contents so that numbers such as
% "20" and "A.318" do not run into the titles
\usepackage{etoolbox}
\makeatletter
\patchcmd{\l@chapter}{\setlength\@tempdima{1.5em}}{\setlength\@tempdima{2.2em}}{}{}
\renewcommand*\l@section{\@dottedtocline{1}{2.2em}{3.9em}}
\renewcommand*\l@subsection{\@dottedtocline{2}{6.1em}{4.1em}}
\makeatother

\titleformat{\chapter}[display]
{\normalfont\huge\bfseries}{\chaptertitlename\ \thechapter}{20pt}{\Huge}
\titlespacing*{\chapter}{0pt}{-20pt}{20pt}
Expand Down
54 changes: 54 additions & 0 deletions man/manual.md
Original file line number Diff line number Diff line change
Expand Up @@ -1616,3 +1616,57 @@ If you have `cppcheck-premium-loc` files in your project folders, those should b
If such files are generated during analysis, then review your scripts to check why those files are generated.

:::

::: {.content-visible when-profile="premium"}

# Git License Metrics

## Installing the tool

The tool is installed together with Cppcheck Premium. The installation folder contains a file
`git-license-metrics` that you can execute.

## Clone your repositories

If you don't have your source code locally, you need to clone your repositories.

Full clone:

git clone URL

If a "full clone" is too large you can clone like this. The file data is not cloned then, which
means that the "lines of code" can't be calculated:

git clone --bare --filter=blob:none URL

## Usage on Windows

Start the tool:

![Git License Metrics start window](images/git-license-metrics-start.png)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI review

These are the first images in manual.md. build-html.sh doesn't pass --embed-resources, so manual-premium.html links to images/git-license-metrics-*.png. But .github/workflows/buildman.yml copies only man/*.pdf man/*.html man/manual.css to output/, so the uploaded HTML shows three broken images. The PDF is fine.

Fix: either copy man/images in the workflow, or add --embed-resources to build-html.sh.


Click on "Select repository" and select the folder that contains your project code. The folder
you choose should contain the `.git` folder.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI review

The previous section suggests git clone --bare --filter=blob:none URL. A bare clone has no .git folder: the repository data (HEAD, objects/, ...) is at the top level of the folder. So "The folder you choose should contain the .git folder" is wrong for users who followed that advice. Mention the bare-clone case here, for example: "(for a bare clone, select the cloned folder itself)".


![Selecting the repository folder](images/git-license-metrics-select.png)

When you click on the "Select Folder" button the report will be shown. Here is an example
report for the simplecpp repo (open source preprocessor project):

![Git License Metrics report](images/git-license-metrics-report.png)

## Usage on Linux

On Linux, `git-license-metrics` is a command line tool. Point it to the root of the repository,
copy the `[summary]` portion of the output, and send it to cppcheck sales:

$ ./git-license-metrics ../cppcheck
Path: ../cppcheck
[summary]
unique authors (last year): 65
ids:
* 9761353d7534333
* 766f7b48652cc16
>ae601cbc6b23b02

:::
Loading