Skip to content

Commit

Permalink
Added the summary
Browse files Browse the repository at this point in the history
  • Loading branch information
malavikakrishnan123 committed Dec 18, 2024
1 parent 8f68d69 commit f5a0b52
Show file tree
Hide file tree
Showing 8 changed files with 118 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/LCT.PackageIdentifier/BomHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ public void WriteBomKpiDataToConsole(BomKpiData bomKpiData)
{CommonHelper.Convert(bomKpiData,nameof(bomKpiData.ComponentsExcluded)),bomKpiData.ComponentsExcluded},
{CommonHelper.Convert(bomKpiData,nameof(bomKpiData.DuplicateComponents)),bomKpiData.DuplicateComponents},
{CommonHelper.Convert(bomKpiData,nameof(bomKpiData.InternalComponents)),bomKpiData.InternalComponents},
{CommonHelper.Convert(bomKpiData,nameof(bomKpiData.ThirdPartyRepoComponents)),bomKpiData.ThirdPartyRepoComponents},
{CommonHelper.Convert(bomKpiData,nameof(bomKpiData.DevdependencyComponents)),bomKpiData.DevdependencyComponents},
{CommonHelper.Convert(bomKpiData,nameof(bomKpiData.ReleaseRepoComponents)),bomKpiData.ReleaseRepoComponents},
{CommonHelper.Convert(bomKpiData,nameof(bomKpiData.UnofficialComponents)),bomKpiData.UnofficialComponents},
{CommonHelper.Convert(bomKpiData,nameof(bomKpiData.ComponentsinSBOMTemplateFile)),bomKpiData.ComponentsinSBOMTemplateFile},
{CommonHelper.Convert(bomKpiData,nameof(bomKpiData.ComponentsUpdatedFromSBOMTemplateFile)),bomKpiData.ComponentsUpdatedFromSBOMTemplateFile},
{CommonHelper.Convert(bomKpiData,nameof(bomKpiData.ComponentsInComparisonBOM)),bomKpiData.ComponentsInComparisonBOM }
Expand Down
17 changes: 17 additions & 0 deletions src/LCT.PackageIdentifier/ConanProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,23 @@ public async Task<List<Component>> GetJfrogRepoDetailsOfAComponent(List<Componen
Property artifactoryrepo = new() { Name = Dataconstant.Cdx_ArtifactoryRepoName, Value = repoName };
Property jfrogRepoPathProperty = new() { Name = Dataconstant.Cdx_JfrogRepoPath, Value = jfrogRepoPath };
Component componentVal = component;
if (artifactoryrepo.Value == appSettings.Conan.JfrogDevDestRepoName)
{
BomCreator.bomKpiData.DevdependencyComponents++;
}
if (artifactoryrepo.Value == appSettings.Conan.JfrogThirdPartyDestRepoName)
{
BomCreator.bomKpiData.ThirdPartyRepoComponents++;
}
if (artifactoryrepo.Value == appSettings.Conan.JfrogInternalDestRepoName)
{
BomCreator.bomKpiData.ReleaseRepoComponents++;
}

if (artifactoryrepo.Value == "Not found In Jfrog Repo")
{
BomCreator.bomKpiData.UnofficialComponents++;
}

if (componentVal.Properties?.Count == null || componentVal.Properties?.Count <= 0)
{
Expand Down
17 changes: 17 additions & 0 deletions src/LCT.PackageIdentifier/DebianProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,23 @@ public async Task<List<Component>> GetJfrogRepoDetailsOfAComponent(List<Componen
Property jfrogFileNameProperty = new() { Name = Dataconstant.Cdx_Siemensfilename, Value = jfrogRepoPackageName };
Property jfrogRepoPathProperty = new() { Name = Dataconstant.Cdx_JfrogRepoPath, Value = jfrogRepoPath };
Component componentVal = component;
if (artifactoryrepo.Value == appSettings.Debian.JfrogDevDestRepoName)
{
BomCreator.bomKpiData.DevdependencyComponents++;
}
if (artifactoryrepo.Value == appSettings.Debian.JfrogThirdPartyDestRepoName)
{
BomCreator.bomKpiData.ThirdPartyRepoComponents++;
}
if (artifactoryrepo.Value == appSettings.Debian.JfrogInternalDestRepoName)
{
BomCreator.bomKpiData.ReleaseRepoComponents++;
}

if (artifactoryrepo.Value == "Not found In Jfrog Repo")
{
BomCreator.bomKpiData.UnofficialComponents++;
}

if (componentVal.Properties?.Count == null || componentVal.Properties?.Count <= 0)
{
Expand Down
17 changes: 17 additions & 0 deletions src/LCT.PackageIdentifier/MavenProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,23 @@ public async Task<List<Component>> GetJfrogRepoDetailsOfAComponent(List<Componen
Property artifactoryrepo = new() { Name = Dataconstant.Cdx_ArtifactoryRepoName, Value = finalRepoData.Repo };

Component componentVal = component;
if (artifactoryrepo.Value == appSettings.Maven.JfrogDevDestRepoName)
{
BomCreator.bomKpiData.DevdependencyComponents++;
}
if (artifactoryrepo.Value == appSettings.Maven.JfrogThirdPartyDestRepoName)
{
BomCreator.bomKpiData.ThirdPartyRepoComponents++;
}
if (artifactoryrepo.Value == appSettings.Maven.JfrogInternalDestRepoName)
{
BomCreator.bomKpiData.ReleaseRepoComponents++;
}

if (artifactoryrepo.Value == "Not found In Jfrog Repo")
{
BomCreator.bomKpiData.UnofficialComponents++;
}
if (componentVal.Properties?.Count == null || componentVal.Properties?.Count <= 0)
{
componentVal.Properties = new List<Property>();
Expand Down
13 changes: 13 additions & 0 deletions src/LCT.PackageIdentifier/Model/BomKpiData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,19 @@ public class BomKpiData
[DisplayName(@"Internal Components Identified")]
public int InternalComponents { get; set; }

[DisplayName(@"Components already present in 3rd party repo(s) ")]
public int ThirdPartyRepoComponents { get; set; }

[DisplayName(@"Components already present in devdep repo(s)")]
public int DevdependencyComponents { get; set; }

[DisplayName(@"Components already present in release repo(s)")]
public int ReleaseRepoComponents { get; set; }

[DisplayName(@"Components not from official repo(s)")]
public int UnofficialComponents { get; set; }


[DisplayName(@"Total Components Excluded")]
public int ComponentsExcluded { get; set; }

Expand Down
17 changes: 17 additions & 0 deletions src/LCT.PackageIdentifier/NpmProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,23 @@ public async Task<List<Component>> GetJfrogRepoDetailsOfAComponent(List<Componen
Property siemensfileNameProp = new() { Name = Dataconstant.Cdx_Siemensfilename, Value = finalRepoData?.Name ?? Dataconstant.PackageNameNotFoundInJfrog };
Property jfrogRepoPathProp = new() { Name = Dataconstant.Cdx_JfrogRepoPath, Value = jfrogRepoPath };
Component componentVal = component;
if (artifactoryrepo.Value == appSettings.Npm.JfrogDevDestRepoName)
{
BomCreator.bomKpiData.DevdependencyComponents++;
}
if (artifactoryrepo.Value == appSettings.Npm.JfrogThirdPartyDestRepoName)
{
BomCreator.bomKpiData.ThirdPartyRepoComponents++;
}
if (artifactoryrepo.Value == appSettings.Npm.JfrogInternalDestRepoName)
{
BomCreator.bomKpiData.ReleaseRepoComponents++;
}

if (artifactoryrepo.Value == "Not found In Jfrog Repo")
{
BomCreator.bomKpiData.UnofficialComponents++;
}

if (componentVal.Properties?.Count == null || componentVal.Properties?.Count <= 0)
{
Expand Down
16 changes: 16 additions & 0 deletions src/LCT.PackageIdentifier/NugetProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,23 @@ public async Task<List<Component>> GetJfrogRepoDetailsOfAComponent(List<Componen
Property siemensfileNameProp = new() { Name = Dataconstant.Cdx_Siemensfilename, Value = finalRepoData?.Name ?? Dataconstant.PackageNameNotFoundInJfrog };
Property jfrogRepoPathProp = new() { Name = Dataconstant.Cdx_JfrogRepoPath, Value = jfrogRepoPath };
Component componentVal = component;
if (artifactoryrepo.Value == appSettings.Nuget.JfrogDevDestRepoName)
{
BomCreator.bomKpiData.DevdependencyComponents++;
}
if (artifactoryrepo.Value == appSettings.Nuget.JfrogThirdPartyDestRepoName)
{
BomCreator.bomKpiData.ThirdPartyRepoComponents++;
}
if (artifactoryrepo.Value == appSettings.Nuget.JfrogInternalDestRepoName)
{
BomCreator.bomKpiData.ReleaseRepoComponents++;
}

if (artifactoryrepo.Value == "Not found In Jfrog Repo")
{
BomCreator.bomKpiData.UnofficialComponents++;
}
if (componentVal.Properties?.Count == null || componentVal.Properties?.Count <= 0)
{
componentVal.Properties = new List<Property>();
Expand Down
17 changes: 17 additions & 0 deletions src/LCT.PackageIdentifier/PythonProcessor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,23 @@ public async Task<List<Component>> GetJfrogRepoDetailsOfAComponent(List<Componen
Property fileNameProperty = new() { Name = Dataconstant.Cdx_Siemensfilename, Value = jfrogPackageNameWhlExten };
Property jfrogRepoPathProperty = new() { Name = Dataconstant.Cdx_JfrogRepoPath, Value = jfrogRepoPath };
Component componentVal = component;
if (artifactoryrepo.Value == appSettings.Python.JfrogDevDestRepoName)
{
BomCreator.bomKpiData.DevdependencyComponents++;
}
if (artifactoryrepo.Value == appSettings.Python.JfrogThirdPartyDestRepoName)
{
BomCreator.bomKpiData.ThirdPartyRepoComponents++;
}
if (artifactoryrepo.Value == appSettings.Python.JfrogInternalDestRepoName)
{
BomCreator.bomKpiData.ReleaseRepoComponents++;
}

if (artifactoryrepo.Value == "Not found In Jfrog Repo")
{
BomCreator.bomKpiData.UnofficialComponents++;
}

if (componentVal.Properties?.Count == null || componentVal.Properties?.Count <= 0)
{
Expand Down

0 comments on commit f5a0b52

Please sign in to comment.