This is the codeAbility Sharing Platform! Learn more about the codeAbility Sharing Platform.

Skip to content
Snippets Groups Projects
Commit 687df257 authored by Philipp Gritsch's avatar Philipp Gritsch
Browse files

address sonar bugs

parent 289c0ee4
Branches
2 merge requests!274Development,!272address sonar bugs
......@@ -60,7 +60,7 @@ import org.springframework.web.util.UriComponentsBuilder;
@Service
@Validated
@SuppressWarnings({ "PMD.AvoidDuplicateLiterals", "PMD.TooManyMethods" })
@SuppressWarnings({ "PMD.AvoidDuplicateLiterals", "PMD.TooManyMethods", "PMD.CyclomaticComplexity" })
public class EduSharingService {
private static final String DEFAULT_VERSION = "1.4";
......@@ -365,7 +365,7 @@ public class EduSharingService {
return dto;
}
@SuppressWarnings({ "PMD.AvoidCatchingGenericException", "PMD.PreserveStackTrace" })
@SuppressWarnings({ "PMD.AvoidCatchingGenericException", "PMD.PreserveStackTrace", "PMD.ConfusingTernary" })
private void deleteNodeSilently(@NotNull String nodeId) {
try {
final var uri = UriComponentsBuilder
......@@ -378,8 +378,8 @@ public class EduSharingService {
ResponseEntity<String> response = answer.toEntity(String.class).block();
if (response == null || !response.getStatusCode().is2xxSuccessful()) {
LOGGER.error("DELETE request to " + uri + " failed!");
LOGGER.error(response.getBody());
String responseText = response != null ? response.getBody() : "Null response";
LOGGER.error("DELETE request to " + uri + " failed! Response: " + responseText);
}
} catch (final Exception e) {
LOGGER.error("Error on deleteNode for resource " + nodeId, e);
......@@ -566,6 +566,7 @@ public class EduSharingService {
.block();
}
@SuppressWarnings("PMD.ConfusingTernary")
private void addOrUpdatePermissionsToCuratorGroup(@NotNull final String nodeId) throws JsonProcessingException {
final GetPermissionAnswerDTO currentPermissions = getCurrentPermissionsForNode(nodeId);
LocalPermissionDTO localPermissions = currentPermissions.getLocalPermissions();
......@@ -590,8 +591,8 @@ public class EduSharingService {
ResponseEntity<String> response = answer.toEntity(String.class).block();
if (response == null || !response.getStatusCode().is2xxSuccessful()) {
LOGGER.error("POST request to " + uri + " failed!");
LOGGER.error(response.getBody());
String responseText = response != null ? response.getBody() : "Null response";
LOGGER.error("POST request to " + uri + " failed! Response: " + responseText);
}
}
......
......@@ -362,7 +362,7 @@
</h6>
<span *ngIf="eduSharingStatus?.publishedCopies?.length == 0">
<i>{{ 'exercise.export.edu-sharing.publishedProjects.noEntries' | translate }}</i>
<em>{{ 'exercise.export.edu-sharing.publishedProjects.noEntries' | translate }}</em>
</span>
<table
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment