Ignoring violations (cyclopt-ignore)
Cyclopt supports inline suppression directives that tell the analyzer to ignore specific findings directly in your source code. This is useful for intentional patterns, legacy code, auto-generated files, or cases where a violation is a known false positive.
Use cyclopt-ignore for pinpoint, line- or file-level exceptions written next to the code. For project-wide exclusions (whole folders, branches, or rules across every file), use the configuration file instead.
Comment syntax per language
A cyclopt-ignore directive is written inside a normal source-code comment, so the comment prefix depends on the language:
| Language | Comment prefix |
|---|---|
| JavaScript, TypeScript | // |
| Python | # |
| Java | // |
| C# | // |
| PHP | // or # |
| Dart | // |
Where to place the directive
There are three placements.
1. Above the offending line
A standalone comment line suppresses all matching violations on the next line.
// cyclopt-ignore
const token = process.env.SECRET;
# cyclopt-ignore
cursor.execute("SELECT * FROM users WHERE id = " + user_id)
2. Inline on the offending line
A comment appended to the end of a code line suppresses violations on that same line.
const token = process.env.SECRET; // cyclopt-ignore
cursor.execute("SELECT * FROM users WHERE id = " + user_id) # cyclopt-ignore
3. Across the whole file
The cyclopt-ignore-file directive suppresses matching violations everywhere in the file, regardless of line. It's conventionally placed at the top of the file, but works anywhere.
// cyclopt-ignore-file
# cyclopt-ignore-file
Scope: all violations vs. specific rules
Suppress all violations
Use the directive alone, with no rule IDs. Every violation on the targeted line (or in the file) is suppressed.
// cyclopt-ignore
eval(userExpression);
eval(userExpression); // cyclopt-ignore
A bare cyclopt-ignore silences everything on that line. Prefer naming the specific rule you intend to ignore, so new, unrelated issues on the same line are still reported.
Suppress specific rules only
Append one or more rule IDs after the directive. Only those rules are suppressed; all other findings on the same line continue to be reported.
Single rule:
// cyclopt-ignore no-unused-vars
const legacyConfig = buildConfig();
const legacyConfig = buildConfig(); // cyclopt-ignore no-unused-vars
Multiple rules — space-separated:
// cyclopt-ignore no-unused-vars no-undef
const x = undeclaredReference;
Multiple rules — comma-separated (both formats are accepted):
const x = undeclaredReference; // cyclopt-ignore no-unused-vars,no-undef
Suppress rules across a file
Silence everything in the file:
// cyclopt-ignore-file
Or suppress specific rules throughout the file:
# cyclopt-ignore-file C0301
// cyclopt-ignore-file no-unused-vars no-undef
Multiple cyclopt-ignore-file directives in the same file accumulate — each one adds more rules to the file-level suppression list.
// cyclopt-ignore-file no-undef
// cyclopt-ignore-file no-unused-vars
// Both rules are now suppressed for the entire file
Rule ID format
Rule IDs are the identifiers shown in Cyclopt results. To find the exact ruleId, check the violations documentation.
Examples by language
JavaScript / TypeScript — suppress a SAST finding inline:
const html = template.render(userContent); // cyclopt-ignore no-unsanitized-method
JavaScript — suppress multiple rules above a line:
// cyclopt-ignore no-eval detect-eval-with-expression
const result = eval(expression);
Python — suppress a linting rule above a line:
# cyclopt-ignore C0301
very_long_variable_name_that_exceeds_the_line_length_limit = get_configuration_value()
Python — suppress a SAST finding inline:
query = f"SELECT * FROM users WHERE id = {user_id}" # cyclopt-ignore sql-injection
PHP — suppress a style rule above a line:
# cyclopt-ignore Squiz.Commenting.FunctionComment
function legacyHelper() { ... }
C# — suppress a violation above a line:
// cyclopt-ignore UnusedMember.Local
private void DebugHelper() { ... }
File-level — silence all violations in a generated file:
// cyclopt-ignore-file
// --- auto-generated by build tool, do not edit ---
File-level — suppress two specific rules across an entire file:
<?php
# cyclopt-ignore-file Squiz.Commenting.FunctionComment
# cyclopt-ignore-file PSR1.Files.SideEffects
Quick reference
| Goal | Directive |
|---|---|
| Ignore all violations on the next line | // cyclopt-ignore on its own line above |
| Ignore all violations on this line | // cyclopt-ignore appended inline |
| Ignore a specific rule on the next line | // cyclopt-ignore <rule-id> above |
| Ignore a specific rule on this line | // cyclopt-ignore <rule-id> inline |
| Ignore multiple rules on one line | // cyclopt-ignore <id1> <id2> (space or comma) |
| Ignore a rule across the entire file | // cyclopt-ignore-file <rule-id> anywhere |
| Ignore all violations in the entire file | // cyclopt-ignore-file anywhere |
Rule IDs and comment prefixes shown above use // and # per the language table. Swap in the prefix for your language when copying these examples.
Looking for broader control? See the configuration file to exclude files, folders, branches, and rules at the project level.


