Skip to content

v0.9.11 — Repairs

Choose a tag to compare

@nrodear nrodear released this 03 Aug 20:29
· 257 commits to main since this release

A fix release, one day after 0.9.10. No new rules, no new features. Everything
here is one of three things: a false positive proven on the reference corpus,
a regression that crept in with 0.9.10, or a version number that had quietly
stopped being true.

On the 13,355-file reference corpus the finding count goes 560,964 →
560,073 (−891)
. Exactly two rules move, and nothing is added — not one
new finding, not one new message shape. The other 139 rules are untouched.

Full notes: docs/releases/v0.9.11.md
· deutsch

Scrolling in the IDE plugin

The complaint was that it had got worse. It had — and it was a combination,
not one mistake.

  • The gutter bracket asks for every line. PaintLine checks whether a
    line is marked and leaves immediately if not. PaintGutter, added in
    0.9.10, went straight to the lookup, so every visible line began paying.
  • Continuation lines are marks now. A DuplicateBlock over 21 lines turns
    one marked line into twenty-one, and marked lines run the expensive branch.
    That is the feature working as intended — but it multiplied everything else.
  • Every scroll event forced a full repaint, on top of the one the editor
    already performs, and one wheel notch delivers several events. The call is
    necessary (the editor blits the lines it moves, so the per-line callback
    never fires for them), so it is coalesced through a 90 ms settle timer that
    fires once, when the movement stops.

And every cell of the findings grid was painted twice. The renderer draws
background, selection and text itself, header included — but DefaultDrawing
was never switched off, so the grid painted each cell in full first. Roughly
300 redundant cell paints per frame at six columns and fifty rows. The panel
grid had it right from the start; the main grid was the outlier.

SCA028 — two kinds of non-finding

  • An event bound to nil is not a missing handler.
    OnCustomDrawItem = nil says the opposite. Filtered at the source, because
    four detectors share that event list.
  • An ancestor resolved from an ambiguous name proves nothing.
    TfrmSplashScreen inherits from TfrmBase — and skia4delphi carries
    TfrmBase twice, in its VCL and its FMX sample tree. Only the VCL one
    declares the handler; the class index kept the first hit and dropped the
    rest silently, so the form was bound against the wrong base. The index now
    records which class names live in more than one unit, and the rule stays
    quiet for bindings reached through such a name.

Deliberately not patched over: a property whose name starts with On
need not be an event. TJvUIBQuery.OnError = etmStayIn assigns an enum.
In DFM text the two are indistinguishable, and a spelling heuristic is out —
enum literals (etmStayIn) and IDE-generated handlers (btnOkClick) have
exactly the same shape.

SCA054 — asking the source before claiming absence

The body this rule counts against is assembled from the name and type text of
AST nodes: a lossy approximation. The index expression on the left of an
assignment and the arguments behind an as cast never appear in it. Both
reproduced on the built analyser. The rule now asks the source before
claiming a parameter is never read — strings and comments stripped, so a name
in a comment is still not a use.

14,859 → 13,970 (−889, −6.0 %), zero added. Eight drops were sampled and
read in the source; every one is a genuine read:

FList[Index] := Item;                                  // index on the left
(FParent as TJvVisualId3v2).FTreeView.Width := Value;  // behind an as-cast

SCA099 IfElseBeginstyle

The analysis behind the profile split named seven convention rules; 0.9.10
shipped with six. IfElseBegin was left behind for no stated reason — same
shape as BeginEndRequired, which did move. On the corpus it is 14,982
findings (2.7 %), so default now shows 4.9 % less. strict is unaffected.

Version numbers that had stopped being true

The IDE plugin announced itself as v0.9.8 in its window title — hardcoded,
two releases behind — and the installer script carried the same number. Six
places hold the version, not four; they are now listed in the installer script
so the next bump has them in one place.

Upgrading

Nothing to do. No fingerprint changes, no baseline needs rewriting. If you
rely on SCA099 being part of default, use --profile strict or add
--profile style as a second run.

Downloads

  • StaticCodeAnalyser-v0.9.11-Win64.zip — standalone analyser, 64-bit
  • StaticCodeAnalyser-v0.9.11-Win32.zip — standalone analyser, 32-bit
  • StaticCodeAnalyser-v0.9.11-source.zip — full source