* Present information about detected compilers and packers */
| 203 | * Present information about detected compilers and packers |
| 204 | */ |
| 205 | void JsonPresentation::presentCompiler(Writer& writer) const |
| 206 | { |
| 207 | if (fileinfo.toolInfo.detectedTools.empty()) |
| 208 | { |
| 209 | return; |
| 210 | } |
| 211 | |
| 212 | writer.String("tools"); |
| 213 | writer.StartArray(); |
| 214 | |
| 215 | for(const auto &tool : fileinfo.toolInfo.detectedTools) |
| 216 | { |
| 217 | writer.StartObject(); |
| 218 | |
| 219 | serializeString(writer, "type", toolTypeToString(tool.type)); |
| 220 | serializeString(writer, "name", tool.name); |
| 221 | serializeString(writer, "version", tool.versionInfo); |
| 222 | serializeString(writer, "additional", tool.additionalInfo); |
| 223 | serializeString( |
| 224 | writer, |
| 225 | "method", |
| 226 | detectionMetodToString(tool.source)); |
| 227 | serdes::serializeBool( |
| 228 | writer, |
| 229 | "heuristics", |
| 230 | tool.source != DetectionMethod::SIGNATURE); |
| 231 | serdes::serializeUint64( |
| 232 | writer, |
| 233 | "identicalSignificantNibbles", |
| 234 | tool.agreeCount); |
| 235 | serdes::serializeUint64( |
| 236 | writer, |
| 237 | "totalSignificantNibbles", |
| 238 | tool.impCount); |
| 239 | serdes::serializeDouble( |
| 240 | writer, |
| 241 | "percentage", |
| 242 | tool.impCount |
| 243 | ? static_cast<double>(tool.agreeCount) / tool.impCount * 100 |
| 244 | : 0.0); |
| 245 | |
| 246 | writer.EndObject(); |
| 247 | } |
| 248 | |
| 249 | writer.EndArray(); |
| 250 | } |
| 251 | |
| 252 | /** |
| 253 | * Present information about detected languages |
nothing calls this directly
no test coverage detected