The Code Coverage Report provides a consolidated snapshot of the coverage generated for the selected application. It displays essential metrics such as assemblies scanned, classes analyzed, and line and branch coverage percentages. This high-level overview helps users quickly understand overall test effectiveness and identify sections of the codebase that may need additional testing.

## Coverage Summary Report

The Coverage Summary Report consists of three major panels:

### Information

Displays metadata about the generated report:

- Parser: Coverage parser used (e.g., Cobertura)
- Assemblies: Total number of assemblies scanned.
- Classes: Total classes processed.
- Files: Number of files included in the report.

### Line Coverage

Shows how many executable lines were actually executed:

- Covered lines: Total executed lines.
- Uncovered lines: Lines that were not executed.
- Coverable lines: Lines eligible for coverage.
- Total lines: Total scanned lines.
- Line coverage %: Indicates overall line execution percentage with color bars (Green = executed, Red = missed).

### Branch Coverage

Represents conditional coverage (if/else/switch):

- Covered branches: Executed branches.
- Total branches: All conditional branches.
- Branch coverage %: Indicates executed vs unexecuted branches.

## Risk Hotspots

This section identifies high-risk parts of the application where low coverage overlaps with high complexity.

### Global Action Icons

- Assembly Selector Dropdown: The Assembly Selector dropdown displays all assemblies found in the coverage report. When the user clicks the dropdown, a list of available assemblies appears, with Assembly shown as the default selection. The user can choose any assembly from this list to update the Risk Hotspot table and view hotspot details specific to the selected assembly.
- View Top N Hotspots Dropdown: Risk hotspots displays 10 entries by default, and the user can adjust this value to control how many rows are shown in the Risk Hotspot table at a time.
- Filter: The filter box allows the user to instantly narrow down the Risk Hotspot table by typing an assembly name, class name, or method name.

## Risk Hotspot Table

This table lists high-complexity, low-coverage methods that may require additional testing.

### Table Columns

- Assembly: Displays the assembly associated with the hotspot. If the user has selected an assembly from the dropdown, this column shows only entries related to that assembly.
- Class: Shows the class containing the high-risk method.
- Method: Displays the specific method identified as a hotspot.
- Crap Score: Indicates risk level by combining complexity and low coverage. Higher scores = higher risk.
- Cyclomatic Complexity: Shows how many code paths exist within the method. Higher complexity indicates more required test cases.

### Accessing the Detailed Coverage View

To access the detailed coverage view, the user must click under assembly at the Risk Hotspot table. Clicking on these entries opens the detailed file-level view where the complete source file is displayed with line-by-line coverage indicators, allowing the user to see which lines were covered, partially covered, or completely missed during the execution.

## Detailed Coverage Report View

The Detailed Coverage Report View is displayed when the user clicks on any entry under the Assembly or Method column in the Risk Hotspot table. This screen provides a structured breakdown of line and branch coverage for assemblies, namespaces, classes, and individual methods. It allows the user to analyze coverage results at multiple levels and understand precisely where coverage is sufficient and where gaps exist.

### Global Action Icons

At the top of the screen, several action controls are available to customize how the coverage information is displayed.

- Collapse All / Expand All: Allows the user to collapse or expand the entire coverage hierarchy to simplify navigation and quickly switch between a high-level and detailed view.
- Grouping Slider: Enables the user to select how the coverage results should be grouped, such as by assembly, namespace, or class, depending on the slider position.
- Select Coverage Types & Metrics: Allows the user to customize which coverage metrics such as line coverage, branch coverage, or both should be displayed in the table.
- Filter: Provides a search box that lets the user quickly find specific classes, methods, or filenames, making navigation easier in large applications.

### Coverage Table

The central portion of the Report presents a detailed table showing line and branch coverage metrics for each item in the selected grouping. The table includes multiple columns that help users understand coverage at various levels.

- Name: Displays the assembly, namespace, class, or method name depending on the grouping level selected. Items appear in a hierarchical structure that can be expanded to reveal more detailed levels.
- Covered: Shows the number of executed lines for the selected item.
- Uncovered: Displays the number of lines that were not executed.
- Coverable: Indicates the number of lines eligible for coverage.
- Total: Represents the total number of lines scanned for the item.
- Percentage: Shows the overall line coverage percentage along with a visual bar where green segments represent covered lines and red segments represent uncovered lines.
- Branch Coverage: Shows branch coverage metrics for the selected item, including covered branches, total branches, and the resulting branch coverage percentage.

### Understanding the Coverage Bars

- Coverage Bars: Each row in the table contains horizontal bars that visually represent the percentage of covered and uncovered lines for that item.
- Green Color: Indicates successfully executed lines, showing sections of the code where coverage is complete or high.
- Red Color: Indicates lines that were not executed, highlighting areas with low or zero coverage that require additional testing.
- Visual Representation: These bars help users quickly identify coverage gaps without manually analyzing numerical data.
- File-Level Navigation: The user can click any method or file name displayed in the table to open the detailed file-level coverage view, where the complete source code is shown with line-by-line coverage indicators.

## File-Level Coverage View

This screen appears when the user clicks on any method name in the coverage table. It opens a detailed view of the source file, showing line-by-line coverage information for the selected method or file.

## Coverage Indicators

- Line Numbers: Each line of the source code is numbered for easy reference.
- Left Coverage Bar: A vertical bar beside the code shows execution status using color indicators:
  - Green: The line was executed.
  - Red: The line was not executed.
  - Yellow: The line was partially executed.
- Inline Highlighting: The code lines themselves are shaded to match their coverage status, providing clear visual feedback within the source file.
- File Path Display: At the top of the view, the complete file path is displayed to help the user identify the exact file being analyzed. Example: /home/cavisson/work/DOTNET_APP/dotnetCoreApp/Views/Shared/Error.cshtml

## Understanding Line Coverage

Executable lines are marked with green, red, or yellow coverage indicators based on their execution status. Non-executable lines such as comments or empty lines do not display coverage colors. Conditional statements may show partial coverage when only some execution paths are triggered during tests.

## JaCoCo Based Report

JaCoCo Coverage Report provides detailed metrics showing how much of the codebase is exercised by automated tests. These metrics help developers identify untested code paths, improve test quality, and ensure overall software reliability.

- Element: Navigate through the coverage hierarchy---package → class → method → line-level, it shows the package, class, or method name depending on the report level you are viewing.
- Missed Instructions: Number of bytecode instructions that were not executed during test execution. Represented visually as a red bar indicating uncovered instruction percentage, helps identify logic paths or branches in code that were not triggered.
- Cov. (Coverage % for Instructions): Percentage of total bytecode instructions that were executed by tests. The primary metric indicating how much of the application's executable logic is covered.
- Missed Branches: Indicates how many branch conditions (if/else, switch cases, ternary ops, etc.) were not covered. Helps detect untested decision logic. Red bar shows % of branches not covered.
- Cov. (Coverage % for Branches): Percent of branch conditions executed in tests. Key for testing correctness of control-flow logic.
- Missed Cxty (Cyclomatic Complexity Missed): Number of unexecuted complexity points, meaning decision paths not taken. Higher values indicate more untested logic paths.
- Cxty (Total Cyclomatic Complexity): Total complexity of the element (package, class, or method). Use Cxty to estimate how difficult a class/method is to fully test.
- Missed Lines: Number of source code lines that were not executed. Shows the actual lines not reached by tests, useful for locating untested code.
- Lines: Total number of lines with executable code.
- Missed Methods: Number of methods that were not executed at all. Quickly identifies entire functionalities lacking coverage.
- Methods: Total number of methods in that class or package. Compare Missed Methods vs Methods to determine method-level coverage completeness.
- Missed Classes: Number of classes in the package that were not covered by any test. Identify completely untested modules.
- Classes: Total number of classes in the package/module. Used to determine class-level coverage.

### Visual Indicators in the Code View

- Red Highlight: Indicates lines of code not executed during tests.
- Yellow Highlight: Indicates partially covered lines (example: some branches taken, others not).
- Green Highlight: Indicates fully covered lines.