Skip to content

v2.3.0

Choose a tag to compare

@WilliamSmithEdward WilliamSmithEdward released this 27 Sep 04:03
· 65 commits to main since this release

Follows XLIDE 10.14.0, from 10.7.1. Upstream measured its analyzer against Excel, Word and PowerPoint and answered each finding (XLIDE issues #96 to #148): 34 new diagnostics, 19 of them runtime errors in code the VBE compiles, and false positives removed on code that compiles and runs. The full list is in CHANGELOG.md.

Added

  • Runtime errors the code proves: Integer overflow such as 60 * 60 * 24, a For counter that passes its type, an error handler fallen into, Resume with no error, Return with no GoSub, a property that calls itself, a Collection index or key no element has, a key added twice, a Variant used as an object, a late-bound member that is not there, index 0 into an Office collection, Cells(0, 1), a multi-cell range read as a value, a sheet name Excel refuses, and file numbers used after Close, twice or in the wrong mode.
  • Compile errors: a Const or literal that overflows, a ByVal or Optional array parameter, a bracketed variable name, a second Deftype for a letter, a Collection beside an operator, a Sub read as a value, an Implements member missing or with another signature, Rem after Then, a #Const defined twice or code after a directive, characters VBA does not use, a line over 1023 characters, and date literals the VBE refuses.
  • AnalyzeModuleOptions.raw_rule_output returns the rules' own list.

Changed

  • analyze_module returns what XLIDE shows: a runtime-error finding under On Error Resume Next is dropped, since the error is handled there, and findings with one code and span are merged.
  • member-not-found also works in Word, PowerPoint and Access, where the type library closes the interface.
  • A hex literal is the signed value of its bits: &H80000000 is -2147483648.

Fixed

  • False positives on code that compiles and runs, among them If c Is Nothing Then Set c = New Collection, Err.Raise vbObjectError + 513, Win32 flag Enums such as GENERIC_READ = &H80000000, If x Then Debug.Print a; b, AddressOf a Sub, Choose with more than two choices, On Local Error, DAO constants in Access, and a division the code guards.
  • A procedure nested about 490 blocks deep raised RecursionError. The VBE compiles a thousand levels, and the port now analyzes them.

Performance

A 500-line With block took 14.2 seconds in 2.2.1 and takes 0.19, and a 3,000-member chain took 16 seconds and takes 0.56. On two parts of the test corpus's Office files, analysis is 12% faster than in 2.2.1, new rules included.

Verified

Upstream's own 10.14.0 test suite replays through the port identically (1419 standalone and 992 project calls), and the oracle corpus, 16 real workbooks, 195 Office files of every host, 693 further projects and 7 VB6 projects give identical findings from both analyzers.