CRITICAL
Rule Definition
The higher the number of referenced Artifacts, the more difficult the maintenance and evolution is. The updates in referenced Artifacts will need to be tested and taken into account.
Remediation
Modify the source code to reduce the number of Script Functions with a High Fan-Out.
Violation Code Sample
<!--
JavaScriptFanOut.php
-->
<html>
<head>
</head>
<body>
<?php
echo "JavaScript functions - Fan Out", "</br>";
?>
<script type="text/javascript" language="javascript">
function operationStep1() {
document.write("operationStep1</br>");
}
function operationStep2() {
document.write("operationStep2</br>");
}
function operationStep3() {
document.write("operationStep3</br>");
}
function operationStep4() {
document.write("operationStep4</br>");
}
function operationStep5() {
document.write("operationStep5</br>");
}
function operationStep6() {
document.write("operationStep6</br>");
}
function highFanOutOperation() {
document.write("highFanOutOperation</br>");
operationStep1();
operationStep2();
operationStep3();
operationStep4();
operationStep5();
operationStep6();
}
highFanOutOperation();
</script>
</body>
</html>
Related Technologies
Technical Criterion
CWE-1048 - Invokable Control Element with Large Number of Outward Calls
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.