@@ -68,8 +68,8 @@ public void updateRulesWithMetadata() {
6868 final ModuleDetails moduleDetails = metadataRepo .get (rule .key ());
6969 if (moduleDetails != null ) {
7070 rule .setHtmlDescription (moduleDetails .getDescription ());
71- rule .setName (convertName (moduleDetails .getName () + CHECK_STRING ));
72- rule .setInternalKey (convertInternalKey (moduleDetails ));
71+ rule .setName (getFullCheckName (moduleDetails .getName () + CHECK_STRING ));
72+ rule .setInternalKey (getInternalKey (moduleDetails ));
7373
7474 rule .params ().forEach (param -> { //NOSONAR
7575 if (!"tabWidth" .equals (param .key ())) {
@@ -110,8 +110,8 @@ public void createRulesWithMetadata() {
110110 final RulesDefinition .NewRule rule =
111111 repository .createRule (moduleDetails .getFullQualifiedName ());
112112 rule .setHtmlDescription (moduleDetails .getDescription ())
113- .setName (convertName (moduleDetails .getName () + CHECK_STRING ))
114- .setInternalKey (convertInternalKey (moduleDetails ))
113+ .setName (getFullCheckName (moduleDetails .getName () + CHECK_STRING ))
114+ .setInternalKey (getInternalKey (moduleDetails ))
115115 .setDebtRemediationFunction (debtRemediationFunction )
116116 .setSeverity ("MINOR" )
117117 .setStatus (RuleStatus .READY );
@@ -150,8 +150,8 @@ private boolean isTemplateRule(String checkName) {
150150 .anyMatch (CheckstyleMetadata ::isSetter );
151151 }
152152
153- private List <String > getEnumValues (String checkName ) {
154- final Class <?> loadedClass = getClass (checkName );
153+ private List <String > getEnumValues (String enumName ) {
154+ final Class <?> loadedClass = getClass (enumName );
155155 final Object [] vals = loadedClass .getEnumConstants ();
156156 final List <String > enumVals = new ArrayList <>();
157157 for (Object val : vals ) {
@@ -254,22 +254,22 @@ public static boolean isSetter(Method method) {
254254 * It converts the name received from ModuleDetails to Sonar rule name format
255255 * e.g. RightCurlyCheck -> Right Curly Check
256256 *
257- * @param name the name fetched from ModuleDetails
257+ * @param checkName the name fetched from ModuleDetails
258258 * @return modifiedName
259259 */
260- public static String convertName (String name ) {
260+ public static String getFullCheckName (String checkName ) {
261261 final int capacity = 1024 ;
262262 final StringBuilder result = new StringBuilder (capacity );
263- for (int i = 0 ; i < name .length (); i ++) {
264- result .append (name .charAt (i ));
265- if (i + 1 < name .length () && Character .isUpperCase (name .charAt (i + 1 ))) {
263+ for (int i = 0 ; i < checkName .length (); i ++) {
264+ result .append (checkName .charAt (i ));
265+ if (i + 1 < checkName .length () && Character .isUpperCase (checkName .charAt (i + 1 ))) {
266266 result .append (' ' );
267267 }
268268 }
269269 return result .toString ();
270270 }
271271
272- public static String convertInternalKey (ModuleDetails moduleDetails ) {
272+ public static String getInternalKey (ModuleDetails moduleDetails ) {
273273 String result = "Checker/" ;
274274 if ("com.puppycrawl.tools.checkstyle.Checker" .equals (moduleDetails .getParent ())) {
275275 result += moduleDetails .getName ();
0 commit comments