Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion CheckmarxOneAVITClosureIntegration.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,8 @@ CheckmarxOneAVITClosureIntegration.prototype = Object.extendsObject(sn_vul.Appli
_getLatestScanFromPrimaryBranch: function(closureDeltaStartTime) {
var results = [];
var appIds = this._getUniqueProjectIds(closureDeltaStartTime);
var config = this.UTIL._getConfig(this.INTEGRATION_ID);
var fallback_when_primary_branch_not_defined = config.fallback_when_primary_branch_not_defined;

for (var i = 0; i < appIds.length; i++) {
var appId = appIds[i];
Expand All @@ -225,7 +227,7 @@ CheckmarxOneAVITClosureIntegration.prototype = Object.extendsObject(sn_vul.Appli
break;
}
}
if (!matched) {
if (!matched && fallback_when_primary_branch_not_defined) {
gr.setLimit(1);
if (gr.next()) {
var fallbackObj = this._buildScanObject(gr);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ CheckmarxOneConfigUtilBase.prototype = {
"scan_synchronization": gr.getValue("scan_synchronization"),
"access_token": gr.access_token.getDecryptedValue(),
"sync_only_primary_branch": gr.getValue("sync_only_primary_branch") === "1",
"fallback_when_primary_branch_not_defined": gr.getValue("fallback_when_primary_branch_not_defined") === "1",
"list_projects": gr.getValue("list_of_project_id_s"),
"result_states": gr.getValue("result_states"),
"link": gr.getValue("link"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ CheckmarxOneScanSummaryIntegration.prototype = Object.extendsObject(sn_vul.Appli
var includeScoreCard = this.UTIL.importScoreCardFlaw(this.IMPLEMENTATION);
var config = this.UTIL._getConfig(this.IMPLEMENTATION);
var scan_synchronization = config.scan_synchronization.toString();
var fallback_when_primary_branch_not_defined = config.fallback_when_primary_branch_not_defined;
var primaryBranch = '';
var jsonLastScanSummResp = '';
var branches;
Expand All @@ -73,8 +74,9 @@ CheckmarxOneScanSummaryIntegration.prototype = Object.extendsObject(sn_vul.Appli
if (null != primaryBranch && '' != primaryBranch) {
jsonLastScanSummResp = this.UTIL.getScanListFilterByBranch(this.IMPLEMENTATION, appId, this._getCurrentDeltaStartTime(), primaryBranch);
branches = this.UTIL.getProjectBranchList(this.IMPLEMENTATION, appId);
} else
} else if (fallback_when_primary_branch_not_defined) {
jsonLastScanSummResp = this.UTIL.getScanInfo(this.IMPLEMENTATION, appId, newoffset, this._getCurrentDeltaStartTime());
}
} else if (scan_synchronization == 'latest scan from each branch') {
branches = this.UTIL.getProjectBranchList(this.IMPLEMENTATION, appId);
if (null != branches && '' != branches) {
Expand Down Expand Up @@ -466,4 +468,4 @@ CheckmarxOneScanSummaryIntegration.prototype = Object.extendsObject(sn_vul.Appli
},

type: 'CheckmarxOneScanSummaryIntegration'
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -1399,6 +1399,7 @@ CheckmarxOneUtilBase.prototype = {
"vulnerability_threshold_level": gr.getValue("vulnerability_threshold_level"),
"scan_synchronization": gr.getValue("scan_synchronization"),
"sync_only_primary_branch": gr.getValue("sync_only_primary_branch") === "1",
"fallback_when_primary_branch_not_defined": gr.getValue("fallback_when_primary_branch_not_defined") === "1",
"list_projects": gr.getValue("list_of_project_id_s"),
"result_states": gr.getValue("result_states"),
"project_filter_by_name": gr.getValue("project_filter_by_name"),
Expand Down
Loading