Skip to content

CFML: dotted extends fails when a second component with the same path suffix exists (e.g. a mirrored test tree) #2650

Closed

Description

@HarryMuc

Summary

In 1.6.2, extends="contenscms.core.basecore" stays unresolved in 234 components of our project, although the target contens/core/basecore.cfc exists and is indexed as a class.

Every failing case has a test mirror with the same trailing path:

contens/core/basecore.cfc
tests/testbox/tests/specs/unit/core/basecore.cfc   <- also ends in core/basecore

Observations

Dotted name Result Other file with the same suffix
contenscms.core.baseclass ✅ resolved (resolvedBy: "qualified-name") none
contenscms.core.baseform ✅ resolved none
contenscms.core.basecore ❌ unresolved (234×) tests/.../unit/core/basecore.cfc
contenscms.core.data.filedb ❌ unresolved tests/.../unit/core/data/filedb.cfc
contenscms.core.search.agent ❌ unresolved tests/.../unit/core/search/agent.cfc
contenscms.core.archive.filesarchive ❌ unresolved tests/.../unit/core/archive/filesarchive.cfc
contenscms.Application ❌ unresolved (19×) six Application.cfc files in the project

In total, 282 extends are unresolved and 2342 are resolved.

Why the resolver can only guess

The first segment contenscms is a server-level CFML mapping (/contenscms → <repo>/contens/), defined in the engine admin and not in Application.cfc. The resolver can therefore only match on a path suffix, and two candidates match.

Impact

The base class of 234 components is missing from the graph, so their inherited calls and their impact are incomplete.

Suggestions

Either one would fix it:

  1. A mapping option in codegraph.json, for example:

    {
      "cfml": {
        "mappings": { "contenscms": "contens" }
      }
    }

    CFML projects almost always rely on such mappings, so this would help other projects too.

  2. A tiebreak when several files match the suffix: prefer the candidate whose path matches the most segments of the dotted name, or deprioritize test directories.

Activity

  1. added a commit that references this issue on Oct 23, 2026
    e275915
  2. colbymchenry commented on Oct 23, 2026

    @colbymchenry
    Owner

    Thanks for the detailed report and the table; it made this easy to pin down.

    #2835 is merged to main. A component in a test suite is no longer a candidate for a dotted extends written in application code. When a test file's path ties between a component and a spec that mirrors it, the component wins. So extends="contenscms.core.basecore" now links to contens/core/basecore.cfc.

    extends="contenscms.Application" still stays unlinked, because no folder in that path points at one of the Application.cfc files. That needs your first suggestion, a mapping option in codegraph.json, which we're treating as a separate feature.

    It ships in the next release; re-index after upgrading to pick up the missing base classes.

  3. added a commit that references this issue on Oct 23, 2026
    51c4124
  4. HarryMuc commented on Oct 28, 2026

    @HarryMuc
    Author

    Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions