Skip to content

Unresolved calls

Nick Kwiatkowski edited this page Nov 25, 2026 · 1 revision

Unresolved calls

A call is unresolved when clif cannot follow it to a definition: the receiver has no known component, the component does not declare the method, or the component does not exist. The editor underlines these as you type; the commands on this page report them in batch.

Command Question it answers
clif unresolved Which calls in this project don't resolve?
clif explain Why did this call resolve (or not)?
clif unresolved-diff What did my change to config/resolution do, finding by finding?
clif refs Who calls this function / uses this component?
clif deps What does this file depend on, transitively?

clif unresolved

clif unresolved [options] <dir> [...]

The whole workspace (every folder in workspacePaths) is always indexed, because resolving a call reads every other component. The report holds only what you name: clif unresolved packages/tass/core lists calls under that directory alone.

Options

Option Description
--json Print the findings as a JSON array (see JSON output)
--known-issues Print a known-issues report, paths relative to the config's directory
--relative-to <dir> With --known-issues, make paths relative to this directory instead
--include-workspace With --known-issues, keep entries outside that directory as ../ paths
--write Write the report files named by the config's knownIssues entries with "generate": "unresolved" (default .clif-unresolved.txt beside .clif.json)
--verbose Also list each call that resolved, and the reason behind each entry, on stderr
--global-defs Resolve bare calls against functions declared anywhere in the workspace
--candidates Give each finding a category (object, variable, return-type, method) and the liberal matches a strict resolver refuses, each with a confidence. Shown with --json; they never resolve the call
--one-config Read every file under the first directory's .clif.json rather than each file's nearest config
--no-infer-args Do not type an untyped argument from what its callers pass
--native-engine <name> Runtime API profile: auto (default), generic or lucee

Speculative and audit modes (off by default)

These change what the batch CLI reports; editor diagnostics are not affected. The last of a pair of flags wins.

Option Opposite Description
--speculative --no-speculative Connect an unknown receiver when every finding in its file/function group offers the same sole candidate component. Can accept incorrect calls
--speculative-ranked --no-speculative-ranked Guess the unique best candidate matching the receiver's methods; ties stay unknown
--speculative-native --no-speculative-native Guess a native interface family, then a String/Array/Struct/StringBuilder fallback
--speculative-methods --no-speculative-methods Link calls directly to the nearest workspace declaration of the method name. Recorded in speculativeMethodConnections; never increases the resolved count. Incompatible with --write and --known-issues
--assume-open-world --no-assume-open-world Classify unknown receivers/returns as runtime-provided, absent components as external, bare functions as runtime mixins. JSON becomes an audit object. Incompatible with --write and --known-issues

Examples

# Plain report to a file (progress stays on the console)
clif unresolved ~/projects/myapp > unresolved.txt

# Only one package, as JSON
clif unresolved --json ~/projects/myapp/packages/shop > shop.json

# Regenerate the committed baseline the editor shows as diagnostics
clif unresolved --write ~/projects/myapp

# Include a vendored package the directory walk normally skips
clif unresolved myapp myapp/vendor/wheels

# Provisional audit, for review only
clif unresolved --json --speculative-ranked --speculative-native --assume-open-world project > resolution-audit.json

Text output

One finding per line, path:line: call (reason):

packages/shop/service.cfc:120: svc.getOrder (method 'getOrder' not found in packages.shop.persist)
handlers/main.cfc:31: getUserService().load (component 'app.userservice' does not exist)
tests/specs/UserSpec.cfc:1: testbox.system.BaseSpec (base component does not resolve; 212 inherited calls not checked)
handlers/settings.cfc:48: cborm.models.VirtualEntityService (calls a component whose chain breaks at cborm.models.VirtualEntityService, which does not resolve; 12 calls not checked)

A base component that does not resolve is one entry, not one per call, on the file's extends line. After the list, the command totals these broken bases, most calls first: each is usually one mappings entry or workspacePaths directory away from checking every call it accounts for.

When the box.json beside the config depends on a framework the config does not name (coldbox, testbox, commandbox-migrations, wheels-core, …), the report ends by suggesting the framework preset.

JSON output

--json prints an array of findings:

[
  {
    "file": "packages/shop/service.cfc",
    "line": 120,
    "caller": "placeOrder",
    "variable": "svc",
    "function": "getOrder",
    "reason": "method 'getOrder' not found in packages.shop.persist",
    "text": "svc.getOrder( orderId )"
  }
]
Field Type Description
file string File path
line integer Line of the call
caller string Enclosing function, when there is one
variable string The receiver variable
function string The method called (for a broken base, the base component)
reason string Why it did not resolve
text string The call's source text
this boolean true for an explicit this.method() call
unchecked integer On a broken-base entry: how many inherited calls went unchecked
category string With --candidates: object, variable, return-type or method
candidates array With --candidates: {file, line, confidence, basis[]} liberal matches
candidateCount integer With --candidates: total candidates before display limits
definitions integer Indexed declarations of the function name, stubs included
methodEvidence object {function, indexedDeclarations, sourceDeclarations, nameStatus, relationship, ownership}

nameStatus is one of no-source-declaration, unique-source-declaration, ambiguous-source-declarations. ownership is always unproven: a unique name is a candidate, not proof.

With --assume-open-world (or --speculative-methods) the output is an object instead:

Key Contents
calls Findings that remain
assumedCalls Findings classified by an assumption, each with its original diagnostic and policy
speculativeConnections Proposed receiver connections: {file, line, caller, variable, component, policy, ownership, methods}
speculativeMethodConnections With --speculative-methods: {…call, target, alternatives, targetCount, policy, ownership}
resolved, indexed, scanned Counts

Bounding caller inference

Batch scans type untyped arguments from their indexed callers, with no limits by default. To bound the search, add callerInferenceLimits to .clif.json:

{
  "callerInferenceLimits": {
    "maxCandidateFiles": 512,
    "maxCallerFiles": 60,
    "maxCallSites": 40,
    "maxConstructorFiles": 60
  }
}
Key Counts
maxCandidateFiles Lexical candidate files for ordinary methods
maxCallerFiles Files with calls belonging to the target method
maxCallSites Supplied argument sites for methods and constructors
maxConstructorFiles Constructor candidate files

A positive value enables that limit; omitted, zero or negative means unlimited. {} resets all limits. Exceeding a limit withholds the inferred type, which can leave valid calls reported as unresolved.


clif explain

clif explain [--root <dir>] [--no-infer-args] <file> <line> [call-substring]

Traces each call site on a 1-based line: which rule typed the receiver, which componentResolver fired for each hop of a chain, and whether the method was found. The last line says what unresolved does with the call: counts it, sets it aside as a built-in, or reports it.

Argument / option Description
<file> The CFML file
<line> 1-based line number
[call-substring] Keep only calls whose text contains this
--root <dir> Read .clif.json and index files from this directory, as unresolved's directory argument does (default: the file's own directory)
--no-infer-args Do not type untyped arguments from their callers
clif explain directcontent.cfc 104
clif explain directcontent.cfc 104 createTemplate
clif explain --root ../tassweb/webroot directcontent.cfc 104

Use --root when the report came from a project-wide scan whose config differs from the one nearest the file. The editor offers the same trace as the code action "Explain call resolution on line N" (command clif.explainCall).


clif unresolved-diff

clif unresolved-diff [--show <n>] [--root <dir>] <before.json> <after.json>

Compares two clif unresolved --json runs finding by finding, so a change that breaks one file and fixes another is visible even when the total stays the same.

Option Default Description
--show <n> 5 Examples listed per reason group; 0 prints only the counts line
--root <dir> — Show and compare paths relative to this directory, so runs from two checkouts line up
old/clif unresolved --json ~/src/app > before.json
new/clif unresolved --json ~/src/app > after.json
clif unresolved-diff --root ~/src/app before.json after.json

A finding is the same in both when its file, line, function and reason match; a count inside a reason ("12 inherited calls not checked") is not a difference. Exit status is always 0.


clif refs

clif refs [--mermaid] <component-or-function> <dir> [...]

Finds references to a component (a dot-path) or a function (a bare name), as JSON.

Option Description
--mermaid Print a Mermaid diagram instead of JSON
clif refs packages.finance.service ./src
clif refs getReport ./src
clif refs --mermaid getReport ./src > refs.mmd

Each reference reports its file, line, enclosing function, variable, call text, the component, and whether it resolved to the target. In the editor the same search is clif.findRefs and, when enabled, "Find All References".


clif deps

clif deps [--mermaid] <dir-or-file> [...]

Prints the transitive dependency graph of the given files as JSON: the components they instantiate, extend, include and call into, followed recursively.

Option Description
--mermaid Print a Mermaid diagram instead
clif deps handlers/orders.cfc
clif deps --mermaid handlers/orders.cfc > orders-deps.mmd

For whole-project structure use clif graph instead.

← Running the CLIF command-line tool · Home

Clone this wiki locally