Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added sql for table #69

Merged
merged 1 commit into from
May 30, 2024
Merged
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
19 changes: 19 additions & 0 deletions code/AmIVulnerable/Modells/Report.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using System.Text.Json.Serialization;

namespace Modells {

public class Report {

/// <summary></summary>
[JsonPropertyName(nameof(AnalysedRepoUuid))]
public string AnalysedRepoUuid { get; set; } = "";

/// <summary></summary>
[JsonPropertyName(nameof(AnalysedRepoTag))]
public string? AnalysedRepoTag { get; set; } = null;

/// <summary></summary>
[JsonPropertyName(nameof(ReportMetrics))]
public object ReportMetrics { get; set; } = new ReportMetric();
}
}
23 changes: 23 additions & 0 deletions code/AmIVulnerable/Modells/ReportMetric.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using System.Text.Json.Serialization;

namespace Modells {

public class ReportMetric {

/// <summary></summary>
[JsonPropertyName(nameof(TotalDirectVulnerabilities))]
public int TotalDirectVulnerabilities { get; set; } = new int();

/// <summary></summary>
[JsonPropertyName(nameof(TotalTransitiveVulnerabilities))]
public int TotalTransitiveVulnerabilities { get; set; } = new int();

/// <summary></summary>
[JsonPropertyName(nameof(MeanSeverityDirectVulnerabilities))]
public int MeanSeverityDirectVulnerabilities { get; set; } = new int();

/// <summary></summary>
[JsonPropertyName(nameof(MeanSeverityTransitiveVulnerabilities))]
public int MeanSeverityTransitiveVulnerabilities { get; set; } = new int();
}
}
5 changes: 5 additions & 0 deletions code/AmIVulnerable/sql/init.sql
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,8 @@ CREATE TABLE IF NOT EXISTS cve.repositories(
repoDesignation VARCHAR(300) NOT NULL,
tag VARCHAR(500) DEFAULT ''
);

CREATE TABLE IF NOT EXISTS cve.reports(
guid VARCHAR(36) PRIMARY KEY NOT NULL,
metrics JSON NOT NULL
);
Loading