Example calls a function the page does not define
undefined-function-callon by defaultJapanese / English
An example calling a name the page never defines, close to one it documents
Example
How to fix
Call the function the page documents. If it is another function, document it on the page.
Why it matters
When an API reference or a README documents wrap and its example calls wrapText(...), the reader who copies the example stops at "not defined". It happens when a function is renamed and an example keeps the old name, or when the name is mistyped. The first word of a heading (## wrap) and the names an example imports are read as the functions the page documents. A call in a code block to a longer name that starts with one of them, written nowhere else on the page, is pointed out.
What it does not flag
A declaration (function wrapText(), a commented-out call, a function the programming language provides (parseInt, lexicon code-global), a name written anywhere else on the page (defined in the example, called twice, or named in the text), a member call (console.log(, obj.wrapText(), a name that does not start with a documented one, and documented names shorter than four characters are not checked.
Turning it off or relaxing it
Technical details
- Layer
- L1
- Status
- stable
- Severity
- warning
- Languages
- Japanese and English
- Suited to
- technical, docs, blog, legal, academic, literature, speech
- Reads from the document
- markdown
Levels
Set a level for this rule under rules in chaff.yaml. With nothing set, it runs at the level its genre gives it (see By genre below).
| strict | error |
|---|---|
| normal | warning |
| relaxed | info |
This rule has no limit to count to. A level sets how a finding is marked: relaxed keeps the finding and marks it a step lower.
By genre
- Runs by default in
- technical/spec, technical/readme, blog/tech, blog/essay, blog/owned-media, docs/manual, docs/faq, docs/glossary
- Turned off by the genre in
- legal/contract, legal/statute, legal/judgment, legal/patent, academic/paper, literature/fiction, literature/essay, literature/poetry, literature/play, speech/address, speech/transcript
- Not suited to, and not run in
- business/proposal, business/report, business/email, business/press-release, business/meeting-notes
Message
`{name}` is called, but this page documents `{documented}`
This page is built from the rule's definition file:packages/chaff/rules/undefined-function-call.yaml