Rule Definition
If you're changing the CSS of more than 20 elements using .css(), consider adding a style tag to the page instead for a nearly 60% increase in speed.
Remediation
Use stylesheets style tag
Violation Code Sample
$( "a.swedberg" ).css( "color", "#0769ad" );
Fixed Code Sample
$( "<style type=\"text/css\">a.swedberg { color: #0769ad }</style>")
.appendTo( "head" );
Reference
CISQ OMG, https://learn.jquery.com/performance/use-stylesheets-for-changing-css/
Related Technologies
HTML5
Technical Criterion
CWE-1050 - Excessive Platform Resource Consumption within a Loop
About CAST Appmarq
CAST Appmarq is by far the biggest repository of data about real IT systems. It's built on thousands of analyzed applications, made of 35 different technologies, by over 300 business organizations across major verticals. It provides IT Leaders with factual key analytics to let them know if their applications are on track.