Skip to content

Commit

Permalink
feat(classification): backport Ruby and C# test cases and KPIs (#101)
Browse files Browse the repository at this point in the history
* feat: add testhelper for KPI tests and snapshots

feat: add ruby test case

* feat: skip detections with blank object name

* feat: include all lang types in CSV to JSON script

* fix: check for DB identifiers when dealing with unknown object

* feat: prefer map for properties

* chore: neaten up testhelper

* refactor: separate test files

* fix: ruby reputation classification state
  • Loading branch information
elsapet committed Nov 16, 2022
1 parent 8be0e07 commit 0ab09c1
Show file tree
Hide file tree
Showing 29 changed files with 80,817 additions and 3 deletions.
15,995 changes: 15,995 additions & 0 deletions pkg/classification/schema/.snapshots/TestCSharp

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions pkg/classification/schema/.snapshots/TestCSharpKPI
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
(testhelper.KPI) {
DetectionsCount: (int) 3346,
ValidDetectionsCount: (int) 381,
ValidObjectDetectionsCount: (int) 58,
ValidFieldDetectionsCount: (int) 323,
ExpectedValidDetectionsCount: (int) 381,
ExpectedValidObjectDetectionsCount: (int) 58,
ExpectedValidFieldDetectionsCount: (int) 323,
ExpectedTruePositivesCount: (int) 379,
ExpectedFalsePositivesCount: (int) 2
}
2,843 changes: 2,843 additions & 0 deletions pkg/classification/schema/.snapshots/TestGo

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions pkg/classification/schema/.snapshots/TestGoKPI
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
(testhelper.KPI) {
DetectionsCount: (int) 452,
ValidDetectionsCount: (int) 117,
ValidObjectDetectionsCount: (int) 31,
ValidFieldDetectionsCount: (int) 86,
ExpectedValidDetectionsCount: (int) 125,
ExpectedValidObjectDetectionsCount: (int) 36,
ExpectedValidFieldDetectionsCount: (int) 89,
ExpectedTruePositivesCount: (int) 125,
ExpectedFalsePositivesCount: (int) 0
}
3,121 changes: 3,121 additions & 0 deletions pkg/classification/schema/.snapshots/TestJava

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions pkg/classification/schema/.snapshots/TestJavaKPI
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
(testhelper.KPI) {
DetectionsCount: (int) 6230,
ValidDetectionsCount: (int) 135,
ValidObjectDetectionsCount: (int) 37,
ValidFieldDetectionsCount: (int) 98,
ExpectedValidDetectionsCount: (int) 137,
ExpectedValidObjectDetectionsCount: (int) 37,
ExpectedValidFieldDetectionsCount: (int) 100,
ExpectedTruePositivesCount: (int) 136,
ExpectedFalsePositivesCount: (int) 1
}
1,968 changes: 1,968 additions & 0 deletions pkg/classification/schema/.snapshots/TestJavascript

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions pkg/classification/schema/.snapshots/TestJavascriptKPI
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
(testhelper.KPI) {
DetectionsCount: (int) 445,
ValidDetectionsCount: (int) 127,
ValidObjectDetectionsCount: (int) 39,
ValidFieldDetectionsCount: (int) 88,
ExpectedValidDetectionsCount: (int) 135,
ExpectedValidObjectDetectionsCount: (int) 46,
ExpectedValidFieldDetectionsCount: (int) 89,
ExpectedTruePositivesCount: (int) 135,
ExpectedFalsePositivesCount: (int) 0
}
2,450 changes: 2,450 additions & 0 deletions pkg/classification/schema/.snapshots/TestPHP

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions pkg/classification/schema/.snapshots/TestPHPKPI
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
(testhelper.KPI) {
DetectionsCount: (int) 353,
ValidDetectionsCount: (int) 129,
ValidObjectDetectionsCount: (int) 30,
ValidFieldDetectionsCount: (int) 99,
ExpectedValidDetectionsCount: (int) 143,
ExpectedValidObjectDetectionsCount: (int) 33,
ExpectedValidFieldDetectionsCount: (int) 110,
ExpectedTruePositivesCount: (int) 143,
ExpectedFalsePositivesCount: (int) 0
}
1,665 changes: 1,665 additions & 0 deletions pkg/classification/schema/.snapshots/TestPython

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions pkg/classification/schema/.snapshots/TestPythonKPI
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
(testhelper.KPI) {
DetectionsCount: (int) 220,
ValidDetectionsCount: (int) 115,
ValidObjectDetectionsCount: (int) 21,
ValidFieldDetectionsCount: (int) 94,
ExpectedValidDetectionsCount: (int) 121,
ExpectedValidObjectDetectionsCount: (int) 24,
ExpectedValidFieldDetectionsCount: (int) 97,
ExpectedTruePositivesCount: (int) 121,
ExpectedFalsePositivesCount: (int) 0
}
Loading

0 comments on commit 0ab09c1

Please sign in to comment.