altcover.visualizer 8.2.822

There is a newer version of this package available.
See the version list below for details.
The owner has unlisted this package. This could mean that the package is deprecated, has security vulnerabilities or shouldn't be used anymore.
dotnet tool install --global altcover.visualizer --version 8.2.822
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest # if you are setting up this repo
dotnet tool install --local altcover.visualizer --version 8.2.822
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=altcover.visualizer&version=8.2.822
nuke :add-package altcover.visualizer --version 8.2.822

altcover.visualizer

A global tool for displaying code coverage in a number of formats (NCover 1.x, OpenCover, LCov, Cobertura, coverlet,...), using the the cross-platform AvaloniaUI toolkit

Visualizer screenshot

User Guide

Full wiki page here

Here's the simple naming of parts

Annotated

The recently accessed list is a drop-down for quick access to coverage files of current interest. The Refresh option is there for reloading the file you're currently examining e.g. after doing another test run.

The tree view opens with just the node for the coverage file shown. Drill down to the method of interest and double-click to load the appropriate source file.

The tree view shows the structure of the assemblies in the report, including virtual groupings for modules (classes that only contain classes, so have no presence in the XML reports), (as seen in the inset) for properties (get_ and/or set_), and for events (add_ and/or remove_). Also where a type is just a function (i.e. only has an Invoke method), there is separate icon for that.

Colouring

A painter's algorithm approach is used -- first the whole source file is drawn, then the covered sections, then the un-covered ones, and finally any special cases. This approach ensures that the uncovered code is shown explicitly and is not obscured when some of the line, or a multi-line enclosing sequence point, happens to be covered : it's the unflattering view for engineers, rather than the sea of green for managers.

If the coverage file contains branch information, then an icon is shown in the left margin, in red-on-white for uncovered, black-on-yellow for partial coverage and black-on-pale green for complete coverage, with the details in tool-tip text for that icon.

The source is rendered by default in grey-on-whitesmoke; covered sequence-points are painted a medium blue, and then uncovered code is painted in crimson.

With coverage generated from AltCover with the --showstatic option, normally ignored code like auto-properties is shown in the report, and if not covered will appear as black, and with the --showGenerated option other code marked as [GeneratedCode] or [CompilerGenerated] shows as gold if not covered.

Annotated v6.6 - static and generated code

For purposes of demonstration, one test method here has been manually decorated with the [GeneratedCode] attribute; if the system under test uses code generation, marking it as such should be standard practice.

Source display font

From v7.1.783, this visualizer version also offers some limited font selection for source display

Tool-bar with font selection icon

  • On Windows, this uses the native FontChooser() API, restricting to monospace fonts (the default is "Courier New Normal 10")
  • Otherwise if the Tcl/Tk wish shell (assumed to be Tcl/Tk v8.6 or later) is on the PATH, the toolbar-icon is also shown. In the latter case, this spawns wish as a separate process to use its cross-platform font selection support; terminating the process when either a font selection is made (e.g. via Okor Apply), or the selection dialog is dismissed. There are no APIs there to restrict the font chooser to monospace fonts, so choose wisely (the default is "Monospace Normal 10")

Continuous Integration

Build GitHub Build statusBuild history AppVeyor Build status Build history
Test coverage Coveralls Coverage Status AppVeyor Test status
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.1 is compatible.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last updated
8.8.21 319 4/15/2024
8.8.10 232 4/6/2024
8.7.3 330 3/14/2024
8.6.125 995 1/4/2024
8.6.95 733 11/14/2023
8.6.68 10,162 7/10/2023
8.6.61 535 6/6/2023
8.6.48 5,779 3/22/2023
8.6.14 1,371 1/1/2023
8.5.842 609 12/25/2022
8.5.841 732 11/19/2022
8.4.840 855 10/17/2022
8.3.839 750 9/13/2022

This build from https://github.com/SteveGilham/altcover/tree/5611ba16eb100b83c2dc351a33596e9fbb1f19e2

Q. Never mind the fluff -- how do I get started?
A. Start with the Quick Start guide : https://github.com/SteveGilham/altcover/wiki/QuickStart-Guide
8.2.822 (Habu series release 6a)
• [VISUALIZER] Support OpenCover's output from C++/CLI assemblies compiled /Zi (line information only, zero column values)
  ◦ account for (& simplify) the C++/CLI attribute decorations in method names
  ◦ allow for (& simplify) gcroot<type::with::Cpp::namespacing ^> types in method names
  ◦ allow source file selection for methods with code inlined from multiple source files
8.2.821 (Habu series release 6)
• Support deterministic builds /p:ContinuousIntegrationBuild=true, with or without --sourcelink//p:AltCoverSourceLink=true.  Note that assemblies created by deterministic builds will be excluded by -l//p:AltCoverLocalSource=true.
• Experiment with the ReadMe feature recently added to NuGet
• Internal refactoring of the JSON processing following the replacement of System.Text.Encodings.Web in the previous release.
8.2.820 (Habu series release 5)
• Replace System.Text.Encodings.Web for JSON-escaping module, class and method names
• [BUGFIX] issue #125 -- prevent an NullReferenceException is some cases of computing cyclomatic complexity (a failure to exactly copy the algorithm from Mono.Gendarme)
• [ENHANCEMENT; API] issue #126 -- further generalise the relative-directory support for CopyAlways/CopyIfNewer from v7.4; extends the ContingentCopy MSBuild task
8.1.819 (Habu series release 4)
• Adapt to recent F# compiler optimizations that make function objects static if they don't close over their environment -- properly detect their owner functions for exclusion and for JSON format output
• If the report format is JSON, ensure that the coverage file doesn't end .xml, and if not JSON, that it doesn't end .json (case-blind comparison)
8.1.817 (Habu series release 3)
• Merge-OpenCover cmdlet and OpenCover.Merge API.  It should handle both strict (OpenCover, AltCover --reportFormat=OpenCover) and more relaxed (coverlet, ConvertFrom-CoverageJson, Write-OpenCoverDerivedState -Coverlet) interpretations
• When --callContext indicates a method returning an F# async computation, then track all calls within the same async flow, just as with C# async methods from v7.2.800
8.0.816 (Habu series release 2)
• Move to Cake 1.0 as baseline for Cake support
• [VISUALIZER] Support for LCov and Cobertura format reports
• [VISUALIZER] For formats with only line-level information (e.g. LCov, Covertura or from coverlet), colour the whole line, and not just the line number gutter
8.0.815 (Habu series release 1)
• [BUGFIX] Issue 122 -- rework the method name tokenization for extracting the returnType (argumentList) signature values in the Cobertura output, fixing an off-by-one error that generated returnType argumentList) without the ( as well as the headline exception.
• [NEW] Native JSON report formatting (--reportFormat=Json or equivalents), a superset of coverlet's JSON
  ◦ AltCover classic mode -- just running the instrumented code and collecting results in the ProcessExit handler -- is not supported with --reportFormat=Json
  ◦ ConvertFrom-CoverageJson cmdlet to convert from coverlet or AltCover JSON to a miminal OpenCover format
  ◦ Preparing as Native JSON, to generate an LCov or Cobertura report at collection is supported
• [VISUALIZER] Both versions will now consume and display from coverlet and AltCover JSON output
• [BREAKING] the -x, --xmlReport argument or equivalent becomes just -r, --report since not all reports are XML
• [BREAKING] the stop-gap --jsonReport collection option from v7.6 is withdrawn, and the related ConvertTo-CoverageJson cmdlet now produces the AltCover native JSON format
• For both LCov and Cobertura output, coalesce cases of multiple sequence points per line into one entry per line
• Extensions to coverlet's JSON format are as follows
  ◦ Method has optional fields
    ⁃ SeqPnts (array of SeqPnt)
    ⁃ TId (integer tracking ID)
    ⁃ Entry and
    ⁃ Exit (arrays of timestamps)
  ◦ BranchInfo has optional fields
    ⁃ Id (integer unique ID)
    ⁃ Times (array of timestamps) and
    ⁃ Tracks (array of tracking IDs)
  ◦ SeqPnt is VC (visit count), SL (start line), SC (start column), EL, EC (ditto for end), Offset, Id, all integers, and optional Times and Tracks as for BranchInfo
  ◦ Because int64 doesn't fit as a double, tracking-related timestamps are represented as Base64Encoded strings of the ticks count as a network byte order quantity Convert.ToBase64String(BitConverter.GetBytes(IPAddresss.HostToNetworkOrder(ticks)))
7.6.812 (Genbu series release 15)
• [VISUALIZER] Move the global tool to the new 0.10 AvaloniaUI release
• Monitor API
  ◦ [BUGFIX] Harden the monitor API TryGetVisitTotals against race conditions in multi-threaded tests
  ◦ Publish the AltCover.Monitor API as API (i.e. under lib/) in the main package altcover as well as in altcover.api (but not in altcover.global; global tools aren't library compatible to be accessed through a package add reference).  It's there next to the PowerShell assembly (per altcover ImportModule) if you want to manually link to it, though
  ◦ Support writing unit tests involving the API back to net20 as well as netstandard2.0
• Add --jsonReport option (and equivalents) to output the NCover or OpenCover data in a minified JSON format, like the existing --lcovReport option does for that format.  The JSON is a direct map of the XML, with values appropriately typed.
• Add a ConvertTo-CoverageJson cmdlet and a ConvertToJson toolkit API to post-precess existing NCover/OpenCover reports
7.5.809 (Genbu series release 14)
• [NEW] AltCover.Monitor API to track current coverage from running unit tests.  Current implementation requires dotnet test, or other command-line testing with --defer set, in which the cumulative visit numbers are available, rather than everything having been dumped to file instead.
• [BUGFIX] In OpenCover format output, only emit <File /> records relevant to the respective module, not for all source files encountered so far.
For previous releases (7.4.x and earlier) go here -- https://github.com/SteveGilham/altcover/blob/master/ReleaseNotes%20-%20Previously.md