Repository navigation
v2.3.0
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,Resumewith no error,Returnwith 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,
RemafterThen, a#Constdefined 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_outputreturns the rules' own list.
Changed
analyze_modulereturns what XLIDE shows: a runtime-error finding underOn Error Resume Nextis dropped, since the error is handled there, and findings with one code and span are merged.member-not-foundalso works in Word, PowerPoint and Access, where the type library closes the interface.- A hex literal is the signed value of its bits:
&H80000000is -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 asGENERIC_READ = &H80000000,If x Then Debug.Print a; b,AddressOfa Sub,Choosewith 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.