|
| 1 | +using System; |
| 2 | +using System.Collections.Generic; |
| 3 | +using System.Linq; |
| 4 | +using System.Text; |
| 5 | +using System.Threading.Tasks; |
| 6 | + |
| 7 | +namespace CodeQLToolkit.Shared.Types |
| 8 | +{ |
| 9 | + public class SARIFResult |
| 10 | + { |
| 11 | + public Run[] runs { get; set; } |
| 12 | + public string schema { get; set; } |
| 13 | + public string version { get; set; } |
| 14 | + |
| 15 | + public string? RawSARIF { get; set; } |
| 16 | + } |
| 17 | + |
| 18 | + public class Run |
| 19 | + { |
| 20 | + public Artifact[] artifacts { get; set; } |
| 21 | + public Automationdetails automationDetails { get; set; } |
| 22 | + public Conversion conversion { get; set; } |
| 23 | + public Result[] results { get; set; } |
| 24 | + public Tool1 tool { get; set; } |
| 25 | + public Versioncontrolprovenance[] versionControlProvenance { get; set; } |
| 26 | + } |
| 27 | + |
| 28 | + public class Automationdetails |
| 29 | + { |
| 30 | + public string id { get; set; } |
| 31 | + } |
| 32 | + |
| 33 | + public class Conversion |
| 34 | + { |
| 35 | + public Tool tool { get; set; } |
| 36 | + } |
| 37 | + |
| 38 | + public class Tool |
| 39 | + { |
| 40 | + public Driver driver { get; set; } |
| 41 | + } |
| 42 | + |
| 43 | + public class Driver |
| 44 | + { |
| 45 | + public string name { get; set; } |
| 46 | + } |
| 47 | + |
| 48 | + public class Tool1 |
| 49 | + { |
| 50 | + public Driver1 driver { get; set; } |
| 51 | + public Extension[] extensions { get; set; } |
| 52 | + } |
| 53 | + |
| 54 | + public class Driver1 |
| 55 | + { |
| 56 | + public string name { get; set; } |
| 57 | + public string semanticVersion { get; set; } |
| 58 | + } |
| 59 | + |
| 60 | + public class Extension |
| 61 | + { |
| 62 | + public string name { get; set; } |
| 63 | + public string semanticVersion { get; set; } |
| 64 | + public Rule[] rules { get; set; } |
| 65 | + } |
| 66 | + |
| 67 | + public class Rule |
| 68 | + { |
| 69 | + public Defaultconfiguration defaultConfiguration { get; set; } |
| 70 | + public Fulldescription fullDescription { get; set; } |
| 71 | + public Help help { get; set; } |
| 72 | + public string id { get; set; } |
| 73 | + public string name { get; set; } |
| 74 | + public Properties properties { get; set; } |
| 75 | + public Shortdescription shortDescription { get; set; } |
| 76 | + } |
| 77 | + |
| 78 | + public class Defaultconfiguration |
| 79 | + { |
| 80 | + public string level { get; set; } |
| 81 | + } |
| 82 | + |
| 83 | + public class Fulldescription |
| 84 | + { |
| 85 | + public string text { get; set; } |
| 86 | + } |
| 87 | + |
| 88 | + public class Help |
| 89 | + { |
| 90 | + public string markdown { get; set; } |
| 91 | + public string text { get; set; } |
| 92 | + } |
| 93 | + |
| 94 | + public class Properties |
| 95 | + { |
| 96 | + public string precision { get; set; } |
| 97 | + public string queryURI { get; set; } |
| 98 | + public string securityseverity { get; set; } |
| 99 | + public string[] tags { get; set; } |
| 100 | + } |
| 101 | + |
| 102 | + public class Shortdescription |
| 103 | + { |
| 104 | + public string text { get; set; } |
| 105 | + } |
| 106 | + |
| 107 | + public class Artifact |
| 108 | + { |
| 109 | + public Location location { get; set; } |
| 110 | + } |
| 111 | + |
| 112 | + public class Location |
| 113 | + { |
| 114 | + public int index { get; set; } |
| 115 | + public string uri { get; set; } |
| 116 | + } |
| 117 | + |
| 118 | + public class Result |
| 119 | + { |
| 120 | + public string correlationGuid { get; set; } |
| 121 | + public string level { get; set; } |
| 122 | + |
| 123 | + public Location1[] locations { get; set; } |
| 124 | + |
| 125 | + public string LocationsString() |
| 126 | + { |
| 127 | + |
| 128 | + List<string> _locations = new List<string>(); |
| 129 | + |
| 130 | + foreach (var location in locations) |
| 131 | + { |
| 132 | + _locations.Add(location.ToString()); |
| 133 | + } |
| 134 | + |
| 135 | + return string.Join(", ", _locations); |
| 136 | + |
| 137 | + } |
| 138 | + public Message message { get; set; } |
| 139 | + public Partialfingerprints partialFingerprints { get; set; } |
| 140 | + public Properties1 properties { get; set; } |
| 141 | + public Rule1 rule { get; set; } |
| 142 | + public string ruleId { get; set; } |
| 143 | + } |
| 144 | + |
| 145 | + public class Message |
| 146 | + { |
| 147 | + public string text { get; set; } |
| 148 | + } |
| 149 | + |
| 150 | + public class Partialfingerprints |
| 151 | + { |
| 152 | + public string primaryLocationLineHash { get; set; } |
| 153 | + } |
| 154 | + |
| 155 | + public class Properties1 |
| 156 | + { |
| 157 | + public int githubalertNumber { get; set; } |
| 158 | + public string githubalertUrl { get; set; } |
| 159 | + } |
| 160 | + |
| 161 | + public class Rule1 |
| 162 | + { |
| 163 | + public string id { get; set; } |
| 164 | + public Toolcomponent toolComponent { get; set; } |
| 165 | + public int index { get; set; } |
| 166 | + } |
| 167 | + |
| 168 | + public class Toolcomponent |
| 169 | + { |
| 170 | + public int index { get; set; } |
| 171 | + } |
| 172 | + |
| 173 | + public class Location1 |
| 174 | + { |
| 175 | + public Physicallocation physicalLocation { get; set; } |
| 176 | + |
| 177 | + public override string ToString() |
| 178 | + { |
| 179 | + return $"{physicalLocation.artifactLocation.uri}:{physicalLocation.region.startLine}:{physicalLocation.region.startColumn}-{physicalLocation.region.endLine}:{physicalLocation.region.endColumn}"; |
| 180 | + } |
| 181 | + } |
| 182 | + |
| 183 | + public class Physicallocation |
| 184 | + { |
| 185 | + public Artifactlocation artifactLocation { get; set; } |
| 186 | + public Region region { get; set; } |
| 187 | + } |
| 188 | + |
| 189 | + public class Artifactlocation |
| 190 | + { |
| 191 | + public int index { get; set; } |
| 192 | + public string uri { get; set; } |
| 193 | + } |
| 194 | + |
| 195 | + public class Region |
| 196 | + { |
| 197 | + public int endColumn { get; set; } |
| 198 | + public int endLine { get; set; } |
| 199 | + public int startColumn { get; set; } |
| 200 | + public int startLine { get; set; } |
| 201 | + } |
| 202 | + |
| 203 | + public class Versioncontrolprovenance |
| 204 | + { |
| 205 | + public string branch { get; set; } |
| 206 | + public string repositoryUri { get; set; } |
| 207 | + public string revisionId { get; set; } |
| 208 | + } |
| 209 | +} |
0 commit comments