Repository navigation
Memtrace v1.2.19
Memtrace v1.2.19
Dead-code findings checked against your source
Changed
find_dead_codeand the dead-code list in/uinow show only findings Memtrace could confirm: nothing reaches the function, and its name is used nowhere else in your source. Each result has anevidencefield that says so. Functions that are only missing a call path are left out unless you passmin_confidence: "low".- The dead-code part of the health grade now scores confirmed findings only. It says how many functions were left out because their name is in use, and reports the dimension as partial when the source could not be checked.
- The first start after this update re-reads each indexed repository once, so the call-linking fixes below also reach code that was already indexed. It can take a few minutes on a large repository. Where Memtrace does not index at start, because the store is large or start-up indexing is turned off, it now lists the repositories that still have an older graph and the command that re-reads them.
Fixed
- Live code is no longer reported as dead when Memtrace cannot follow a call, such as a method reached through a field, a call through a trait object or interface, or a function kept in a table. One Rust service had 863 functions listed, every one of them in use, and a health grade of C because of it.
- A program is no longer reported as entirely dead when its starting point was not recognised: a C#
Main, a script started by code at the top of the file, or a function a framework starts through an attribute, annotation or decorator. - Closures and lambdas, trait and interface methods without a body, and generated accessors are no longer listed as dead code in any language.
- A function stored as an object property, and a method that overrides one declared elsewhere, now count as used.
- A method written only to satisfy an interface, protocol or abstract class is no longer listed as dead code. A Go marker method that nothing calls is one example: deleting it breaks the type.
- In Rust, Go, Lua and Kotlin, a call whose result is stored in a local of the same name, as in
let keys = keys(raw), is now linked to the function. - In Rust, a function called inside a macro's arguments, as in
vec![make(1)],assert_eq!(check(x), 1)orprintln!("{}", shown(x)), now has that call in the graph. Before, a function called only that way had no callers. - When a workspace graph could not be brought up to date, Memtrace now names the command that rebuilds that workspace. It used to say to run
memtrace indexinside the repository, which builds a separate graph for that one repository and leaves the workspace as it was. - A repository whose graph an earlier version built, and which has to be re-indexed before edits can be applied, is no longer reported as up to date at start. Memtrace now says so and names the command. Before, its saves were never applied and nothing said why.
- The first start after an update no longer sits on
Connectingwhile the store upgrades its index. The terminal now shows how far the upgrade is. On one 2.5 GB store it ran for eleven minutes with nothing else on screen. - Git's line-ending warnings no longer spill into the terminal while Memtrace compares a repository with your checkout.
- When a start is refused because the store belongs to a different set of repositories, the message now lists them by name and folder.
Install
npm install -g memtrace