Commit 97738e5f authored by Vincent Massol's avatar Vincent Massol
Browse files

[Misc] Remove code smell from Sonarqube

parent e2caeb97
......@@ -191,7 +191,7 @@ public void execute() throws MojoExecutionException, MojoFailureException
}
// Verification 11: Verify that Translations documents don't use GLOBAL or USER visibility
if (!translationVisibilitySkip && xdoc.containsTranslations()) {
if (!this.translationVisibilitySkip && xdoc.containsTranslations()) {
for (String visibility : xdoc.getTranslationVisibilities()) {
if (visibility.equals("USER") || visibility.equals("GLOBAL")) {
errors.add(String.format("[%s] ([%s]) page contains a translation using a wrong visibility "
......@@ -217,12 +217,12 @@ public void execute() throws MojoExecutionException, MojoFailureException
verifyAttachmentMimetypes(errors, xdoc.getAttachmentData());
// Verification 15: Verify that date fields are not set.
if (!skipDates) {
if (!this.skipDates) {
verifyDateFields(errors, xdoc);
}
// Verification 16: Verify that author fields are not set.
if (!skipAuthors) {
if (!this.skipAuthors) {
verifyAuthorFields(errors, xdoc);
}
......@@ -274,7 +274,7 @@ private String getTitlePatternRuleforPage(String documentReference)
private void verifyDateFields(List<String> errors, XWikiDocument xdoc)
{
if (!skipDatesDocumentList.contains(xdoc.getReference())) {
if (!this.skipDatesDocumentList.contains(xdoc.getReference())) {
if (xdoc.isDatePresent()) {
errors.add("'date' field is present");
}
......@@ -295,10 +295,8 @@ private void verifyDateFields(List<String> errors, XWikiDocument xdoc)
private void verifyAuthorFields(List<String> errors, XWikiDocument xdoc)
{
if (!skipAuthorsDocumentList.contains(xdoc.getReference())) {
if (xdoc.isOriginalMetadataAuthorPresent()) {
errors.add("'originalMetadataAuthor' field is present");
}
if (!this.skipAuthorsDocumentList.contains(xdoc.getReference()) && xdoc.isOriginalMetadataAuthorPresent()) {
errors.add("'originalMetadataAuthor' field is present");
}
}
......@@ -337,5 +335,4 @@ private boolean isTitlesMatching(String documentReference, String title)
}
return true;
}
}
Supports Markdown
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