Skip to content

Commit 17006d0

Browse files
committed
make codenarc happ[y|ier]
1 parent 3e31272 commit 17006d0

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

src/org/ods/services/BitbucketService.groovy

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ class BitbucketService {
176176
"locked": false,
177177
"reviewers": [${reviewers ? reviewers.collect { "{\"user\": { \"name\": \"${it}\" }}" }.join(',') : ''}]
178178
}"""
179-
return withTokenCredentials { _, token ->
179+
return withTokenCredentials { username, token ->
180180
def url = "${bitbucketUrl}/rest/api/1.0/projects/${project}/repos/${repo}/pull-requests"
181181
return this.httpRequestService.asString(
182182
HttpRequestService.HTTP_METHOD_POST,
@@ -327,7 +327,8 @@ class BitbucketService {
327327
payload += "]" +
328328
"}"
329329
try {
330-
def url = "${bitbucketUrl}/rest/insights/1.0/projects/${project}/repos/${repo}/commits/${gitCommit}/reports/${data.key}"
330+
def url = "${bitbucketUrl}" +
331+
"/rest/insights/1.0/projects/${project}/repos/${repo}/commits/${gitCommit}/reports/${data.key}"
331332
this.httpRequestService.asString(
332333
HttpRequestService.HTTP_METHOD_PUT,
333334
HttpRequestService.AUTHORIZATION_SCHEME_BEARER,
@@ -429,11 +430,11 @@ class BitbucketService {
429430
}
430431

431432
String getToken() {
432-
withTokenCredentials { username, token -> return token}
433+
withTokenCredentials { username, token -> return token }
433434
}
434435

435436
@NonCPS
436-
Map getCommitsForIntegrationBranch(String token, String repo, int limit, int nextPageStart){
437+
Map getCommitsForIntegrationBranch(String token, String repo, int limit, int nextPageStart) {
437438
String request = "${bitbucketUrl}/rest/api/1.0/projects/${project}/repos/${repo}/commits"
438439
return queryRepo(token, request, limit, nextPageStart)
439440
}
@@ -449,10 +450,10 @@ class BitbucketService {
449450
private Map queryRepo(String token, String request, int limit, int nextPageStart) {
450451
Map<String, String> headers = buildHeaders(token)
451452
def httpRequest = Unirest.get(request).headers(headers)
452-
if (limit>0) {
453+
if (limit > 0) {
453454
httpRequest.queryString("limit", limit)
454455
}
455-
if (nextPageStart>0) {
456+
if (nextPageStart > 0) {
456457
httpRequest.queryString("start", nextPageStart)
457458
}
458459
def response = httpRequest.asString()

src/org/ods/services/HttpRequestService.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ class HttpRequestService {
2020
HttpRequestService(def script, ILogger logger) {
2121
this.script = script
2222
this.logger = logger
23-
2423
}
2524

2625
@NonCPS
@@ -51,4 +50,5 @@ class HttpRequestService {
5150
}
5251
return response.body
5352
}
53+
5454
}

vars/odsComponentStageCopyImage.groovy

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ def call(IContext context, Map config = [:]) {
1919

2020
// [REGISTRY/]REPO/IMAGE[:TAG]
2121
if (sourceImageDataSplitLength >= 2) {
22-
config.image = sourceImageData[sourceImageDataSplitLength-1]
23-
config.repo = sourceImageData[sourceImageDataSplitLength-2]
22+
config.image = sourceImageData[sourceImageDataSplitLength - 1]
23+
config.repo = sourceImageData[sourceImageDataSplitLength - 2]
2424
// no registry info, use internal cluster registry
2525
if (sourceImageDataSplitLength == 2) {
2626
config.registry = context.clusterRegistryAddress
2727
} else {
28-
config.registry = sourceImageData[0..sourceImageDataSplitLength-3].join('/')
28+
config.registry = sourceImageData[0..sourceImageDataSplitLength - 3].join('/')
2929
}
3030
config.registry = STR_DOCKER_PROTOCOL + config.registry
3131
} else {
@@ -54,6 +54,5 @@ def call(IContext context, Map config = [:]) {
5454
def buildResourceName = "imported-${imageName}"
5555
odsComponentStageScanWithAqua(context,
5656
[resourceName: "${buildResourceName}", imageLabels: context.extensionImageLabels])
57-
5857
}
5958
return this

0 commit comments

Comments
 (0)