Skip to content

Commit

Permalink
[NO-JIRA] Remove generic code smells
Browse files Browse the repository at this point in the history
  • Loading branch information
matteo-mara-sonarsource authored and sonartech committed Mar 30, 2023
1 parent 6d724b5 commit b0076e1
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,8 @@ public static List<PropertyDefinition> definitions() {
.build(),
PropertyDefinition.builder(GROUP_NAME_ATTRIBUTE)
.name("SAML group attribute")
.description("Attribute defining the user groups in SAML, used to synchronize group memberships. If you leave this field empty, group memberships are managed locally by SonarQube administrators.")
.description("Attribute defining the user groups in SAML, used to synchronize group memberships. If you leave this field empty, " +
"group memberships are managed locally by SonarQube administrators.")
.category(CATEGORY)
.subCategory(SUBCATEGORY)
.index(10)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
import org.sonar.api.issue.Issue;
import org.sonar.api.resources.Qualifiers;
import org.sonar.api.rule.Severity;
import org.sonar.api.rules.RuleType;
import org.sonar.api.utils.DateUtils;
import org.sonar.core.util.UuidFactoryFast;
import org.sonar.core.util.Uuids;
import org.sonar.db.component.ComponentDto;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public ProtobufSystemInfo.Section toProtobuf() {
return protobuf.build();
}

private void includeSetting(Builder protobuf, PropertyDefinitions definitions, Entry<String, String> prop) {
private static void includeSetting(Builder protobuf, PropertyDefinitions definitions, Entry<String, String> prop) {
String key = prop.getKey();
String value = obfuscateValue(definitions, key, prop.getValue());
setAttribute(protobuf, key, value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,9 @@ public void fail_to_remove_last_admin_permission() {
db.users().insertPermissionOnGroup(aGroup, GlobalPermission.PROVISION_PROJECTS);
loginAsAdmin();

String administerPermission = GlobalPermission.ADMINISTER.getKey();
assertThatThrownBy(() -> {
executeRequest(aGroup, GlobalPermission.ADMINISTER.getKey());
executeRequest(aGroup, administerPermission);
})
.isInstanceOf(BadRequestException.class)
.hasMessage("Last group with permission 'admin'. Permission cannot be removed.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@

import java.util.List;
import org.sonar.api.Startable;
import org.sonar.api.config.Configuration;
import org.sonar.api.platform.ServerUpgradeStatus;
import org.sonar.api.server.ServerSide;
import org.sonar.api.utils.log.Logger;
Expand Down

0 comments on commit b0076e1

Please sign in to comment.