aboutsummaryrefslogtreecommitdiffstats
path: root/sonar-ws-client/src
diff options
context:
space:
mode:
authorsimonbrandhof <simon.brandhof@gmail.com>2011-03-15 16:05:08 +0100
committersimonbrandhof <simon.brandhof@gmail.com>2011-03-15 16:25:42 +0100
commit73a5f721a6b3a56bf1b7edc1f3e69350138e113b (patch)
tree02081adbb15d87cdb865d00dcd9f23b1de82afb9 /sonar-ws-client/src
parent6962e9a418086ddbf0cd06cbfa78ae3d980c62e3 (diff)
downloadsonarqube-73a5f721a6b3a56bf1b7edc1f3e69350138e113b.tar.gz
sonarqube-73a5f721a6b3a56bf1b7edc1f3e69350138e113b.zip
SONAR-2230 Add Java client for the web service "profiles"
Diffstat (limited to 'sonar-ws-client/src')
-rw-r--r--sonar-ws-client/src/main/java/org/sonar/wsclient/services/Profile.java162
-rw-r--r--sonar-ws-client/src/main/java/org/sonar/wsclient/services/ProfileQuery.java91
-rw-r--r--sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/ProfileUnmarshaller.java63
-rw-r--r--sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/Unmarshallers.java1
-rw-r--r--sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/ProfileUnmarshallerTest.java60
-rw-r--r--sonar-ws-client/src/test/resources/profiles/profile.json1
6 files changed, 378 insertions, 0 deletions
diff --git a/sonar-ws-client/src/main/java/org/sonar/wsclient/services/Profile.java b/sonar-ws-client/src/main/java/org/sonar/wsclient/services/Profile.java
new file mode 100644
index 00000000000..1311526fffd
--- /dev/null
+++ b/sonar-ws-client/src/main/java/org/sonar/wsclient/services/Profile.java
@@ -0,0 +1,162 @@
+/*
+ * Sonar, open source software quality management tool.
+ * Copyright (C) 2008-2011 SonarSource
+ * mailto:contact AT sonarsource DOT com
+ *
+ * Sonar is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * Sonar is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Sonar; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02
+ */
+
+package org.sonar.wsclient.services;
+
+import java.util.*;
+
+/**
+ * @since 2.7
+ */
+public class Profile extends Model {
+
+ private String language;
+ private String name;
+ private boolean defaultProfile;
+ private boolean provided;
+ private String parentName;
+ private List<Rule> rules = new ArrayList<Rule>();
+
+ public String getLanguage() {
+ return language;
+ }
+
+ public Profile setLanguage(String s) {
+ this.language = s;
+ return this;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public Profile setName(String name) {
+ this.name = name;
+ return this;
+ }
+
+ public boolean isDefaultProfile() {
+ return defaultProfile;
+ }
+
+ public Profile setDefaultProfile(boolean b) {
+ this.defaultProfile = b;
+ return this;
+ }
+
+ public boolean isProvided() {
+ return provided;
+ }
+
+ public Profile setProvided(boolean b) {
+ this.provided = b;
+ return this;
+ }
+
+ public String getParentName() {
+ return parentName;
+ }
+
+ public Profile setParentName(String s) {
+ this.parentName = s;
+ return this;
+ }
+
+ public List<Rule> getRules() {
+ return rules;
+ }
+
+ public Rule getRule(String repositoryKey, String ruleKey) {
+ for (Rule rule : rules) {
+ if (repositoryKey.equals(rule.getRepository()) && ruleKey.equals(rule.getKey())) {
+ return rule;
+ }
+ }
+ return null;
+ }
+
+ public Profile addRule(Rule rule) {
+ rules.add(rule);
+ return this;
+ }
+
+ public static final class Rule {
+ private String key;
+ private String repository;
+ private String severity;
+ private String inheritance;
+ private Map<String,String> parameters;
+
+ public String getKey() {
+ return key;
+ }
+
+ public Rule setKey(String key) {
+ this.key = key;
+ return this;
+ }
+
+ public String getRepository() {
+ return repository;
+ }
+
+ public Rule setRepository(String repository) {
+ this.repository = repository;
+ return this;
+ }
+
+ public String getSeverity() {
+ return severity;
+ }
+
+ public Rule setSeverity(String severity) {
+ this.severity = severity;
+ return this;
+ }
+
+ public String getInheritance() {
+ return inheritance;
+ }
+
+ public Rule setInheritance(String inheritance) {
+ this.inheritance = inheritance;
+ return this;
+ }
+
+ public Map<String, String> getParameters() {
+ if (parameters==null) {
+ return Collections.emptyMap();
+ }
+ return parameters;
+ }
+
+ public String getParameter(String key) {
+ return getParameters().get(key);
+ }
+
+ public Rule addParameter(String key, String value) {
+ if (parameters==null) {
+ parameters = new HashMap<String,String>();
+ }
+ parameters.put(key, value);
+ return this;
+ }
+ }
+}
diff --git a/sonar-ws-client/src/main/java/org/sonar/wsclient/services/ProfileQuery.java b/sonar-ws-client/src/main/java/org/sonar/wsclient/services/ProfileQuery.java
new file mode 100644
index 00000000000..0012c3e11df
--- /dev/null
+++ b/sonar-ws-client/src/main/java/org/sonar/wsclient/services/ProfileQuery.java
@@ -0,0 +1,91 @@
+/*
+ * Sonar, open source software quality management tool.
+ * Copyright (C) 2008-2011 SonarSource
+ * mailto:contact AT sonarsource DOT com
+ *
+ * Sonar is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * Sonar is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Sonar; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02
+ */
+package org.sonar.wsclient.services;
+
+/**
+ * @since 2.7
+ */
+public class ProfileQuery extends Query<Profile> {
+ public static final String BASE_URL = "/api/profiles";
+
+ private String language;
+ private String name;//optional
+ private String[] ruleRepositories;//optional
+ private String[] ruleSeverities;//optional
+
+ private ProfileQuery(String language) {
+ this.language = language;
+ }
+
+ public String getLanguage() {
+ return language;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public String[] getRuleRepositories() {
+ return ruleRepositories;
+ }
+
+ public String[] getRuleSeverities() {
+ return ruleSeverities;
+ }
+
+ public ProfileQuery setName(String name) {
+ this.name = name;
+ return this;
+ }
+
+ public ProfileQuery setRuleRepositories(String[] ruleRepositories) {
+ this.ruleRepositories = ruleRepositories;
+ return this;
+ }
+
+ public ProfileQuery setRuleSeverities(String[] ruleSeverities) {
+ this.ruleSeverities = ruleSeverities;
+ return this;
+ }
+
+ @Override
+ public Class<Profile> getModelClass() {
+ return Profile.class;
+ }
+
+ @Override
+ public String getUrl() {
+ StringBuilder url = new StringBuilder(BASE_URL);
+ url.append('?');
+ appendUrlParameter(url, "language", language);
+ appendUrlParameter(url, "name", name);
+ appendUrlParameter(url, "rule_repositories", ruleRepositories);
+ appendUrlParameter(url, "rule_severities", ruleSeverities);
+ return url.toString();
+ }
+
+ public static ProfileQuery createWithLanguage(String language) {
+ return new ProfileQuery(language);
+ }
+
+ public static ProfileQuery create(String language, String name) {
+ return new ProfileQuery(language).setName(name);
+ }
+}
diff --git a/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/ProfileUnmarshaller.java b/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/ProfileUnmarshaller.java
new file mode 100644
index 00000000000..9af6118515c
--- /dev/null
+++ b/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/ProfileUnmarshaller.java
@@ -0,0 +1,63 @@
+/*
+ * Sonar, open source software quality management tool.
+ * Copyright (C) 2008-2011 SonarSource
+ * mailto:contact AT sonarsource DOT com
+ *
+ * Sonar is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * Sonar is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Sonar; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02
+ */
+package org.sonar.wsclient.unmarshallers;
+
+import org.sonar.wsclient.services.Profile;
+import org.sonar.wsclient.services.WSUtils;
+
+public class ProfileUnmarshaller extends AbstractUnmarshaller<Profile> {
+
+ @Override
+ protected Profile parse(Object json) {
+ WSUtils utils = WSUtils.getINSTANCE();
+ Profile profile = new Profile();
+ profile
+ .setLanguage(utils.getString(json, "language"))
+ .setName(utils.getString(json, "name"))
+ .setDefaultProfile(utils.getBoolean(json, "default"))
+ .setParentName(utils.getString(json, "parent"))
+ .setProvided(utils.getBoolean(json, "provided"));
+
+ Object rulesJson = utils.getField(json, "rules");
+ if (rulesJson != null) {
+ for (int i = 0; i < utils.getArraySize(rulesJson); i++) {
+ Object ruleJson = utils.getArrayElement(rulesJson, i);
+ if (ruleJson != null) {
+ Profile.Rule rule = new Profile.Rule();
+ rule.setKey(utils.getString(ruleJson, "key"));
+ rule.setRepository(utils.getString(ruleJson, "repo"));
+ rule.setSeverity(utils.getString(ruleJson, "severity"));
+ rule.setInheritance(utils.getString(ruleJson, "inheritance"));
+
+ Object paramsJson = utils.getField(ruleJson, "params");
+ if (paramsJson != null) {
+ for (int indexParam = 0; indexParam < utils.getArraySize(paramsJson); indexParam++) {
+ Object paramJson = utils.getArrayElement(paramsJson, indexParam);
+ rule.addParameter(utils.getString(paramJson, "key"), utils.getString(paramJson, "value"));
+ }
+ }
+ profile.addRule(rule);
+ }
+ }
+ }
+ return profile;
+ }
+
+}
diff --git a/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/Unmarshallers.java b/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/Unmarshallers.java
index a97d7a45cca..629d30184bd 100644
--- a/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/Unmarshallers.java
+++ b/sonar-ws-client/src/main/java/org/sonar/wsclient/unmarshallers/Unmarshallers.java
@@ -45,6 +45,7 @@ public final class Unmarshallers {
unmarshallers.put(Plugin.class, new PluginUnmarshaller());
unmarshallers.put(Rule.class, new RuleUnmarshaller());
unmarshallers.put(TimeMachine.class, new TimeMachineUnmarshaller());
+ unmarshallers.put(Profile.class, new ProfileUnmarshaller());
}
public static <MODEL extends Model> Unmarshaller<MODEL> forModel(Class<MODEL> modelClass) {
diff --git a/sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/ProfileUnmarshallerTest.java b/sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/ProfileUnmarshallerTest.java
new file mode 100644
index 00000000000..86b91fc2cf4
--- /dev/null
+++ b/sonar-ws-client/src/test/java/org/sonar/wsclient/unmarshallers/ProfileUnmarshallerTest.java
@@ -0,0 +1,60 @@
+/*
+ * Sonar, open source software quality management tool.
+ * Copyright (C) 2008-2011 SonarSource
+ * mailto:contact AT sonarsource DOT com
+ *
+ * Sonar is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 3 of the License, or (at your option) any later version.
+ *
+ * Sonar is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with Sonar; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02
+ */
+package org.sonar.wsclient.unmarshallers;
+
+import org.hamcrest.CoreMatchers;
+import org.junit.Test;
+import org.sonar.wsclient.services.Profile;
+
+import static org.hamcrest.CoreMatchers.nullValue;
+import static org.hamcrest.core.Is.is;
+import static org.junit.Assert.assertThat;
+
+public class ProfileUnmarshallerTest extends UnmarshallerTestCase {
+
+ @Test
+ public void shouldNotHaveProfile() {
+ Profile profile = new ProfileUnmarshaller().toModel("[]");
+ assertThat(profile, nullValue());
+ }
+
+ @Test
+ public void shouldGetProfile() {
+ Profile profile = new ProfileUnmarshaller().toModel(loadFile("/profiles/profile.json"));
+ assertThat(profile.getLanguage(), is("java"));
+ assertThat(profile.getName(), is("Sonar way"));
+ assertThat(profile.getParentName(), nullValue());
+ assertThat(profile.isDefaultProfile(), is(true));
+ assertThat(profile.isProvided(), is(true));
+
+ assertThat(profile.getRules().size(), is(116));
+ Profile.Rule rule1 = profile.getRules().get(0);
+ assertThat(rule1.getKey(), is("com.puppycrawl.tools.checkstyle.checks.coding.InnerAssignmentCheck"));
+ assertThat(rule1.getRepository(), is("checkstyle"));
+ assertThat(rule1.getInheritance(), CoreMatchers.<Object>nullValue());
+ assertThat(rule1.getSeverity(), is("MAJOR"));
+ assertThat(rule1.getParameters().size(), is(0));
+ assertThat(rule1.getParameter("foo"), nullValue());
+
+ Profile.Rule rule2 = profile.getRule("checkstyle", "com.puppycrawl.tools.checkstyle.checks.naming.LocalFinalVariableNameCheck");
+ assertThat(rule2.getParameters().size(), is(1));
+ assertThat(rule2.getParameter("format"), is("^[a-z][a-zA-Z0-9]*$"));
+ }
+}
diff --git a/sonar-ws-client/src/test/resources/profiles/profile.json b/sonar-ws-client/src/test/resources/profiles/profile.json
new file mode 100644
index 00000000000..074bb3fc1b3
--- /dev/null
+++ b/sonar-ws-client/src/test/resources/profiles/profile.json
@@ -0,0 +1 @@
+[{"name":"Sonar way","language":"java","default":true,"provided":true,"rules":[{"key":"com.puppycrawl.tools.checkstyle.checks.coding.InnerAssignmentCheck","repo":"checkstyle","severity":"MAJOR"},{"key":"com.puppycrawl.tools.checkstyle.checks.coding.SimplifyBooleanReturnCheck","repo":"checkstyle","severity":"MAJOR"},{"key":"EmptyStaticInitializer","repo":"pmd","severity":"MAJOR"},{"key":"com.puppycrawl.tools.checkstyle.checks.naming.LocalFinalVariableNameCheck","repo":"checkstyle","severity":"MAJOR","params":[{"key":"format","value":"^[a-z][a-zA-Z0-9]*$"}]},{"key":"com.puppycrawl.tools.checkstyle.checks.coding.StringLiteralEqualityCheck","repo":"checkstyle","severity":"MAJOR"},{"key":"com.puppycrawl.tools.checkstyle.checks.coding.EmptyStatementCheck","repo":"checkstyle","severity":"MINOR"},{"key":"com.puppycrawl.tools.checkstyle.checks.modifier.ModifierOrderCheck","repo":"checkstyle","severity":"MINOR"},{"key":"com.puppycrawl.tools.checkstyle.checks.metrics.BooleanExpressionComplexityCheck","repo":"checkstyle","severity":"MAJOR"},{"key":"com.puppycrawl.tools.checkstyle.checks.design.HideUtilityClassConstructorCheck","repo":"checkstyle","severity":"MAJOR"},{"key":"com.puppycrawl.tools.checkstyle.checks.sizes.AnonInnerLengthCheck","repo":"checkstyle","severity":"MAJOR"},{"key":"com.puppycrawl.tools.checkstyle.checks.imports.UnusedImportsCheck","repo":"checkstyle","severity":"INFO"},{"key":"com.puppycrawl.tools.checkstyle.checks.naming.LocalVariableNameCheck","repo":"checkstyle","severity":"MAJOR","params":[{"key":"format","value":"^[a-z][a-zA-Z0-9]*$"}]},{"key":"com.puppycrawl.tools.checkstyle.checks.naming.PackageNameCheck","repo":"checkstyle","severity":"MAJOR","params":[{"key":"format","value":"^[a-z]+(\\.[a-zA-Z_][a-zA-Z0-9_]*)*$"}]},{"key":"com.puppycrawl.tools.checkstyle.checks.metrics.CyclomaticComplexityCheck","repo":"checkstyle","severity":"MAJOR","params":[{"key":"max","value":"10"}]},{"key":"com.puppycrawl.tools.checkstyle.checks.naming.MethodNameCheck","repo":"checkstyle","severity":"MAJOR","params":[{"key":"format","value":"^[a-z][a-zA-Z0-9]*$"},{"key":"allowClassName","value":"false"}]},{"key":"com.puppycrawl.tools.checkstyle.checks.naming.MemberNameCheck","repo":"checkstyle","severity":"MAJOR","params":[{"key":"format","value":"^[a-z][a-zA-Z0-9]*$"},{"key":"applyToPrivate","value":"true"},{"key":"applyToPackage","value":"true"},{"key":"applyToProtected","value":"true"},{"key":"applyToPublic","value":"true"}]},{"key":"com.puppycrawl.tools.checkstyle.checks.naming.ParameterNameCheck","repo":"checkstyle","severity":"MAJOR","params":[{"key":"format","value":"^[a-z][a-zA-Z0-9]*$"}]},{"key":"com.puppycrawl.tools.checkstyle.checks.design.DesignForExtensionCheck","repo":"checkstyle","severity":"MINOR"},{"key":"com.puppycrawl.tools.checkstyle.checks.coding.HiddenFieldCheck","repo":"checkstyle","severity":"MAJOR","params":[{"key":"ignoreAbstractMethods","value":"true"},{"key":"ignoreSetter","value":"true"},{"key":"ignoreConstructorParameter","value":"true"},{"key":"tokens","value":"VARIABLE_DEF"}]},{"key":"com.puppycrawl.tools.checkstyle.checks.coding.IllegalThrowsCheck","repo":"checkstyle","severity":"MAJOR"},{"key":"com.puppycrawl.tools.checkstyle.checks.design.VisibilityModifierCheck","repo":"checkstyle","severity":"MAJOR"},{"key":"com.puppycrawl.tools.checkstyle.checks.modifier.RedundantModifierCheck","repo":"checkstyle","severity":"MINOR"},{"key":"com.puppycrawl.tools.checkstyle.checks.coding.DoubleCheckedLockingCheck","repo":"checkstyle","severity":"MAJOR"},{"key":"com.puppycrawl.tools.checkstyle.checks.coding.EqualsHashCodeCheck","repo":"checkstyle","severity":"CRITICAL"},{"key":"com.puppycrawl.tools.checkstyle.checks.coding.SimplifyBooleanExpressionCheck","repo":"checkstyle","severity":"MAJOR"},{"key":"com.puppycrawl.tools.checkstyle.checks.coding.RedundantThrowsCheck","repo":"checkstyle","severity":"MINOR"},{"key":"com.puppycrawl.tools.checkstyle.checks.naming.StaticVariableNameCheck","repo":"checkstyle","severity":"MAJOR","params":[{"key":"format","value":"^[a-z][a-zA-Z0-9]*$"},{"key":"applyToPrivate","value":"true"},{"key":"applyToPackage","value":"true"},{"key":"applyToProtected","value":"true"},{"key":"applyToPublic","value":"true"}]},{"key":"com.puppycrawl.tools.checkstyle.checks.coding.ParameterAssignmentCheck","repo":"checkstyle","severity":"MAJOR"},{"key":"com.puppycrawl.tools.checkstyle.checks.coding.DefaultComesLastCheck","repo":"checkstyle","severity":"MAJOR"},{"key":"com.puppycrawl.tools.checkstyle.checks.naming.ConstantNameCheck","repo":"checkstyle","severity":"MINOR","params":[{"key":"format","value":"^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$"},{"key":"applyToPrivate","value":"true"},{"key":"applyToPackage","value":"true"},{"key":"applyToProtected","value":"true"},{"key":"applyToPublic","value":"true"}]},{"key":"com.puppycrawl.tools.checkstyle.checks.design.FinalClassCheck","repo":"checkstyle","severity":"MAJOR"},{"key":"com.puppycrawl.tools.checkstyle.checks.coding.MagicNumberCheck","repo":"checkstyle","severity":"MINOR"},{"key":"EmptyFinalizer","repo":"pmd","severity":"MAJOR"},{"key":"IfElseStmtsMustUseBraces","repo":"pmd","severity":"MAJOR"},{"key":"UseCorrectExceptionLogging","repo":"pmd","severity":"MAJOR"},{"key":"SingularField","repo":"pmd","severity":"MINOR"},{"key":"AvoidAssertAsIdentifier","repo":"pmd","severity":"MAJOR"},{"key":"AvoidRethrowingException","repo":"pmd","severity":"MAJOR"},{"key":"DontImportJavaLang","repo":"pmd","severity":"MINOR"},{"key":"UnusedPrivateField","repo":"pmd","severity":"MAJOR"},{"key":"UnusedFormalParameter","repo":"pmd","severity":"MAJOR"},{"key":"StringToString","repo":"pmd","severity":"MAJOR"},{"key":"BigIntegerInstantiation","repo":"pmd","severity":"MAJOR"},{"key":"StringBufferInstantiationWithChar","repo":"pmd","severity":"MAJOR"},{"key":"CloneThrowsCloneNotSupportedException","repo":"pmd","severity":"MAJOR"},{"key":"ReplaceEnumerationWithIterator","repo":"pmd","severity":"MAJOR"},{"key":"StringInstantiation","repo":"pmd","severity":"MAJOR"},{"key":"UselessStringValueOf","repo":"pmd","severity":"MINOR"},{"key":"NcssTypeCount","repo":"pmd","severity":"MAJOR","params":[{"key":"minimum","value":"800"}]},{"key":"MissingStaticMethodInNonInstantiatableClass","repo":"pmd","severity":"MAJOR"},{"key":"ClassCastExceptionWithToArray","repo":"pmd","severity":"MAJOR"},{"key":"AvoidDuplicateLiterals","repo":"pmd","severity":"MAJOR"},{"key":"UseArraysAsList","repo":"pmd","severity":"MAJOR"},{"key":"MethodWithSameNameAsEnclosingClass","repo":"pmd","severity":"MAJOR"},{"key":"FinalFieldCouldBeStatic","repo":"pmd","severity":"MINOR"},{"key":"AvoidDollarSigns","repo":"pmd","severity":"MINOR"},{"key":"BooleanInstantiation","repo":"pmd","severity":"MAJOR"},{"key":"CompareObjectsWithEquals","repo":"pmd","severity":"MAJOR"},{"key":"CollapsibleIfStatements","repo":"pmd","severity":"MINOR"},{"key":"SuspiciousConstantFieldName","repo":"pmd","severity":"MAJOR"},{"key":"UseStringBufferLength","repo":"pmd","severity":"MINOR"},{"key":"WhileLoopsMustUseBraces","repo":"pmd","severity":"MAJOR"},{"key":"PreserveStackTrace","repo":"pmd","severity":"MAJOR"},{"key":"DontImportSun","repo":"pmd","severity":"MINOR"},{"key":"FinalizeOverloaded","repo":"pmd","severity":"MAJOR"},{"key":"CloneMethodMustImplementCloneable","repo":"pmd","severity":"MAJOR"},{"key":"UnusedLocalVariable","repo":"pmd","severity":"MAJOR"},{"key":"EmptySynchronizedBlock","repo":"pmd","severity":"CRITICAL"},{"key":"EmptyIfStmt","repo":"pmd","severity":"CRITICAL"},{"key":"UnnecessaryCaseChange","repo":"pmd","severity":"MINOR"},{"key":"EmptySwitchStatements","repo":"pmd","severity":"MAJOR"},{"key":"UnusedModifier","repo":"pmd","severity":"INFO"},{"key":"LooseCoupling","repo":"pmd","severity":"MAJOR"},{"key":"SignatureDeclareThrowsException","repo":"pmd","severity":"MAJOR"},{"key":"UnusedPrivateMethod","repo":"pmd","severity":"MAJOR"},{"key":"AvoidThrowingRawExceptionTypes","repo":"pmd","severity":"MAJOR"},{"key":"NcssMethodCount","repo":"pmd","severity":"MAJOR","params":[{"key":"minimum","value":"50"}]},{"key":"ExceptionAsFlowControl","repo":"pmd","severity":"MAJOR"},{"key":"ArrayIsStoredDirectly","repo":"pmd","severity":"CRITICAL"},{"key":"ClassNamingConventions","repo":"pmd","severity":"MAJOR"},{"key":"ReplaceHashtableWithMap","repo":"pmd","severity":"MAJOR"},{"key":"CloseResource","repo":"pmd","severity":"MAJOR"},{"key":"FinalizeDoesNotCallSuperFinalize","repo":"pmd","severity":"MAJOR"},{"key":"AvoidCatchingThrowable","repo":"pmd","severity":"CRITICAL"},{"key":"EmptyTryBlock","repo":"pmd","severity":"MAJOR"},{"key":"EmptyFinallyBlock","repo":"pmd","severity":"CRITICAL"},{"key":"ConstructorCallsOverridableMethod","repo":"pmd","severity":"MAJOR"},{"key":"AvoidInstanceofChecksInCatchClause","repo":"pmd","severity":"MINOR"},{"key":"AvoidThrowingNullPointerException","repo":"pmd","severity":"MAJOR"},{"key":"IfStmtsMustUseBraces","repo":"pmd","severity":"MAJOR"},{"key":"UnconditionalIfStatement","repo":"pmd","severity":"CRITICAL"},{"key":"EmptyWhileStmt","repo":"pmd","severity":"CRITICAL"},{"key":"AvoidCatchingNPE","repo":"pmd","severity":"MAJOR"},{"key":"AvoidDecimalLiteralsInBigDecimalConstructor","repo":"pmd","severity":"MAJOR"},{"key":"AvoidCallingFinalize","repo":"pmd","severity":"MAJOR"},{"key":"ReplaceVectorWithList","repo":"pmd","severity":"MAJOR"},{"key":"SuspiciousEqualsMethodName","repo":"pmd","severity":"CRITICAL"},{"key":"IdempotentOperations","repo":"pmd","severity":"MAJOR"},{"key":"AvoidPrintStackTrace","repo":"pmd","severity":"MAJOR"},{"key":"ForLoopsMustUseBraces","repo":"pmd","severity":"MAJOR"},{"key":"AvoidArrayLoops","repo":"pmd","severity":"MAJOR"},{"key":"UnnecessaryLocalBeforeReturn","repo":"pmd","severity":"MAJOR"},{"key":"UselessOperationOnImmutable","repo":"pmd","severity":"CRITICAL"},{"key":"InefficientStringBuffering","repo":"pmd","severity":"MAJOR"},{"key":"SuspiciousHashcodeMethodName","repo":"pmd","severity":"MAJOR"},{"key":"UseArrayListInsteadOfVector","repo":"pmd","severity":"MAJOR"},{"key":"UseIndexOfChar","repo":"pmd","severity":"MAJOR"},{"key":"InstantiationToGetClass","repo":"pmd","severity":"MAJOR"},{"key":"UnusedNullCheckInEquals","repo":"pmd","severity":"MAJOR"},{"key":"SystemPrintln","repo":"pmd","severity":"MAJOR"},{"key":"IntegerInstantiation","repo":"pmd","severity":"MAJOR"},{"key":"EqualsNull","repo":"pmd","severity":"CRITICAL"},{"key":"UselessOverridingMethod","repo":"pmd","severity":"MAJOR"},{"key":"AvoidEnumAsIdentifier","repo":"pmd","severity":"MAJOR"},{"key":"SimplifyConditional","repo":"pmd","severity":"MAJOR"},{"key":"BrokenNullCheck","repo":"pmd","severity":"CRITICAL"}]}] \ No newline at end of file