Skip to content

Commit

Permalink
v8.2024.1025.925
Browse files Browse the repository at this point in the history
  • Loading branch information
ignatandrei committed Oct 25, 2024
1 parent 4acb814 commit 049132e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<ProjectReference Include="..\NPA.GitInfo\NPA.GitInfo.csproj" />
</ItemGroup>
<PropertyGroup>
<Version>8.2024.1021.1350</Version>
<Version>8.2024.1025.925</Version>
<PackAsTool>true</PackAsTool>
<ToolCommandName>PackageAnalyzer</ToolCommandName>
<Authors>Andrei Ignat</Authors>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ public NamePerCount[] NamePerCounts()
{
return new NamePerCount[]
{
new NamePerCount("Vulnerable",vulnerable.Length),
new NamePerCount("Outdated",outdated.Length),
new NamePerCount("Deprecated",deprecated.Length)
new NamePerCount("Vulnerable",Vuln().Length),
new NamePerCount("Outdated",Out().Length),
new NamePerCount("Deprecated",Depr().Length)
};
}
public PackageWithVersion[] All()
Expand All @@ -33,15 +33,15 @@ public PackageWithVersion[] AllNotDistinct()
}
public PackageWithVersion[] Vuln()
{
return vulnerable.ToArray();
return vulnerable.Distinct().ToArray();
}
public PackageWithVersion[] Out()
{
return outdated.ToArray();
return outdated.Distinct().ToArray();
}
public PackageWithVersion[] Depr()
{
return deprecated.ToArray();
return deprecated.Distinct().ToArray();
}
public void VerifyWhy()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public void CopyWhyFrom(PackageGatherInfo from)
}
public void VerifyWhy()
{
if (PackageId == "Microsoft.NETCore.Platforms") return;
//if (PackageId == "Microsoft.NETCore.Platforms") return;
if (Why.Length > 0) return;
if(_allPackages.ContainsKey(PackageId))
{
Expand All @@ -23,6 +23,8 @@ public void VerifyWhy()

var str = processOutput.OutputWhy(GlobalsForGenerating.FullPathToSolution, PackageId);
var arrStr = str.Split(new[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries); ;
int tooManyLines = 5000;
bool StopTooManyLines = (arrStr.Length > tooManyLines);
WhyData? whyData = null;
foreach (var item in arrStr)
{
Expand All @@ -44,12 +46,17 @@ public void VerifyWhy()
}
whyData = new();
whyData.ProjectText = item;
if (StopTooManyLines) break;
continue;
}
whyData!.WhyText += Environment.NewLine + item;
}
if (whyData != null)
{
if (StopTooManyLines)
{
whyData.ProjectText = $"Too many lines {arrStr.Length} to show full dependency";
}
whyDatas.Add(whyData);
}
}
Expand Down

0 comments on commit 049132e

Please sign in to comment.