Practise vocabulary for static analysis tools: AST traversal, visitor patterns, auto-fix, rules, plugins, and eslint/semgrep vocabulary.
0 / 5 completed
1 / 5
Static analysis examines source code ___ without executing it, to find bugs, style violations, security issues, or anti-patterns.
Static analysis (linting, type checking, code scanning) analyses code without running it — detecting issues at development time before deployment. Examples: ESLint (JavaScript), mypy (Python), Semgrep (multi-language security patterns).
2 / 5
A ___ pattern in AST-based linting visits each node type in the syntax tree, running the rule's check when a matching node is encountered.
The Visitor pattern is the foundation of AST-based linting: each rule registers visitors for specific node types ('CallExpression', 'ImportDeclaration'). As the traversal encounters each node, it calls the relevant visitor functions.
3 / 5
An ESLint ___ is an object containing metadata and visitor functions that detects a specific code pattern and optionally fixes it.
An ESLint rule is the atomic unit of analysis: it declares its severity, provides visitor functions for specific AST nodes, and optionally provides a 'fix' function that modifies the AST to auto-correct the violation.
4 / 5
Auto-fix in a linter ___ the code to comply with the rule, without requiring manual edits — triggered by --fix flag or IDE quick action.
Auto-fix generates AST or text transformations to correct violations: adding missing semicolons, reformatting imports, replacing deprecated APIs. The linter applies the transformation to the source file, saving manual correction work.
5 / 5
Semgrep uses ___ patterns that match code structures across multiple languages without needing language-specific AST visitors.
Semgrep's declarative patterns (e.g., `os.system(...)`) match structural code patterns across languages using a unified syntax. No need to write AST visitor code — the pattern language handles most common cases, making security rule authoring accessible to non-compiler-engineers.