forked from devsecopsmaturitymodel/DevSecOps-MaturityModel
-
Notifications
You must be signed in to change notification settings - Fork 0
/
report-samm.php
65 lines (59 loc) · 2.35 KB
/
report-samm.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?php
include_once "head.php";
?>
<body>
<?php
include_once "navi.php";
?>
<?php
include_once "data.php";
include_once "detail.php";
$mappingExists = array();
$noMappingExists = array();
foreach ($dimensions as $dimension => $subdimensions) {
echo "<h1>Dimension $dimension</h1>";
foreach ($subdimensions as $subdimension => $element) {
$mappingExists[$subdimension] = array();
$noMappingExists[$subdimension] = array();
echo "<h2>Sub-Dimension $subdimension</h2>";
echo "<h3 style='color:green;'>With SAMM2 Mapping</h3>";
for ($i = 1; $i <= 4; $i++) {
$tableContent .= "<td><ul>";
foreach ($element as $elementName => $content) {
if(array_key_exists("samm2", $content) && !preg_match("/TODO/i", $content["samm2"])) {
$content2 = getContentForLevelFromSubdimensions($i, $content, $elementName);
if ($content2 != "") {
printDetail($dimension, $subdimension, $elementName, $dimensions, true);
$mappingExists[$subdimension][$content["samm2"]][$elementName] = $content;
}
}
}
}
echo "<h3 style='color:red;'>Without SAMM2 Mapping</h3>";
for ($i = 1; $i <= 4; $i++) {
$tableContent .= "<td><ul>";
foreach ($element as $elementName => $content) {
if(!array_key_exists("samm2", $content) || preg_match("/TODO/i", $content["samm2"])) {
$content2 = getContentForLevelFromSubdimensions($i, $content, $elementName);
if ($content2 != "") {
printDetail($dimension, $subdimension, $elementName, $dimensions, true);
$content["name"] = $elementName;
$noMappingExists[$subdimension][$content["samm2"]][$elementName] = $content;
}
}
}
}
}
}
foreach ($mappingExists as $dimension => $category) {
//var_dump($mappingExists);
echo "<h1>".$dimension ."</h1>";
foreach($category as $category => $content) {
//var_dump($content);exit;
echo $category . " ".count($content) . " ";
foreach($content as $elementName => $content2){
echo "$elementName" . " /"; }
echo "<br>";
}
}
//var_dump($noMappingExists);