From 59ca1f400602868041c553ed4e748f9269d0e3a4 Mon Sep 17 00:00:00 2001 From: Dominik Richter Date: Sun, 3 Mar 2024 23:16:00 -0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=AA=20experimental:=20decayed=20+=20ba?= =?UTF-8?q?nded=20scoring?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These will be added in cnspec, keywords need to be defined in cnquery Signed-off-by: Dominik Richter --- explorer/cnquery_explorer.pb.go | 164 +++++++++++++++++--------------- explorer/cnquery_explorer.proto | 12 +++ explorer/impact.go | 12 +++ 3 files changed, 110 insertions(+), 78 deletions(-) diff --git a/explorer/cnquery_explorer.pb.go b/explorer/cnquery_explorer.pb.go index 93556d5b96..96185eec16 100644 --- a/explorer/cnquery_explorer.pb.go +++ b/explorer/cnquery_explorer.pb.go @@ -97,6 +97,8 @@ const ( ScoringSystem_AVERAGE ScoringSystem = 3 ScoringSystem_DATA_ONLY ScoringSystem = 4 ScoringSystem_IGNORE_SCORE ScoringSystem = 5 + ScoringSystem_BANDED ScoringSystem = 6 + ScoringSystem_DECAYED ScoringSystem = 7 ) // Enum value maps for ScoringSystem. @@ -108,6 +110,8 @@ var ( 3: "AVERAGE", 4: "DATA_ONLY", 5: "IGNORE_SCORE", + 6: "BANDED", + 7: "DECAYED", } ScoringSystem_value = map[string]int32{ "SCORING_UNSPECIFIED": 0, @@ -116,6 +120,8 @@ var ( "AVERAGE": 3, "DATA_ONLY": 4, "IGNORE_SCORE": 5, + "BANDED": 6, + "DECAYED": 7, } ) @@ -3556,87 +3562,89 @@ var file_cnquery_explorer_proto_rawDesc = []byte{ 0x0a, 0x44, 0x45, 0x41, 0x43, 0x54, 0x49, 0x56, 0x41, 0x54, 0x45, 0x10, 0x02, 0x12, 0x0c, 0x0a, 0x08, 0x41, 0x43, 0x54, 0x49, 0x56, 0x41, 0x54, 0x45, 0x10, 0x03, 0x12, 0x0a, 0x0a, 0x06, 0x49, 0x47, 0x4e, 0x4f, 0x52, 0x45, 0x10, 0x04, 0x12, 0x10, 0x0a, 0x0c, 0x4f, 0x55, 0x54, 0x5f, 0x4f, - 0x46, 0x5f, 0x53, 0x43, 0x4f, 0x50, 0x45, 0x10, 0x05, 0x2a, 0x6f, 0x0a, 0x0d, 0x53, 0x63, 0x6f, - 0x72, 0x69, 0x6e, 0x67, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x12, 0x17, 0x0a, 0x13, 0x53, 0x43, - 0x4f, 0x52, 0x49, 0x4e, 0x47, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, - 0x44, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x57, 0x45, 0x49, 0x47, 0x48, 0x54, 0x45, 0x44, 0x10, - 0x01, 0x12, 0x09, 0x0a, 0x05, 0x57, 0x4f, 0x52, 0x53, 0x54, 0x10, 0x02, 0x12, 0x0b, 0x0a, 0x07, - 0x41, 0x56, 0x45, 0x52, 0x41, 0x47, 0x45, 0x10, 0x03, 0x12, 0x0d, 0x0a, 0x09, 0x44, 0x41, 0x54, - 0x41, 0x5f, 0x4f, 0x4e, 0x4c, 0x59, 0x10, 0x04, 0x12, 0x10, 0x0a, 0x0c, 0x49, 0x47, 0x4e, 0x4f, - 0x52, 0x45, 0x5f, 0x53, 0x43, 0x4f, 0x52, 0x45, 0x10, 0x05, 0x32, 0xb1, 0x04, 0x0a, 0x08, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x48, 0x75, 0x62, 0x12, 0x40, 0x0a, 0x09, 0x53, 0x65, 0x74, 0x42, 0x75, - 0x6e, 0x64, 0x6c, 0x65, 0x12, 0x18, 0x2e, 0x63, 0x6e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x65, - 0x78, 0x70, 0x6c, 0x6f, 0x72, 0x65, 0x72, 0x2e, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x1a, 0x17, + 0x46, 0x5f, 0x53, 0x43, 0x4f, 0x50, 0x45, 0x10, 0x05, 0x2a, 0x88, 0x01, 0x0a, 0x0d, 0x53, 0x63, + 0x6f, 0x72, 0x69, 0x6e, 0x67, 0x53, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x12, 0x17, 0x0a, 0x13, 0x53, + 0x43, 0x4f, 0x52, 0x49, 0x4e, 0x47, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, + 0x45, 0x44, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x57, 0x45, 0x49, 0x47, 0x48, 0x54, 0x45, 0x44, + 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05, 0x57, 0x4f, 0x52, 0x53, 0x54, 0x10, 0x02, 0x12, 0x0b, 0x0a, + 0x07, 0x41, 0x56, 0x45, 0x52, 0x41, 0x47, 0x45, 0x10, 0x03, 0x12, 0x0d, 0x0a, 0x09, 0x44, 0x41, + 0x54, 0x41, 0x5f, 0x4f, 0x4e, 0x4c, 0x59, 0x10, 0x04, 0x12, 0x10, 0x0a, 0x0c, 0x49, 0x47, 0x4e, + 0x4f, 0x52, 0x45, 0x5f, 0x53, 0x43, 0x4f, 0x52, 0x45, 0x10, 0x05, 0x12, 0x0a, 0x0a, 0x06, 0x42, + 0x41, 0x4e, 0x44, 0x45, 0x44, 0x10, 0x06, 0x12, 0x0b, 0x0a, 0x07, 0x44, 0x45, 0x43, 0x41, 0x59, + 0x45, 0x44, 0x10, 0x07, 0x32, 0xb1, 0x04, 0x0a, 0x08, 0x51, 0x75, 0x65, 0x72, 0x79, 0x48, 0x75, + 0x62, 0x12, 0x40, 0x0a, 0x09, 0x53, 0x65, 0x74, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x12, 0x18, 0x2e, 0x63, 0x6e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x65, 0x78, 0x70, 0x6c, 0x6f, 0x72, 0x65, - 0x72, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x43, 0x0a, 0x0f, 0x44, 0x65, 0x6c, - 0x65, 0x74, 0x65, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x63, 0x6b, 0x12, 0x15, 0x2e, 0x63, - 0x6e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x65, 0x78, 0x70, 0x6c, 0x6f, 0x72, 0x65, 0x72, 0x2e, - 0x4d, 0x72, 0x6e, 0x1a, 0x17, 0x2e, 0x63, 0x6e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x65, 0x78, - 0x70, 0x6c, 0x6f, 0x72, 0x65, 0x72, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x45, - 0x0a, 0x0e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, - 0x12, 0x18, 0x2e, 0x63, 0x6e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x65, 0x78, 0x70, 0x6c, 0x6f, - 0x72, 0x65, 0x72, 0x2e, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x1a, 0x17, 0x2e, 0x63, 0x6e, 0x71, - 0x75, 0x65, 0x72, 0x79, 0x2e, 0x65, 0x78, 0x70, 0x6c, 0x6f, 0x72, 0x65, 0x72, 0x2e, 0x45, 0x6d, - 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x3e, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x42, 0x75, 0x6e, 0x64, - 0x6c, 0x65, 0x12, 0x15, 0x2e, 0x63, 0x6e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x65, 0x78, 0x70, - 0x6c, 0x6f, 0x72, 0x65, 0x72, 0x2e, 0x4d, 0x72, 0x6e, 0x1a, 0x18, 0x2e, 0x63, 0x6e, 0x71, 0x75, - 0x65, 0x72, 0x79, 0x2e, 0x65, 0x78, 0x70, 0x6c, 0x6f, 0x72, 0x65, 0x72, 0x2e, 0x42, 0x75, 0x6e, - 0x64, 0x6c, 0x65, 0x22, 0x00, 0x12, 0x44, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x51, 0x75, 0x65, 0x72, - 0x79, 0x50, 0x61, 0x63, 0x6b, 0x12, 0x15, 0x2e, 0x63, 0x6e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, - 0x65, 0x78, 0x70, 0x6c, 0x6f, 0x72, 0x65, 0x72, 0x2e, 0x4d, 0x72, 0x6e, 0x1a, 0x1b, 0x2e, 0x63, + 0x72, 0x2e, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x1a, 0x17, 0x2e, 0x63, 0x6e, 0x71, 0x75, 0x65, + 0x72, 0x79, 0x2e, 0x65, 0x78, 0x70, 0x6c, 0x6f, 0x72, 0x65, 0x72, 0x2e, 0x45, 0x6d, 0x70, 0x74, + 0x79, 0x22, 0x00, 0x12, 0x43, 0x0a, 0x0f, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x50, 0x61, 0x63, 0x6b, 0x12, 0x15, 0x2e, 0x63, 0x6e, 0x71, 0x75, 0x65, 0x72, 0x79, + 0x2e, 0x65, 0x78, 0x70, 0x6c, 0x6f, 0x72, 0x65, 0x72, 0x2e, 0x4d, 0x72, 0x6e, 0x1a, 0x17, 0x2e, + 0x63, 0x6e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x65, 0x78, 0x70, 0x6c, 0x6f, 0x72, 0x65, 0x72, + 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x45, 0x0a, 0x0e, 0x56, 0x61, 0x6c, 0x69, + 0x64, 0x61, 0x74, 0x65, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x12, 0x18, 0x2e, 0x63, 0x6e, 0x71, + 0x75, 0x65, 0x72, 0x79, 0x2e, 0x65, 0x78, 0x70, 0x6c, 0x6f, 0x72, 0x65, 0x72, 0x2e, 0x42, 0x75, + 0x6e, 0x64, 0x6c, 0x65, 0x1a, 0x17, 0x2e, 0x63, 0x6e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x65, + 0x78, 0x70, 0x6c, 0x6f, 0x72, 0x65, 0x72, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, + 0x3e, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x12, 0x15, 0x2e, 0x63, 0x6e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x65, 0x78, 0x70, 0x6c, 0x6f, 0x72, 0x65, 0x72, 0x2e, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x63, 0x6b, 0x22, 0x00, 0x12, 0x41, 0x0a, 0x0a, 0x47, - 0x65, 0x74, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x73, 0x12, 0x15, 0x2e, 0x63, 0x6e, 0x71, 0x75, - 0x65, 0x72, 0x79, 0x2e, 0x65, 0x78, 0x70, 0x6c, 0x6f, 0x72, 0x65, 0x72, 0x2e, 0x4d, 0x72, 0x6e, - 0x1a, 0x1a, 0x2e, 0x63, 0x6e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x65, 0x78, 0x70, 0x6c, 0x6f, - 0x72, 0x65, 0x72, 0x2e, 0x4d, 0x71, 0x75, 0x65, 0x72, 0x69, 0x65, 0x73, 0x22, 0x00, 0x12, 0x41, - 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x19, 0x2e, 0x63, 0x6e, 0x71, 0x75, 0x65, 0x72, 0x79, - 0x2e, 0x65, 0x78, 0x70, 0x6c, 0x6f, 0x72, 0x65, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, - 0x71, 0x1a, 0x1c, 0x2e, 0x63, 0x6e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x65, 0x78, 0x70, 0x6c, - 0x6f, 0x72, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x63, 0x6b, 0x73, 0x22, - 0x00, 0x12, 0x4b, 0x0a, 0x0c, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x50, 0x61, 0x63, 0x6b, - 0x73, 0x12, 0x21, 0x2e, 0x63, 0x6e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x65, 0x78, 0x70, 0x6c, - 0x6f, 0x72, 0x65, 0x72, 0x2e, 0x44, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x50, 0x61, 0x63, 0x6b, - 0x73, 0x52, 0x65, 0x71, 0x1a, 0x16, 0x2e, 0x63, 0x6e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x65, - 0x78, 0x70, 0x6c, 0x6f, 0x72, 0x65, 0x72, 0x2e, 0x55, 0x52, 0x4c, 0x73, 0x22, 0x00, 0x32, 0xaa, - 0x04, 0x0a, 0x0e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x6f, 0x6e, 0x64, 0x75, 0x63, 0x74, 0x6f, - 0x72, 0x12, 0x41, 0x0a, 0x06, 0x41, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x12, 0x1c, 0x2e, 0x63, 0x6e, - 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x65, 0x78, 0x70, 0x6c, 0x6f, 0x72, 0x65, 0x72, 0x2e, 0x41, - 0x73, 0x73, 0x69, 0x67, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x1a, 0x17, 0x2e, 0x63, 0x6e, 0x71, 0x75, - 0x65, 0x72, 0x79, 0x2e, 0x65, 0x78, 0x70, 0x6c, 0x6f, 0x72, 0x65, 0x72, 0x2e, 0x45, 0x6d, 0x70, - 0x74, 0x79, 0x22, 0x00, 0x12, 0x43, 0x0a, 0x08, 0x55, 0x6e, 0x61, 0x73, 0x73, 0x69, 0x67, 0x6e, - 0x12, 0x1c, 0x2e, 0x63, 0x6e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x65, 0x78, 0x70, 0x6c, 0x6f, - 0x72, 0x65, 0x72, 0x2e, 0x41, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x1a, 0x17, + 0x4d, 0x72, 0x6e, 0x1a, 0x18, 0x2e, 0x63, 0x6e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x65, 0x78, + 0x70, 0x6c, 0x6f, 0x72, 0x65, 0x72, 0x2e, 0x42, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x22, 0x00, 0x12, + 0x44, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x63, 0x6b, 0x12, + 0x15, 0x2e, 0x63, 0x6e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x65, 0x78, 0x70, 0x6c, 0x6f, 0x72, + 0x65, 0x72, 0x2e, 0x4d, 0x72, 0x6e, 0x1a, 0x1b, 0x2e, 0x63, 0x6e, 0x71, 0x75, 0x65, 0x72, 0x79, + 0x2e, 0x65, 0x78, 0x70, 0x6c, 0x6f, 0x72, 0x65, 0x72, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, + 0x61, 0x63, 0x6b, 0x22, 0x00, 0x12, 0x41, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x46, 0x69, 0x6c, 0x74, + 0x65, 0x72, 0x73, 0x12, 0x15, 0x2e, 0x63, 0x6e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x65, 0x78, + 0x70, 0x6c, 0x6f, 0x72, 0x65, 0x72, 0x2e, 0x4d, 0x72, 0x6e, 0x1a, 0x1a, 0x2e, 0x63, 0x6e, 0x71, + 0x75, 0x65, 0x72, 0x79, 0x2e, 0x65, 0x78, 0x70, 0x6c, 0x6f, 0x72, 0x65, 0x72, 0x2e, 0x4d, 0x71, + 0x75, 0x65, 0x72, 0x69, 0x65, 0x73, 0x22, 0x00, 0x12, 0x41, 0x0a, 0x04, 0x4c, 0x69, 0x73, 0x74, + 0x12, 0x19, 0x2e, 0x63, 0x6e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x65, 0x78, 0x70, 0x6c, 0x6f, + 0x72, 0x65, 0x72, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x1a, 0x1c, 0x2e, 0x63, 0x6e, + 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x65, 0x78, 0x70, 0x6c, 0x6f, 0x72, 0x65, 0x72, 0x2e, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x63, 0x6b, 0x73, 0x22, 0x00, 0x12, 0x4b, 0x0a, 0x0c, 0x44, + 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x50, 0x61, 0x63, 0x6b, 0x73, 0x12, 0x21, 0x2e, 0x63, 0x6e, + 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x65, 0x78, 0x70, 0x6c, 0x6f, 0x72, 0x65, 0x72, 0x2e, 0x44, + 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x50, 0x61, 0x63, 0x6b, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x16, 0x2e, 0x63, 0x6e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x65, 0x78, 0x70, 0x6c, 0x6f, 0x72, 0x65, - 0x72, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x41, 0x0a, 0x08, 0x53, 0x65, 0x74, - 0x50, 0x72, 0x6f, 0x70, 0x73, 0x12, 0x1a, 0x2e, 0x63, 0x6e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, - 0x65, 0x78, 0x70, 0x6c, 0x6f, 0x72, 0x65, 0x72, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x73, 0x52, 0x65, - 0x71, 0x1a, 0x17, 0x2e, 0x63, 0x6e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x65, 0x78, 0x70, 0x6c, - 0x6f, 0x72, 0x65, 0x72, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x49, 0x0a, 0x07, - 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x12, 0x1c, 0x2e, 0x63, 0x6e, 0x71, 0x75, 0x65, 0x72, - 0x79, 0x2e, 0x65, 0x78, 0x70, 0x6c, 0x6f, 0x72, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x6c, - 0x76, 0x65, 0x52, 0x65, 0x71, 0x1a, 0x1e, 0x2e, 0x63, 0x6e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, - 0x65, 0x78, 0x70, 0x6c, 0x6f, 0x72, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, - 0x64, 0x50, 0x61, 0x63, 0x6b, 0x22, 0x00, 0x12, 0x4c, 0x0a, 0x0c, 0x53, 0x74, 0x6f, 0x72, 0x65, - 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x12, 0x21, 0x2e, 0x63, 0x6e, 0x71, 0x75, 0x65, 0x72, - 0x79, 0x2e, 0x65, 0x78, 0x70, 0x6c, 0x6f, 0x72, 0x65, 0x72, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, - 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x17, 0x2e, 0x63, 0x6e, 0x71, - 0x75, 0x65, 0x72, 0x79, 0x2e, 0x65, 0x78, 0x70, 0x6c, 0x6f, 0x72, 0x65, 0x72, 0x2e, 0x45, 0x6d, - 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x4c, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x52, 0x65, 0x70, 0x6f, - 0x72, 0x74, 0x12, 0x23, 0x2e, 0x63, 0x6e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x65, 0x78, 0x70, - 0x6c, 0x6f, 0x72, 0x65, 0x72, 0x2e, 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x44, 0x61, 0x74, 0x61, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x63, 0x6e, 0x71, 0x75, 0x65, 0x72, - 0x79, 0x2e, 0x65, 0x78, 0x70, 0x6c, 0x6f, 0x72, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x72, - 0x74, 0x22, 0x00, 0x12, 0x66, 0x0a, 0x11, 0x53, 0x79, 0x6e, 0x63, 0x68, 0x72, 0x6f, 0x6e, 0x69, - 0x7a, 0x65, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x12, 0x26, 0x2e, 0x63, 0x6e, 0x71, 0x75, 0x65, - 0x72, 0x79, 0x2e, 0x65, 0x78, 0x70, 0x6c, 0x6f, 0x72, 0x65, 0x72, 0x2e, 0x53, 0x79, 0x6e, 0x63, - 0x68, 0x72, 0x6f, 0x6e, 0x69, 0x7a, 0x65, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x52, 0x65, 0x71, - 0x1a, 0x27, 0x2e, 0x63, 0x6e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x65, 0x78, 0x70, 0x6c, 0x6f, - 0x72, 0x65, 0x72, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x68, 0x72, 0x6f, 0x6e, 0x69, 0x7a, 0x65, 0x41, - 0x73, 0x73, 0x65, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x22, 0x00, 0x42, 0x24, 0x5a, 0x22, 0x67, - 0x6f, 0x2e, 0x6d, 0x6f, 0x6e, 0x64, 0x6f, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6e, 0x71, - 0x75, 0x65, 0x72, 0x79, 0x2f, 0x76, 0x31, 0x30, 0x2f, 0x65, 0x78, 0x70, 0x6c, 0x6f, 0x72, 0x65, - 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x72, 0x2e, 0x55, 0x52, 0x4c, 0x73, 0x22, 0x00, 0x32, 0xaa, 0x04, 0x0a, 0x0e, 0x51, 0x75, 0x65, + 0x72, 0x79, 0x43, 0x6f, 0x6e, 0x64, 0x75, 0x63, 0x74, 0x6f, 0x72, 0x12, 0x41, 0x0a, 0x06, 0x41, + 0x73, 0x73, 0x69, 0x67, 0x6e, 0x12, 0x1c, 0x2e, 0x63, 0x6e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, + 0x65, 0x78, 0x70, 0x6c, 0x6f, 0x72, 0x65, 0x72, 0x2e, 0x41, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x6d, + 0x65, 0x6e, 0x74, 0x1a, 0x17, 0x2e, 0x63, 0x6e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x65, 0x78, + 0x70, 0x6c, 0x6f, 0x72, 0x65, 0x72, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x43, + 0x0a, 0x08, 0x55, 0x6e, 0x61, 0x73, 0x73, 0x69, 0x67, 0x6e, 0x12, 0x1c, 0x2e, 0x63, 0x6e, 0x71, + 0x75, 0x65, 0x72, 0x79, 0x2e, 0x65, 0x78, 0x70, 0x6c, 0x6f, 0x72, 0x65, 0x72, 0x2e, 0x41, 0x73, + 0x73, 0x69, 0x67, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x1a, 0x17, 0x2e, 0x63, 0x6e, 0x71, 0x75, 0x65, + 0x72, 0x79, 0x2e, 0x65, 0x78, 0x70, 0x6c, 0x6f, 0x72, 0x65, 0x72, 0x2e, 0x45, 0x6d, 0x70, 0x74, + 0x79, 0x22, 0x00, 0x12, 0x41, 0x0a, 0x08, 0x53, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x73, 0x12, + 0x1a, 0x2e, 0x63, 0x6e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x65, 0x78, 0x70, 0x6c, 0x6f, 0x72, + 0x65, 0x72, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x17, 0x2e, 0x63, 0x6e, + 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x65, 0x78, 0x70, 0x6c, 0x6f, 0x72, 0x65, 0x72, 0x2e, 0x45, + 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, 0x49, 0x0a, 0x07, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, + 0x65, 0x12, 0x1c, 0x2e, 0x63, 0x6e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x65, 0x78, 0x70, 0x6c, + 0x6f, 0x72, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x52, 0x65, 0x71, 0x1a, + 0x1e, 0x2e, 0x63, 0x6e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x65, 0x78, 0x70, 0x6c, 0x6f, 0x72, + 0x65, 0x72, 0x2e, 0x52, 0x65, 0x73, 0x6f, 0x6c, 0x76, 0x65, 0x64, 0x50, 0x61, 0x63, 0x6b, 0x22, + 0x00, 0x12, 0x4c, 0x0a, 0x0c, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, + 0x73, 0x12, 0x21, 0x2e, 0x63, 0x6e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x65, 0x78, 0x70, 0x6c, + 0x6f, 0x72, 0x65, 0x72, 0x2e, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, + 0x73, 0x52, 0x65, 0x71, 0x1a, 0x17, 0x2e, 0x63, 0x6e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x65, + 0x78, 0x70, 0x6c, 0x6f, 0x72, 0x65, 0x72, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x00, 0x12, + 0x4c, 0x0a, 0x09, 0x47, 0x65, 0x74, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x23, 0x2e, 0x63, + 0x6e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x65, 0x78, 0x70, 0x6c, 0x6f, 0x72, 0x65, 0x72, 0x2e, + 0x45, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x44, 0x61, 0x74, 0x61, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x18, 0x2e, 0x63, 0x6e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x65, 0x78, 0x70, 0x6c, + 0x6f, 0x72, 0x65, 0x72, 0x2e, 0x52, 0x65, 0x70, 0x6f, 0x72, 0x74, 0x22, 0x00, 0x12, 0x66, 0x0a, + 0x11, 0x53, 0x79, 0x6e, 0x63, 0x68, 0x72, 0x6f, 0x6e, 0x69, 0x7a, 0x65, 0x41, 0x73, 0x73, 0x65, + 0x74, 0x73, 0x12, 0x26, 0x2e, 0x63, 0x6e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2e, 0x65, 0x78, 0x70, + 0x6c, 0x6f, 0x72, 0x65, 0x72, 0x2e, 0x53, 0x79, 0x6e, 0x63, 0x68, 0x72, 0x6f, 0x6e, 0x69, 0x7a, + 0x65, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x52, 0x65, 0x71, 0x1a, 0x27, 0x2e, 0x63, 0x6e, 0x71, + 0x75, 0x65, 0x72, 0x79, 0x2e, 0x65, 0x78, 0x70, 0x6c, 0x6f, 0x72, 0x65, 0x72, 0x2e, 0x53, 0x79, + 0x6e, 0x63, 0x68, 0x72, 0x6f, 0x6e, 0x69, 0x7a, 0x65, 0x41, 0x73, 0x73, 0x65, 0x74, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x22, 0x00, 0x42, 0x24, 0x5a, 0x22, 0x67, 0x6f, 0x2e, 0x6d, 0x6f, 0x6e, 0x64, + 0x6f, 0x6f, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6e, 0x71, 0x75, 0x65, 0x72, 0x79, 0x2f, 0x76, + 0x31, 0x30, 0x2f, 0x65, 0x78, 0x70, 0x6c, 0x6f, 0x72, 0x65, 0x72, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, } var ( diff --git a/explorer/cnquery_explorer.proto b/explorer/cnquery_explorer.proto index 541af5992a..0b966bafd1 100644 --- a/explorer/cnquery_explorer.proto +++ b/explorer/cnquery_explorer.proto @@ -179,6 +179,18 @@ enum ScoringSystem { AVERAGE = 3; DATA_ONLY = 4; IGNORE_SCORE = 5; + // Experimental: BANDED scoring mechanism which creates a score based on + // the 4 categories of criticality (critical, high, medium, low) and + // positions scores so that: + // 1. Any critical/high issues won't generate a high score (upper limit) + // 2. Lower scoring categories can have an impact on the score + // (e.g. 1 crit + 200 medium failures will be lower than 1 crit only) + // 3. A large collection of medium findings won't generate a critical score + BANDED = 6; + // Experimental: DECAYED scoring uses a scaled decay function to estimate a + // score value. This means that a few critical findings will quickly reduce + // the resulting score, but it won't just drop it to the lowest value. + DECAYED = 7; } // Impact explains how important certain queries are. They are especially useful diff --git a/explorer/impact.go b/explorer/impact.go index 09ee99c75a..0aa7ac7115 100644 --- a/explorer/impact.go +++ b/explorer/impact.go @@ -125,6 +125,10 @@ func (s *ScoringSystem) UnmarshalJSON(data []byte) error { *s = ScoringSystem_WEIGHTED case "average", "": *s = ScoringSystem_AVERAGE + case "banded": + *s = ScoringSystem_BANDED + case "decayed": + *s = ScoringSystem_DECAYED default: return errors.New("unknown scoring system: " + string(data)) } @@ -149,6 +153,10 @@ func (s *ScoringSystem) UnmarshalYAML(node *yaml.Node) error { *s = ScoringSystem_WEIGHTED case "average", "": *s = ScoringSystem_AVERAGE + case "banded": + *s = ScoringSystem_BANDED + case "decayed": + *s = ScoringSystem_DECAYED default: return errors.New("unknown scoring system: " + string(name)) } @@ -164,6 +172,10 @@ func (s *ScoringSystem) MarshalYAML() (interface{}, error) { return "weighted", nil case ScoringSystem_AVERAGE: return "average", nil + case ScoringSystem_BANDED: + return "banded", nil + case ScoringSystem_DECAYED: + return "decayed", nil default: return *s, nil }