Skip to content

Commit c6edc28

Browse files
Steve SalasSteve Salas
authored andcommitted
Merge branch 'dev/surface'
2 parents a54e8de + 444f6f0 commit c6edc28

File tree

93 files changed

+2128
-502
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+2128
-502
lines changed

appveyor.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
version: 2.5.{build}
1+
version: 2.6.{build}
22
image: Visual Studio 2017
33
clone_folder: C:\CodePulse
44
build_script:
5-
- cmd: powershell -file C:\CodePulse\installers\build.ps1 -version 2.5.0 -versionForDotNetTracerWindowsDownloadUrl 2.5.0 -useGitHubDotNetTracerWindowsDownloadUrl
5+
# - cmd: powershell -file C:\CodePulse\installers\build.ps1 -version %APPVEYOR_BUILD_VERSION% -versionForDotNetTracerWindowsDownloadUrl %APPVEYOR_JOB_ID%
6+
- cmd: powershell -file C:\CodePulse\installers\build.ps1 -version %APPVEYOR_BUILD_VERSION% -versionForDotNetTracerWindowsDownloadUrl %APPVEYOR_JOB_ID% -skipMac -skipLinux # skips building packages for macOS and Linux
67
before_test:
78
- cmd: >-
89
C:\Windows\System32\regsvr32.exe C:\CodePulse\dotnet-tracer\main\bin\Release\x64\OpenCover.Profiler.dll /s
@@ -30,11 +31,11 @@ after_test:
3031
3132
$wc.UploadFile("https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)", "C:\CodePulse\OpenCover.Test.Profiler.x64.xml")
3233
artifacts:
33-
- path: installers\CodePulse-2.5.0-Linux-x64.zip
34-
name: Code Pulse Linux
35-
- path: installers\CodePulse-2.5.0-macOS-x64.zip
36-
name: Code Pulse Mac
37-
- path: installers\CodePulse-2.5.0-Windows-x64.zip
34+
#- path: installers\CodePulse-$(APPVEYOR_BUILD_VERSION)-Linux-x64.zip # Uncomment when not using -skipLinux switch
35+
# name: Code Pulse Linux #
36+
#- path: installers\CodePulse-$(APPVEYOR_BUILD_VERSION)-macOS-x64.zip # Uncomment when not using -skipMac switch
37+
# name: Code Pulse Mac #
38+
- path: installers\CodePulse-$(APPVEYOR_BUILD_VERSION)-Windows-x64.zip
3839
name: Code Pulse Windows
39-
- path: installers\CodePulse-DotNetTracer-2.5.0-Windows.zip
40+
- path: installers\CodePulse-DotNetTracer-$(APPVEYOR_BUILD_VERSION)-Windows.zip
4041
name: Code Pulse .NET Tracer

build.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,5 +191,5 @@ lazy val CodePulse = Project("CodePulse", file("codepulse"))
191191
Dependencies.concLinkedHashMap, Dependencies.juniversalchardet, Dependencies.dependencyCheckCore,
192192
Dependencies.slick, Dependencies.h2,
193193
Dependencies.javaparser
194-
) ++ Dependencies.asm ++ Dependencies.jackson ++ Dependencies.jna ++ Dependencies.logging
194+
) ++ Dependencies.asm ++ Dependencies.jackson ++ Dependencies.jna ++ Dependencies.astamCorrelator
195195
)

codepulse/src/main/resources/toserve/common/common.css

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ html, body {height: 100%; }
1010
body, td, textarea, input { font-family: tahoma, georgia, sans-serif; font-size: 1em; }
1111

1212
body, td {
13-
background: #eee;
13+
background: #ffffff;
1414
color: #333;
1515
margin: 0px;
1616
}
@@ -106,8 +106,8 @@ svg {
106106
opacity: 0.2;
107107
}
108108

109-
.btn-primary, .btn-primary:focus { background: #3a87ad; color: #eee; }
110-
.btn-primary:hover:not(.disabled) { background: #4299C3; }
109+
.btn-primary, .btn-primary:focus { background: #0CA1E4; color: #eee; }
110+
.btn-primary:hover:not(.disabled) { background: #35B6F1; }
111111

112112
.btn-danger, .btn-danger:focus { background: #bd362f; color: #eee; }
113113
.btn-danger:hover:not(.disabled) { background: #F34739; }
@@ -400,14 +400,14 @@ a.to-login:hover { border-bottom-style: solid; }
400400
\************************/
401401
.controls-menu {
402402
box-sizing: border-box;
403-
background: #C7C7C7;
403+
background: #B1AFAF;
404404
padding-left: 20px;
405405
}
406406

407407
.controls-menu .menu-button {
408408
font-size: 14px;
409-
color: steelblue;
410-
background: #C7C7C7;
409+
color: #484848;
410+
background: #B1AFAF;
411411
vertical-align: top;
412412
cursor: pointer;
413413
padding: 0 4px;

codepulse/src/main/resources/toserve/common/desktop.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@
4949
}
5050

5151
.header-push {
52-
height: 60px;
53-
min-height: 60px;
52+
height: 80px;
53+
min-height: 80px;
5454
}
5555

5656
#refresh-link {

codepulse/src/main/resources/toserve/pages/ProjectInputForm/ProjectInputForm.css

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@
5656
\***********/
5757

5858
#project-input-form ul.form-tabs-list {
59-
list-style: none;
60-
margin: 0 0 20px 0;
61-
border-bottom: 2px solid steelblue;
59+
list-style: none;
60+
margin: 0 0 20px 0;
61+
border-bottom: 2px solid #0CA1E4;
6262
}
6363

6464
#project-input-form .form-tab {
@@ -77,7 +77,7 @@
7777
}
7878

7979
#project-input-form .form-tab.active {
80-
background-color: steelblue;
80+
background-color: #0CA1E4;
8181
}
8282

8383
#project-input-form .form-tab.active a {
@@ -89,7 +89,7 @@
8989
\***************/
9090

9191
#project-input-form .feedback-area .feedback {
92-
color: steelblue;
92+
color: #0CA1E4;
9393
}
9494
#project-input-form .feedback-area .feedback:before {
9595
font-family: FontAwesome;

codepulse/src/main/resources/toserve/pages/ProjectSwitcher/ProjectSwitcher.css

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,18 +57,18 @@
5757
[data-toggle=ProjectSwitcher] {
5858
height: 100%;
5959
padding: 0 20px;
60-
background-color: #055;
60+
background-color: #0CA1E4;
6161
font-size: 1.2em;
6262
cursor: pointer;
6363
}
6464
[data-toggle=ProjectSwitcher]:hover {
65-
background-color: #066;
65+
background-color: #35B6F1;
6666
}
6767
[data-toggle=ProjectSwitcher].active {
68-
background-color: #FFA500;
68+
background-color: #036FA0;
6969
}
7070
[data-toggle=ProjectSwitcher].active:hover {
71-
background-color: #FFBA00;
71+
background-color: #35B6F1;
7272
}
7373

7474
/********************\

codepulse/src/main/resources/toserve/pages/projects/API.js

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,14 @@
215215
postCommand('/rename', {'name': newName}, callback)
216216
},
217217

218+
'addToSurface': function(nodeId, callback){
219+
postCommand('/addToSurface', {'nodeId': nodeId}, callback);
220+
},
221+
222+
'removeFromSurface': function(nodeId, callback){
223+
postCommand('/removeFromSurface', {'nodeId': nodeId}, callback);
224+
},
225+
218226
'getDependencyCheckStatus': function(callback) {
219227
$.getJSON(commandPath('/dcstatus'), callback)
220228
},
@@ -237,7 +245,15 @@
237245

238246
'getNodeSourceLocations': function(id, activityRequestParams, callback) {
239247
getCommand('/node/' + id + "/source-locations", activityRequestParams, callback)
240-
}
248+
},
249+
250+
'getAttackSurface': function(callback) {
251+
$.getJSON(commandPath('/attack-surface'), callback)
252+
},
253+
254+
'getSurfaceDetectionStatus': function(callback) {
255+
$.getJSON(commandPath('/sdstatus'), callback)
256+
}
241257
}
242258

243259
})(this);

codepulse/src/main/resources/toserve/pages/projects/DependencyCheck.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,11 @@
117117

118118
updateStream.onValue(function(update) {
119119
if (update.project == CodePulse.projectPageId) {
120-
statusBus.push(update.summary)
121-
vulnerableNodesBus.push(update.vulnerableNodes)
120+
statusBus.push(update.dependencycheck_update)
121+
122+
if (update.dependencycheck_update.vulnerableNodes) {
123+
vulnerableNodesBus.push(update.dependencycheck_update.vulnerableNodes)
124+
}
122125
}
123126
})
124127
}

codepulse/src/main/resources/toserve/pages/projects/PackageController.js

Lines changed: 58 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
}
6767
}
6868

69-
function PackageController(treeData, depCheckController, $container, $totalsContainer, $clearSelectionButton){
69+
function PackageController(treeData, depCheckController, surfaceDetectorController, $container, $totalsContainer, $clearSelectionButton){
7070

7171
// build this into a Map[packageId -> packageWidget.selectedProp]
7272
var selectedWidgetsSP = new SetProp(
@@ -136,6 +136,7 @@
136136
var pw = new PackageWidget()
137137
widgets[node.id] = pw
138138
pw.associatedNode = node
139+
139140
// pw.parentNode = packageParentNode
140141
widgetCount++
141142

@@ -342,6 +343,7 @@
342343
var w = widgets[k]
343344
if(w.selectable()) w.selected(false)
344345
}
346+
surfaceDetectorController.cancelShowSurface()
345347
})
346348

347349
/**
@@ -370,6 +372,61 @@
370372
applyMethodCoverage(treeData, widgets, coverageRecords, activeRecordings, nodePackageParents)
371373
}
372374

375+
this.selectWidgetsForNodes = function(nodes){
376+
nodes.forEach(n => {
377+
function selectNodeAncestors(id, leaf) {
378+
if(widgets[id]) {
379+
if(leaf) {
380+
widgets[id].selected(true)
381+
} else {
382+
widgets[id].selected(undefined)
383+
}
384+
}
385+
386+
let node = nodePackageParents[id]
387+
if(node && widgets[node.id]) {
388+
widgets[node.id].selected(undefined)
389+
}
390+
391+
if(node && node.parent) {
392+
selectNodeAncestors(node.parent.id, false)
393+
}
394+
}
395+
396+
selectNodeAncestors(n, true)
397+
})
398+
}
399+
400+
this.unselectAll = function(){
401+
forEachWidget(function(pw, node, id){
402+
pw.selected(false)
403+
})
404+
}
405+
406+
this.isSurfaceOn = function(isSurfaceOn){
407+
forEachWidget(function(pw, node, id){
408+
let selected = pw.selected() == true
409+
pw.selectable(selected || !isSurfaceOn)
410+
pw.isSurfaceOn(isSurfaceOn)
411+
})
412+
}
413+
414+
this.enabled = function(enabled){
415+
forEachWidget(function(pw, node, id) {
416+
pw.enabled(enabled)
417+
})
418+
}
419+
420+
this.widgetsSelected = function(){
421+
let nodeIds = []
422+
forEachWidget(function(pw, node, id) {
423+
if(pw.selected()) {
424+
nodeIds.push(id)
425+
}
426+
})
427+
428+
return nodeIds
429+
}
373430
}
374431

375432
// Trigger a `flashHighlight` on the appropriate package widgets

0 commit comments

Comments
 (0)