Scan each file for all enabled categories. For each source file:
a. Unclear names: Identify variable, parameter, and function declarations.
Flag single-character names outside for/while loop indices of 5 lines
or fewer. Flag generic names (data, temp, result, val, info,
item, obj, thing, stuff, foo, bar, x, y outside math)
in scopes longer than 3 lines.
b. Nested ternaries: Find ternary operators (?: in C-family,
if/else inline in Python, etc.) where a ternary appears inside another
ternary expression.
c. Unnamed booleans: Find function/method calls with bare boolean
literal arguments. Exclude well-known single-boolean APIs (e.g.,
setVisible(true), Array.sort(reverse=true) with keyword syntax).
d. Clever one-liners: Flag lines that combine 3+ chained operations,
use bitwise operators in non-bitwise contexts, contain inline regex
longer than 40 characters without a comment, or use reduce/fold with
accumulators longer than one line.
e. Restating comments: Find comments directly above or inline with code
where the comment merely describes the operation (e.g., "add 1 to x"
above x += 1). Use simple heuristic: if the comment contains the same
verbs/nouns as the code tokens, flag it.