liveBook · Manning

Static analysis

As explained in Vibe Engineering

The automated examination of source code without executing it to identify defects, suspicious constructs, policy violations, or program properties.

Static analysis examines source code without executing it. Linters and security scanners look for suspicious patterns that may be syntactically valid but unsafe or inadvisable. These checks are useful for reviewing generated code, but a clean scan does not establish that the code behaves as intended. section 8.2.2 section 8.2.6

Flagging a vulnerable regular expression

A markup parser can use a regular expression to recognize bold text. A pattern with a repeated group containing another repetition can take exponentially longer on input that never closes the delimiter. In TypeScript, ESLint with the installed and enabled eslint-plugin-security can flag this pattern before execution. The rule also flags some safe expressions, so investigate warnings rather than treating every one as a confirmed vulnerability. section 8.2.2

const BOLD = /\*\*([^*]+)+\*\*/;

The inner and outer + quantifiers make this bold-text pattern a candidate for excessive backtracking. section 8.2.2

Static analysis can also support language-aware refactoring. When an AI-assisted package rename missed references and folder names, the application failed to compile; an IDE refactoring produced a change that compiled. For changes that can be inferred statically, a dedicated refactoring tool can be a more reliable and cheaper choice than repeated AI prompts. section 2.8.1

Use static checks as an always-on gate, not a substitute for execution. Tests must still check whether inputs produce the required outputs. Similarly, code inspection can suggest performance hot spots, but runtime measurements are needed to decide where optimization will matter. Add stronger verification when untrusted input, complex logic, integrations, or critical systems justify its cost. section 8.2.6 section 7.3.1 section 8.8.2

How Vibe Engineering covers it

How deep it goes
Explains linter warnings and false positives through a regex example, while distinguishing static checks from behavioral verification.
Examples
Uses a vulnerable bold-text regex and a package rename that fails to compile after an AI-assisted change.
What you can do after
Apply it via ESLint and eslint-plugin-security to flag potentially unsafe regular expressions, then assess the warnings.
How it connects
Connects static analysis to linting, security scanning, refactoring, testing, and runtime measurement.

Also explained in

Compare how 11 books explain static analysis →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Vibe Engineering. The section links point to the parts of the book it draws on.