Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

Code Scope (Ignore/Include)

SeaLights' Code Scope empowers you to tailor your quality analysis. Define inclusion and exclusion rules to analyze specific code areas, prioritizing relevant sections and streamlining testing (e.g., excluding legacy code you are not interested in getting coverage for). By default, the entire app's code is included. There are three ways to set Code Scope: app level, file level and method level.


Global App-Level Code Scope

Each application has a built-in "Global Code Entities Rule" that intelligently excludes certain method-level elements based on the app's programming language. This typically includes:

  • Auto-Generated Code: Eliminate noise from code that isn't manually written.

  • Getters and Setters: Focus on core logic instead of routine property access.

  • Constructors: Simplify analysis by excluding default object creation methods.

  • Deprecated Code: Avoid analyzing outdated and potentially unsafe sections.

  • Anonymous Methods: Streamline analysis by excluding methods defined directly within blocks of code.

By fine-tuning this global rule, you establish a solid foundation for focused and efficient analysis, ensuring that your efforts are directed toward the most impactful areas of your codebase.

Follow these steps for customization
  1. Access the "Code Scope" page within "Settings".

  2. Locate the relevant application.

  3. Review the pre-checked code entities excluded by default.

  4. Personalize your analysis:

    • Check additional entities for exclusion.

    • Uncheck entities you wish to include.

.


File-Level Code Scope

SeaLights' Code Scope offers granular control at the file level. This enables you to find a sweet spot between accuracy and maintenance, tailoring your analysis to focus on critical sections while keeping management manageable. Rule types:

  • Include: Focuses analysis on specific code areas. Ideal for analyzing smaller scopes or excluding irrelevant sections. For example, If you want to analyze the coverage for API tests, create an "Include" rule for this particular test stage that targets only the files relevant for those APIs.

  • Ignore: Removes specific code from analysis, streamlining your focus. For example, excluding legacy code you are not interested in getting coverage for.

Rule Conflicts:

Please note that when defining both "Include" and "Ignore" rules for the same code scope, the "Ignore" rule will take precedence. This ensures you have clear control over what gets excluded from your analysis.

Newly added files within a scoped folder automatically adhere to the defined rules, ensuring your analysis stays up-to-date. No need to manually update every time your codebase changes!

Follow these steps for customization
  1. Navigate to the "Code Scope" page within "Settings".

  2. Select the relevant application.

  3. Define include / ignore rules for individual test stages or all stages collectively, customizing your analysis to specific testing needs. Define multiple rules per app/stage (order doesn't matter).

  4. Leverage the flexibility to edit, duplicate and delete rules.


Method-Level Code Scope

SeaLights' Code Scope offers fine-grained method-level exclusions directly within the Test Gaps Analysis report. You can pinpoint individual methods, mark them for exclusion as needed and focus your analysis on truly relevant code.

Excluded methods automatically become "Ignore" rules in the Code Scope settings, ensuring your analysis adapts effortlessly as your codebase evolves.

Note! Excluded methods remain visible in the report but are marked as ignored for clarity.

Follow these steps for customization
  1. From the Test Gaps Analysis report drill down to a specific file with untested methods.

  2. Select specific methods you want to exclude from analysis.

  3. These exclusions are automatically reflected as "Ignore" rules under the relevant app in the Code Scope settings page.

  4. You can easily review or delete these rules as needed.


Bulk Upload Rules

When managing rules across many applications, SeaLights provides a bulk upload workflow that lets you configure rules for all your apps at once using a CSV file, instead of setting them one application at a time.

There are two modes:

  • Append: Add new rules on top of your existing ones. Nothing is removed, current rules stay intact.

  • Replace All: Replace every existing rule across all applications with the contents of your CSV file. Use this when treating your CSV as the single source of truth.

CSV Format

The CSV file must include the following columns:

Column
Required
Description

app

✅

Application name, must match the app name in SeaLights exactly

test_stage

✅

Stage name (nter the exact stage name as it appears in SeaLights. e.g., Unit Tests) or All to apply the rule across every stage

rule_type

✅

ignore or include

rule_condition

✅

starts_with, ends_with, contains, exact_match, or entire_app

method

—

Method name for method-level rules. When specified, rule_type must be ignore

path

—

File path or pattern. Required unless rule_condition is entire_app or a method is specified

reason

✅

Free-text note explaining the rule, required for traceability

Follow these steps to bulk upload rules:
  1. Navigate to the Code Scope page within Settings.

  2. Click Bulk Upload Rules at the top of the page.

  3. Choose a mode — Append to add rules, or Replace All to overwrite everything.

  4. Download the CSV template (Append) or your existing rules (Replace All) and prepare your file.

  5. Upload your CSV on the next step. SeaLights validates column structure and row values instantly.

  6. Review any errors or warnings in the validation table — only rows with issues are shown.

  7. Once all errors are resolved, click Apply.

Validation

When you upload a CSV, SeaLights performs two independent checks:

  • Column structure — verifies all required columns are present in the header row.

  • Row-level data — checks each row for missing values, invalid rule_type or rule_condition values, and method rules with an incorrect rule type.

Rows with errors block the upload and must be fixed. Rows with warnings (e.g., an unrecognized app name or test stage) are informational — the upload can proceed.

Keep in mind! Only invalid or warning rows are shown in the validation table. Valid rows are counted in the summary but not listed — making it practical to work with files containing hundreds of rules.


Keep in mind! Code Scope rules take effect from the next reported build in SeaLights. Unless using the new Coverage Analysis, where all rules take effect on the following data refresh (every 15 minutes).

By defining Code Scope, you can tailor the analysis to specific code areas, gain valuable insights into software quality, and focus on improving the most critical sections of your codebase.

Last updated

Was this helpful?