CodeSanityAI 1.0.0

Welcome to CodeSanityAI - created and maintained by Sascha Wildgrube.

Overview

Use Artifical Intelligence to perform CodeSanity checks

At this point in time, consider this approach as experimental. Generative AI provides non-deterministic results. For an automated QA process, this is exactly NOT what we want.

The contained Checks can be added to Scan Suites or be used selectively. Keep in mind that every execution of a Scan Check will trigger inference with the configured LLM - which may lead to significant consumption when many Application Files are scanned against a growing number of Checks.

Table of Contents

Disclaimer

CodeSanityAI is NOT an officially supported ServiceNow product.

CodeSanityAI does NOT come with any kind of warranty. If you use it, you own it!

System Requirements

Installation

  1. Create an account on GitHub - if not done already.
  2. Create a personal access token (classic with "repo" scope) for your GitHub account.
  3. Add credentials to access GitHub - use "Basic Auth".
  4. Perform all installation steps for the DevTools application documented here: https://www.wildgrube.com/servicenow-devtools/ 
  5. Perform all installation steps for the CodeSanity application documented here: https://www.wildgrube.com/servicenow-codesanity/ 
  6. Fork the repository https://github.com/saschawildgrube/servicenow-codesanityai.
  7. Go to Studio and import the CodeSanityAI application from source control.
  8. Execute installation scripts.
    Run the following script as a background script in scope x_snc_codesanityai:
  9. x_snc_devtools.InstallApp("x_snc_codesanityai");

Instance Scan Checks contained in the CodeSanityAI app

Reference

Configuration Options

Tables

This app does not add any tables.

Script Includes

  • AppGetDependencies

    Retrieves information about the app's dependencies to other apps and required versions.

  • AppGetProperty

    Gets a system property of this application.

  • AppInstall

    This script installs CodeSanityAI.

  • AppSetDefaults

    Sets all system properties to default values.

  • AppSetProperty

    Sets a system property of this application.

  • Debug

    Produces a log output in the application log using the DevTools Debug function.

  • DevTools

    Implements the extension point for DevTools.
    |
    Methods:
    * initialize()
    * GetParentRecord()
    * GetLinkDirectory()
    * GetFormatConfig()
    * GetApplicationStatus()
    * RenderDebugDump()
    * GetInstancePipelineName()

  • DevToolsGetApplicationStatus

    The function DevToolsGetApplicationStatus is called by the DevTools extension point instance class and returns the application status object with additional status information to be displayed on the "DevTools Application Overview" page.

  • DevToolsGetLinkDirectory

    The DevToolsGetLinkDirectory function is called by the DevTools extension point instance class and returns an extended (or modified) link directory object that serves as the basis for the DevTools Link page.

  • DevToolsGetParentRecord

    The DevToolsGetParentRecord function is called by the DevTools extension point instance class and returns a parent record for the given record if it can be determined.

  • IsActive

    Returns true if the application is active, otherwise false.

  • IsCodeCompliant

    Asks an AI whether the given code is compliant to the specified rule, returns false if not. If the result is ambiguous or the check cannot be performed, the function returns true (In dubio pro reo).

  • LinterCheck_IsCodeCompliant

    Asks an LLM based AI to check if the given code is compliant to the description in the check.
    If for whatever reason the check cannot be performed, the result is true (In dubio pro reo).

  • Log

    Produces a log output in the application log.

  • LogError

    Produces an error log output in the application log.

  • LogWarning

    Produces a warning log output in the application log.

Dependencies

Technical Debt

No technical debt has been documented for this application.

License

Copyright 2026 by Sascha Wildgrube

Licensed under the Apache License, Version 2.0 (the "License")

You may not use CodeSanityAI except in compliance with the License.

You may obtain a copy of the License at: https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Release Notes

1.0.0 - 2026-02-13

First baselined version