Contents Menu Expand Light mode Dark mode Auto light/dark, in light mode Auto light/dark, in dark mode Skip to content
ubCode 0.39.0 documentation
Light Logo Dark Logo

Start here

  • What is ubCode?
  • Installation
  • Quickstart
  • Your first traced project

Choose your path

  • Requirements & traceability
  • Publish HTML & PDF
  • Sphinx & Sphinx-Needs
  • Engineer with AI agents

How-to guides

  • Trace source code
  • Find untraced code
  • Build variants
  • Write reports
  • Run ubc in CI
  • Use another editor
  • Build an HTML site
  • Build a PDF
    • Page classes at work
  • Migrate from Sphinx-Needs

AI agents

  • AI agents, checked by the engine
  • Pharaoh agentic engineer
    • Quick start
    • Configuring the workflow
    • Reviews and quality analysis
    • Recovering intent from code
    • Changing what is already specified
    • The ubc agent command
    • In VS Code
  • MCP server
  • Chat participant

Writing and configuration

  • Writing content
    • reStructuredText basics
      • The basics in MyST
    • reStructuredText tables
      • Tables in MyST
    • References and links
      • References and links in MyST
    • Roles
      • Roles in MyST
    • Markdown (MyST)
      • MyST core syntax
      • MyST extensions
    • Needs
      • Writing needs
        • Writing needs in MyST
      • Need roles
        • Need roles in MyST
      • Need views
        • Need views in MyST
      • Importing and extending needs
        • Importing and extending needs in MyST
      • Dynamic functions and filters
        • Dynamic functions and filters in MyST
    • Variants
      • Variants in MyST
    • Test reports: the directives
      • Test reports in MyST
    • Traced source code
    • Templates: generating content from data
    • Directives
      • Admonitions
        • Admonitions in MyST
      • Code and includes
        • Code and includes in MyST
      • Images, figures and video
        • Images, figures and video in MyST
      • Version markers
        • Version markers in MyST
      • Glossary, index, confval and envvar
        • Glossary, index, confval and envvar in MyST
      • Structure and layout
        • Structure and layout in MyST
      • Conditional content
        • Conditional content in MyST
      • Page state
        • Page state in MyST
      • Math
        • Math in MyST
      • Todos
        • Todos in MyST
      • Directives in MyST
    • Layout components
      • Layout components in MyST
    • Diagrams
      • Diagrams in MyST
    • Unsupported syntax
    • Differences from a Sphinx build
    • Writing content in MyST
  • Configuration
    • Needs
    • Card designs with [needs.card_layouts]
    • Field links with [needs.string_links]
    • Schema validation
    • Derived fields
    • Deprecated needs options
    • Codelinks (source code tracing)
    • Test reports
    • Intersphinx
    • Link checking
    • Parsing
    • Linting
    • Formatting
    • Server
    • Project, source & scripts
    • HTML site
    • PDF document
    • Numbering
    • Workflow
    • Quality Analysis

Reference

  • Feature matrix
  • Command line (ubc)
  • Configuration keys
    • [agent]
    • [build.highlight]
    • [build.html]
    • [build.mermaid]
    • [build.numbering]
    • [build.pdf]
    • [build.plantuml]
    • [codelinks]
    • [codelinks_coverage]
    • [format_rst]
    • [intersphinx]
    • [linkcheck]
    • [lint]
    • [needs]
    • [needs_json]
    • [parse]
    • [project]
    • [quality]
    • [reports]
    • [rst_lint]
    • [scripts]
    • [server]
    • [source]
    • [test_reports]
    • [variants]
    • [workflow]
  • VS Code
  • MCP tools
  • Diagnostic codes
  • VS Code features
    • Home view
    • Linting
    • RST preview
    • Realtime index
    • Needs filtering
    • Needs graph view
    • Navigation
    • Site Map
    • Commands
    • Diff & impact analysis
    • needs.json view
  • Query language
  • Languages
  • Supported toolchain
  • What works in imported needs

Concepts

  • Key concepts
    • Glossary
  • Maturity levels

ubCode for teams

  • ubCode for teams
  • Request a license
  • Troubleshooting
  • Report an issue

Development

  • Roadmap
  • Changelog
    • 0.39.x
    • 0.38.x
    • 0.37.x
    • 0.36.x
    • 0.35.x
    • 0.34.x
    • 0.33.x
    • 0.32.x
    • 0.31.x
    • 0.30.x
    • 0.29.x
    • 0.28.x
    • 0.27.x
    • 0.26.x
    • 0.25.x
    • 0.24.x
    • 0.23.x
    • 0.22.x
    • 0.21.x
    • 0.20.x
    • 0.19.x
    • 0.18.x
    • 0.17.x
    • 0.16.x
    • 0.15.x
    • 0.14.x
    • 0.13.x
    • 0.12.x
    • 0.11.x
    • 0.10.x
    • 0.9.x
    • 0.8.x
    • 0.7.x
    • 0.6.x
    • 0.5.x
    • 0.4.x
    • 0.3.x
    • 0.2.x
Back to top
View this page
Edit this page

[codelinks_coverage]¶

Code coverage from the source side: which functions and methods in the codelinks source files trace to no need.

When this table is present (even empty), its settings decide which definitions the coverage report counts and how it judges them. Its keys are inherited one by one: a configuration that extends another, or a -c override, keeps every key it does not set.

Guide: Coverage policy ([codelinks_coverage]).

codelinks_coverage.exclude¶
Type:
array of strings
Default:
[]

Glob patterns of source files to leave out of the count, relative to the directory of the ubproject.toml that sets them.

The files are still read for markers, so the needs they define are unaffected. An invalid pattern is ignored with a warning. Unset: none.

codelinks_coverage.exclude_generated¶
Type:
boolean
Default:
true

Leave out the generated files: those whose leading comments, before any code, hold @generated, or a line with generated and do not edit or do not modify, or a line with automatically generated, auto-generated or autogenerated then by, from or file, or this file is / this file was then generated, auto-generated or automatically generated, or a line with changes made in this file will be lost (Qt’s moc and uic), in any case. Unset: true.

codelinks_coverage.exclude_names¶
Type:
array of strings
Default:
[]

Regular expressions searched in each unit’s qualified name, such as ns::Widget::draw or Shape.area; a unit with a match is left out of the count.

A pattern matches anywhere in the name: anchor it with ^ or a trailing $ to match a prefix or a suffix. An invalid pattern is ignored with a warning. Unset: none.

codelinks_coverage.exclude_tests¶
Type:
boolean
Default:
true

Leave test code out of the count: test files, and the functions, classes and modules the language marks as tests. Unset: true.

codelinks_coverage.gap¶
Type:
boolean
Default:
false

Whether ubc agent reports each untraced unit as a code_untraced gap. Unset: false.

codelinks_coverage.inheritance¶
Type:
string
Default:
"containment"

Whether a marker on a class, module or file traces the units inside it. Unset: containment.

Values:

  • "containment": A marker on a class, module or file also traces the units inside it. The report counts those units apart from the units traced by a marker of their own.

  • "strict": Only a marker on the unit itself traces it.

codelinks_coverage.justification_markers¶
Type:
array of strings
Default:
["codelinks-exclude:"]

Comment markers that justify an untraced unit in the source, each followed by a category and a reason: codelinks-exclude: <category>: <reason>.

An empty list turns in-source justifications off; an empty marker is ignored with a warning. Unset: ["codelinks-exclude:"].

codelinks_coverage.kinds¶
Type:
array of strings

The kinds of definition counted as units: function, method, constructor, destructor and operator. Only a definition with a body is a unit.

Classes, structs, modules and namespaces are never units: they group the units inside them, and a marker on one can trace those units (see inheritance).

Unset: all five. An empty list is reported and counts all five.

Each entry: A kind of definition that can count as a unit.

Values:

  • "function": A function that is not a member of a type.

  • "method": A function that is a member of a class, struct, trait or impl block.

  • "constructor": A constructor.

  • "destructor": A destructor.

  • "operator": An operator overload.

codelinks_coverage.ledger¶
Type:
string

A TOML file of justifications keyed by symbol ID, for code that cannot carry a justification comment, relative to the directory of the ubproject.toml that sets it. Unset: no ledger.

codelinks_coverage.projects¶
Type:
array of strings

The codelinks projects whose source files are counted, by their names under [codelinks.projects].

Unset: every codelinks project. A name that is not a codelinks project is ignored with a warning; an empty list is reported and counts every project.

codelinks_coverage.symbol_fields¶
Type:
string or array of strings

Need fields whose values name the code the need traces to, so a need can trace code from its own side, without a marker in the source.

Each is a custom need field (declared in [needs.fields] or extra_options) holding a string or an array of strings. Each value names a function by its symbol ID (or by the ID without its signature, for every overload), a class, namespace or module by its ID, a file as <language>:<path>, or functions by a /regular expression/ over their IDs. A name that is not such a field is ignored with a warning. Unset: none.

Forms:

  • a string: The name of one need field.

  • an array of strings: The names of several need fields.

codelinks_coverage.visibility¶
Type:
string
Default:
"all"

Which units are counted, by their visibility: all, or only public ones. Unset: all.

Values:

  • "all": Every unit counts.

  • "public": Only the units visible outside their own file or type count.

Next
[format_rst]
Previous
[codelinks]
Copyright © 2026, team useblocks
Made with Sphinx and @pradyunsg's Furo
On this page
  • [codelinks_coverage]
    • codelinks_coverage.exclude
    • codelinks_coverage.exclude_generated
    • codelinks_coverage.exclude_names
    • codelinks_coverage.exclude_tests
    • codelinks_coverage.gap
    • codelinks_coverage.inheritance
    • codelinks_coverage.justification_markers
    • codelinks_coverage.kinds
    • codelinks_coverage.ledger
    • codelinks_coverage.projects
    • codelinks_coverage.symbol_fields
    • codelinks_coverage.visibility