objectionary / objectionary/lints

Dead 'dups' mode template in duplicate-aliases.xsl emitting outdated 'error' element

Open
#1,270 2 comments 0 reactions 1 assignee View on GitHub

@yegor256 is already working on this.

Since Aug 21, 2026.

bug good-title
Dominant language
Java
Stars
14
Forks
39
Avg merge
22h 54m
Merged PRs (30d)
90

Description

Problem

duplicate-aliases.xsl contains a dead template (mode="dups") that is never invoked, and it emits an outdated <error> element instead of a <defect>.

Details

src/main/resources/org/eolang/lints/aliases/duplicate-aliases.xsl:37-54:

<xsl:template match="meta" mode="dups">
  <xsl:for-each select="/object/metas/meta[head='alias']">
    ...
    <error>
      ...
    </error>
  </xsl:for-each>
</xsl:template>

Two issues:

  1. Dead code. The mode="dups" template is declared but never invoked — there is no <xsl:apply-templates ... mode="dups"> anywhere in the file (confirmed by grep: the only occurrence of dups is the template declaration). So this template never runs and produces nothing.

  2. Outdated element name. Even if it were invoked, it emits <error> (the old defect format used by eo-parser), while the project's defect contract is <defect> (see LtByXsl / the existing packs for this lint, which assert against /defects/defect). The real, active logic of the lint lives in the default template above it, which correctly produces <defect>.

Impact

  • Dead code adds confusion: a reader may think the mode="dups" path is part of the lint's behavior, but it is unreachable.
  • If someone "fixes" the invocation later, the lint would start emitting <error> elements that break the /defects/defect contract and would not be picked up by LtByXsl.
  • Minor, but it is the kind of leftover that the errors/empty-object or comment-without-dot lints got cleaned up of before.

Expected behaviour

Remove the dead mode="dups" template (and any <error> usage) so the file contains only the working <defect>-based logic. A simple code cleanup with no behavior change.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.