objectionary / objectionary/lints
`too-deep-object` lint tool reports multiple defects for single nesting chain and emits incorrect depth number
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 14
- Forks
- 39
- Avg merge
- 22h 54m
- Merged PRs (30d)
- 90
Description
Problem
too-deep-object reports several defects along a single nesting chain (a cascade) and prints a depth number that does not match the rule's threshold, confusing the user.
Root cause
src/main/resources/org/eolang/lints/design/too-deep-object.xsl:13 (selector) and :28 (message):
- The selector excludes certain wrapper objects (
Φ.tuple,Φ.bytes,Φ.number,Φ.string) from the depth count, while the message prints the rawcount(ancestor::o)— so the number in the text (e.g. "17 levels") differs from the filtered depth that triggered the rule. - Because of the counting difference, more than one node per chain can match the
not(o[count(ancestor::o[...]) > 12])guard, producing a cascade of defects for one chain (observed: defects at depths 13/14/15/17 for a 15-level chain). - For data objects the message prints
eo:escape(@base)which yields an empty/∅name.
Minimal example
+package x
+architect yegor@256.com
+version 0.0.1
+home https://github.com/objectionary
+spdx SPDX-FileCopyrightText: Copyright (c) 2026 Objectionary.com
+spdx SPDX-License-Identifier: MIT
[] > main
[] > a
[] > b
[] > c
[] > d
[] > e
[] > f
[] > g
[] > h
[] > i
[] > j
[] > k
[] > l
[] > m
1 > @
Expected behavior
- The depth number in the message must use the same (filtered) metric as the selector.
- Only the deepest offending node of a branch should be reported.
- Use
@name(or a clear label) instead of@basefor formations.
Related
- #155 (the lint itself, merged); the cascade/off-by-N behavior is a new regression on top of it.
design/category siblings (broad-scope,excessive-visibility).
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with src/main/resources/org/eolang/lints/design/too-deep-object.xsl, especially the selector at line 13 and message at line 28. Align the reported depth with the filtered metric, report only the deepest offending node in a branch, and use @name or another clear label for formations; verify the minimal example no longer produces cascaded defects.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 72/100