forked from devsecopsmaturitymodel/DevSecOps-MaturityModel
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreport-samm.php
More file actions
77 lines (66 loc) · 2.18 KB
/
report-samm.php
File metadata and controls
77 lines (66 loc) · 2.18 KB
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
66
67
68
69
70
71
72
73
74
75
76
77
<?php
/**
* report-samm.php
*
* @package default
*/
include_once "head.php";
?>
<body>
<?php
include_once "navi.php";
?>
<?php
include_once "data.php";
include_once "detail.php";
$mappingExists = array();
$noMappingExists = array();
$old_dimension = null;
foreach (getActions($dimensions) as list($dimension, $subdimensions, $element)) {
if ($dimension != $old_dimension) {
echo "<h1>Dimension $dimension</h1>";
$old_dimension = $dimension;
}
$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 $activityName => $content) {
if (array_key_exists("samm2", $content) && !preg_match("/TODO/i", $content["samm2"])) {
$content2 = getContentForLevelFromSubdimensions($i, $content, $activityName);
if ($content2 != "") {
printDetail($dimension, $subdimension, $activityName, $dimensions, true);
$mappingExists[$subdimension][$content["samm2"]][$activityName] = $content;
}
}
}
}
echo "<h3 style='color:red;'>Without SAMM2 Mapping</h3>";
for ($i = 1; $i <= 4; $i++) {
$tableContent .= "<td><ul>";
foreach ($element as $activityName => $content) {
if (!array_key_exists("samm2", $content) || preg_match("/TODO/i", $content["samm2"])) {
$content2 = getContentForLevelFromSubdimensions($i, $content, $activityName);
if ($content2 != "") {
printDetail($dimension, $subdimension, $activityName, $dimensions, true);
$content["name"] = $activityName;
$noMappingExists[$subdimension][$content["samm2"]][$activityName] = $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 $activityName => $content2) {
echo "$activityName" . " /"; }
echo "<br>";
}
}
//var_dump($noMappingExists);