Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.

AEM | Anyone have the updated version of RTE Color Picker JS ?

Avatar

Community Advisor

Hi team,

 

We've been using the color picker plugin from https://experience-aem.blogspot.com/2017/06/aem-63-touch-ui-rte-rich-text-editor-color-picker-plugin...  on our project. However, our pipeline is failing because the JavaScript for this plugin is being flagged for Code Smell in Sonar. It has a Cognitive Complexity of 149, and Sonar flags anything above 15. Does anyone have a modified version of this color picker plugin that we could use? Any help would be greatly appreciated.

 

Thanks

Veena

Topics

Topics help categorize Community content and increase your ability to discover relevant content.

6 Replies

Avatar

Community Advisor

Hi @VeenaVikraman 
You need to check which function/class showing the complexity in sonar? Can you try to modify code via yourself and try if that works or not.

 

You can get help from ChatGpt

 



Arun Patidar

Avatar

Community Advisor

It is showing it for the entire file. That is the issue. The complete file needs a refactoring @arunpatidar 

Avatar

Community Advisor

Hi @VeenaVikraman 
I was checking the complexity via JShintThe most complex function has a cyclomatic complexity value of 8 while the median is 1.5.

 

arunpatidar_0-1720167667469.png

how does sonar says 149



Arun Patidar

Avatar

Community Advisor

@arunpatidar Not sure how it is showing. I missed the screenshot. Will get it once we take and run the piepline to refactor this JS. 

Avatar

Administrator

@VeenaVikraman Did you find the suggestion helpful? Please let us know if you require more information. Otherwise, please mark the answer as correct for posterity. If you've discovered a solution yourself, we would appreciate it if you could share it with the community. Thank you! 



Kautuk Sahni