Code patterns allow you to search for specific snippets within program source code or other files.
Adding a Code Pattern
To add a code pattern check, navigate to Checks in the left sidebar and use the New Check + button. Next, select the Code Pattern option in the drop-down and see the settings below:
Settings
Description
A summary of what the code pattern is checking. Shown to users if task is live and checks are shared (which is the default).
Code Pattern
The Ruby regular expression to search for.
Filename
The specific file(s) (relative to /home/nt-user/workspace) to search. Supports file globs. Defaults to all files (*). Limiting the files search is recommended if there are a large number of files to improve performance.
Test Code
Optionally add some text to test your regular expression with.
Matches
A list of matches found in your test code.
Case Sensitive
If the regular expression should be case sensitive.
Present
If disabled, the code pattern will pass when the pattern is NOT present in the code.