# `MishkaCmsCore.Runtime.PageBuilder.CodeFlags`
[🔗](https://github.com/mishka-group/mishka_cms_core/blob/v0.0.1/lib/mishka_cms_core/runtime/page_builder/code_flags.ex#L5)

One short warning for a snippet that calls something worth reading twice.

Drawn as a single badge beside the handler, message clause or helper it belongs to, in the Code
window the author is already looking at. There is deliberately no second screen for this: the
editor shows a document's code, so the warning belongs next to the code and not in a report
somewhere else.

## Triage, not a verdict

A snippet with no badge is **not** thereby safe. Everything matched here can be spelled another way
— `apply(mod, fun, args)`, a module in a variable — so the badge answers "read this one first",
never "the rest are fine". The resource's policies and `CodeAccess`'s deployment switch decide who
may write code at all; this only points.

## Read off the parsed code, not the text

A pattern over the source would flag a mention in a comment or inside a string, which costs somebody
ten minutes for nothing:

    # System.cmd is not called here     -> no badge
    "System.cmd"                        -> no badge
    System.cmd("ls", [])                -> badge

One badge per snippet: the most alarming thing it does is the thing that gets someone to look, and
a row of five labels is noise on a screen that is mostly code.

# `badge`

```elixir
@spec badge(String.t() | nil) :: String.t() | nil
```

The one warning for this snippet, or `nil` when there is nothing to say.

Unparseable code answers `nil` rather than a warning of its own: the author is mid-sentence in a
box they are typing into, and `CodeCheck` is what tells them the code will not compile.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
