Conversation
Adds a new design lint that counts EO's only expressible decision points - a standalone "while" and any "if"/"and"/"or" dispatch - per formation, and warns when the resulting cyclomatic complexity exceeds ten. Since EO gives no way to tell a boolean dispatch from a same-named method of an unrelated object without type inference, the defect is marked experimental, the same way other heuristic design lints (broad-scope, sparse-decoration, unoptimizable-recursion) are. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UYLcdVGK73NpHUbiyaTx3r
vale's Vale.Spelling rule doesn't know "cyclomatic" or "boolean", and the motive's prose tripped Microsoft.Adverbs, Microsoft.SentenceLength, Google.Semicolons and Microsoft.Wordiness. Add the two words to the custom vocabulary and rewrite the paragraph into shorter sentences. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UYLcdVGK73NpHUbiyaTx3r
yegor256
marked this pull request as ready for review
September 19, 2026 06:39
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix #467
What
Adds a new
designlint,cyclomatic-complexity:src/main/resources/org/eolang/lints/design/cyclomatic-complexity.xslsrc/main/resources/org/eolang/motives/design/cyclomatic-complexity.mdsrc/test/resources/org/eolang/lints/packs/single/cyclomatic-complexity/*.yamlIt also adds
"cyclomatic"to the spell-checker's ignore list insrc/test/java/matchers/GrammarMatcher.java, since the word is flaggedas a misspelling by the English dictionary the tests use.
Why
#467 asks for a cyclomatic-complexity-style lint. The thread on the issue
worked through why a full CFG/McCabe metric is not decidable in EO
(
if/and/orare ordinary method dispatches, so telling a booleandispatch apart from a same-named method of an unrelated object needs
type inference we don't have), and landed on a heuristic: count a
standalone
whileand anyif/and/ordispatch as a decision point,the way
broad-scope.xslandsparse-decoration.xslalready acceptheuristic false positives for other design smells. Because of that, the
defect is marked
experimental, consistent with how this codebasealready flags other heuristic-based design lints
(
excessive-visibility,unoptimizable-recursion).How it works
For every formation (
o[eo:abstract(.) and @name and o[@name='φ']],skipping auto-named cactus formations the way
unoptimizable-recursiondoes), the lint counts decision points in its own body — a dispatch
whose
@base's last.-separated segment isif,and, oror, or astandalone
Φ.while— excluding decision points that belong to a nestedformation (which are counted against that nested formation instead, the
same way a Java method's cyclomatic complexity excludes the branches of
methods it calls). The complexity is
1 + decisions; when it exceeds10, a warning is raised.Tests
catches-too-complex-formation.yaml— 11 decision points (complexity12) trigger the defect
allows-simple-formation.yaml— 2 decision points (complexity 3) donot
allows-outer-formation-when-only-nested-is-complex.yaml— a nestedformation's 11 decisions are attributed to it, not to the enclosing
formation, which stays under the threshold
mvn test(full suite) andmvn clean install -Pquliceboth passlocally.
🤖 Generated with Claude Code
https://claude.ai/code/session_01UYLcdVGK73NpHUbiyaTx3r
Generated by Claude Code