Skip to content

Commit

Permalink
display inverse
Browse files Browse the repository at this point in the history
  • Loading branch information
ignatandrei committed Oct 16, 2024
1 parent e094640 commit f414ef3
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
maxCommitString = "this year," + currentYear;
}
var maxCommitFiles = projectDicts.CommitsWithMaxFiles(null);
var top10Files = projectDicts.FilesWithMaxCommits(null);
NamePerCountArray topFiles = projectDicts.FilesWithMaxCommitsAdv(null)??NamePerCountArray.Empty;
var medianCommits = projectDicts.MedianCommits(null);
KeyValuePair<string, int>? filewithMaxCommits = top10Files?.Length > 0 ? top10Files.First() : null;
var filewithMaxCommits = topFiles?.First1();
Tuple<NamePerCountArray, string> tuple;
Tuple<string, NamePerCountArray, int, int, bool> tupleThreshold;
NamePerCountDisplayThreshold namePerCountDisplayThreshold;
Expand Down Expand Up @@ -310,7 +310,7 @@
<tr>
<td>@(++tableRow)</td>
<td>
<a href="Commits-per-year-and-folder">
<a href="#Commits-per-year-and-folder">
last commit
</a> : @maxCommitString
</td>
Expand All @@ -319,13 +319,18 @@
<tr>
<td>@(++tableRow)</td>
<td>
The commit with max files ( @maxCommitFiles.CountFiles() ) is sha @(maxCommitFiles.sha) on @maxCommitFiles.date.ToString("yyyy MMMM dd") )
<a href="#maxCommitFilesPerYear">
The commit with max files
</a>
( @maxCommitFiles.CountFiles() ) is sha @(maxCommitFiles.sha) on @maxCommitFiles.date.ToString("yyyy MMMM dd") )
</td>
</tr>
<tr>
<td>@(++tableRow)</td>
<td>
The file with most commits ( @filewithMaxCommits?.Value ) is @GlobalsForGenerating.RelativePath(filewithMaxCommits?.Key)
<a href="#file-with-commits">
The file with most commits
</a>( @filewithMaxCommits?.Count ) is @GlobalsForGenerating.RelativePath(filewithMaxCommits?.Name)
</td>
</tr>

Expand Down Expand Up @@ -1259,14 +1264,24 @@ columns: [

@yearFolders.Render()

<h3 id="file-with-commits">Commits per file</h3>
<text>
@{
tuple = new(topFiles!, "Files with commits");
namePerCountDisplay = new(tuple);

}
@namePerCountDisplay.Render();
</text>


}


@{
var maxCommitFilesPerYear = projectDicts.CommitsWithMaxFilesPerYear();
}
<h3> Commits with most files per year</h3>
<h3 id="maxCommitFilesPerYear"> Commits with most files per year</h3>
<table border="1">
<thead>
<tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,11 @@


## Commits
![Number-exec-lines-per-method](./images/@(nameFolder)/commits-year-project.png)

### File with most commits

![Files-with-commits](./images/@(nameFolder)/Files-with-commits.png)

### Commits per year and project

![Commits per year and project](./images/@(nameFolder)/commits-year-project.png)
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
{
nameCountGraphic = nameCount.Take(10).ToArray();
}
string assNamesMaintIndex = string.Join(",", nameCountGraphic.Select(it => "'" + it.Name + "'"));
string assNamesMaintIndex = string.Join(",", nameCountGraphic.Select(it => "'" + it.Name.Replace("\\", "\\\\") + "'"));
string valuesMaintIndex = string.Join(",\r\n",
nameCountGraphic.Select(it => "{value:" + it.Count +"}")
);
Expand All @@ -63,11 +63,11 @@
var option;
option = {
xAxis: {
yAxis: {
type: 'category',
data: [@assNamesMaintIndex]
},
yAxis: {
xAxis: {
type: 'value'
},
tooltip: {
Expand All @@ -80,6 +80,10 @@
@valuesMaintIndex
],
type: 'bar'
, label: {
show: true,
formatter: '{c}'
}
}
]
};
Expand Down Expand Up @@ -120,7 +124,7 @@ bar @yAxis
@foreach (var item in nameCountOriginal)
{
<text>
{"Name": "@item.Name", "Nr": "@item.Count" },
{"Name": "@item.Name.Replace("\\", "\\\\")", "Nr": "@item.Count" },
</text>
}
];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@
var option;
option = {
xAxis: {
yAxis: {
type: 'category',
data: [@assNamesMaintIndex]
},
yAxis: {
xAxis: {
type: 'value'
},
tooltip: {
Expand All @@ -86,6 +86,10 @@
@valuesMaintIndex
],
type: 'bar'
, label: {
show: true,
formatter: '{c}'
}
}
]
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,13 @@ public int MedianCommits(int? year)
return StatisticalNumbers<int>.Median(data.Select(it => it.Value).ToArray());

}
public NamePerCountArray FilesWithMaxCommitsAdv(int? year)
{
var data= FilesWithMaxCommits(year)
.Select(it => new NamePerCount(it.Key, it.Value))
.ToArray();
return new NamePerCountArray(data,true);
}
public KeyValuePair<string, int>[] FilesWithMaxCommits(int? year)
{
int take = 10;
Expand Down
1 change: 1 addition & 0 deletions src/NetPackageAnalyzer/NetPackageAnalyzerObjects/many.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public record NamePerCount(string Name, long Count)
}
public record NamePerCountArray(NamePerCount[]? NamePerCounts,bool Descending)
{
public static NamePerCountArray Empty = new NamePerCountArray([], false);
public Statistics<long> Statistics()
{
return new Statistics<long>(
Expand Down

0 comments on commit f414ef3

Please sign in to comment.