Day 15: DDIS - Client Scripts without function

Scan Check Type: Table Check [sys_script_client]

Client scripts without a function cause issues with variable scope. When code is not enclosed in a function, variables and other objects are available and shared to all other client-side scripts.

Ensure that all code is wrapped in a function.

This scan was developed using a table check with condition to identify any client script records that don’t contain the function. This check is inspired by QualityClouds check for the same, but it operates slightly differently from their check, which does closer to a startsWith operation. The problem is that there are multiple ways to define client script functions. It is best practice that all of the client script code is wrapped into a function, but that is somewhat harder to verify and check.

Download and import the XML to check it out in your instance! At the end of the month I will be bundling all the checks together.

Day 15 scan_table_check_1a13146c2fab11107caa93acf699b69e.xml