Hi AEM Community,
When running a cloud deployment, We are getting the number of open issues to be numbered 5 as shown below -
Issue |
Use constant NN_TEMPLATE from interface com.day.cq.wcm.api.NameConstants instead of hardcoded value. |
Rule |
AEM Rules:AEM-2 |
As per documentation link - https://github.com/wttech/AEM-Rules-for-SonarQube#good-practices
AEM-2 Use predefined constant instead of hardcoded value.
The issue is reported because of the below - We are declaring cq:template as a constant in our Constants file separately while it is available out of the box in the above mentioned interface.
public static final String CQ_TEMPLATE = "cq:template";
However, when using the interface NameConstants as suggested, The IDE reports the below -
The below interface is thus suggested.
import com.day.cq.wcm.api.constants.NameConstants;
However, this interface is not being resolved by the IDE (IntelliJ).
How can we resolve this minor code smell issue when the suggested interface is deprecated ?
@arunpatidar, @Mohit_KBansal, @kautuk_sahni, @B_Sravan, @Theo_Pendle
Thanks,
Rohan Garg
Solved! Go to Solution.
Hi,
You can use
com.day.cq.wcm.api.NameConstants
Hi,
You can use
com.day.cq.wcm.api.NameConstants
Hey @arunpatidar - Thanks for your response, it's weird though - even with the AEM extension enabled in IntelliJ it highlights as an issue.
But as you suggested with the build and deployment the original interface is working correctly.
Should have given a build first I guess but anyways thanks a lot for confirming!
Views
Likes
Replies
Views
Likes
Replies
Views
Like
Replies