Skip to content

build(clang-tidy): ignore macros in cognitive complexity - #1238

Merged
castler merged 1 commit into
eclipse-score:mainfrom
castler:config_cognitive_complexity_ignore_macros
Oct 2, 2026
Merged

castler merged 1 commit into
eclipse-score:mainfrom
castler:config_cognitive_complexity_ignore_macros

Conversation

@castler

@castler castler commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Sets readability-function-cognitive-complexity.IgnoreMacros: true in .clang-tidy. Control flow that comes from macro expansions (test/assert macros, etc.) no longer inflates a function's cognitive complexity, so the score reflects the code that is actually written in the function body.

Effect

A local clang-tidy run over //score/... reports 7 distinct readability-function-cognitive-complexity findings with this option, compared to 28 open code-scanning alerts for this check on main before.

Set readability-function-cognitive-complexity.IgnoreMacros to true so
that control flow introduced by macro expansions (e.g. gtest/assert
macros) no longer inflates a function's complexity score. The score then
reflects only the code a reader actually sees in the function body.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@castler
castler marked this pull request as ready for review October 2, 2026 05:28
@castler
castler enabled auto-merge October 2, 2026 06:49
@castler
castler added this pull request to the merge queue Oct 2, 2026
Merged via the queue into eclipse-score:main with commit 8fba14d Oct 2, 2026
18 checks passed
@castler
castler deleted the config_cognitive_complexity_ignore_macros branch October 2, 2026 07:29
@github-project-automation github-project-automation Bot moved this from Backlog to Done in COM - Communication FT Oct 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants