---
title: Client Scripts Without Function
description: "Impact Area Scalability  Severity Medium Affected Element Client Scripts ## Rule ID **SN-0018** ## Impact 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…"
url: "https://community-staging.qualityclouds.com/qcdocs/qc/servicenow-rules/client-scripts-without-function/"
updated: "2025-03-21"
category: Rules
---

# Client Scripts Without Function

Impact Area

Scalability 

           Severity

Medium

           Affected Element

Client Scripts

## Rule ID

**SN-0018**

## Impact

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.

## Remediation

Ensure that all code is wrapped in a function.

### Time to fix

15 min
