FOSSology  4.7.1
Open Source License Compliance by Open Source Software
FoScanner.DashboardReport.DashboardReport Class Reference
Inheritance diagram for FoScanner.DashboardReport.DashboardReport:
Inheritance graph
Collaboration diagram for FoScanner.DashboardReport.DashboardReport:
Collaboration graph

Public Member Functions

def __init__ (self, CliOptions cli_options, Scanners scanner)
 
None finalize_document (self)
 
None write_report (self, str file_name)
 

Public Attributes

 include_charts
 
 include_unknown
 
- Public Attributes inherited from FoScanner.ReportBase.ReportBase
 cli_options
 
 scanner
 

Private Member Functions

list[ScanResult|ScanResultList_collect_license_results (self)
 
tuple[int, int] _get_counts (self)
 
dict _finalise_data (self, list license_results, list failed_results)
 
str _markdown_builder (self, dict data)
 
tuple[str, dict] _build_markdown (self, list license_results, list failed_results)
 

Private Attributes

 _stats
 

Detailed Description

Build a Markdown compliance dashboard from scanner result objects
already held by the ``Scanners`` instance.

Lifecycle (same as SpdxReport / Spdx3Report):
    1. ``fossologyscanner.perform_scans()`` populates
       ``scanner.scan_packages`` with NOMOS/OJO results.
    2. ``finalize_document()`` reads those results and builds the
       Markdown string.
    3. ``write_report(path)`` writes the Markdown to *path* **and**,
       when running in GitHub Actions, appends it to
       ``$GITHUB_STEP_SUMMARY``.

Definition at line 32 of file DashboardReport.py.

Constructor & Destructor Documentation

◆ __init__()

def FoScanner.DashboardReport.DashboardReport.__init__ (   self,
CliOptions  cli_options,
Scanners  scanner 
)
:param cli_options: Resolved CLI options for the current run.
:param scanner:     Scanner instance holding scan results.

Reimplemented from FoScanner.ReportBase.ReportBase.

Definition at line 47 of file DashboardReport.py.

Member Function Documentation

◆ _build_markdown()

tuple[str, dict] FoScanner.DashboardReport.DashboardReport._build_markdown (   self,
list  license_results,
list  failed_results 
)
private
Finalise data, assemble the Markdown dashboard, and return both.

Definition at line 254 of file DashboardReport.py.

◆ _collect_license_results()

list[ScanResult | ScanResultList] FoScanner.DashboardReport.DashboardReport._collect_license_results (   self)
private
Return merged nomos+ojo results from all packages.

Definition at line 95 of file DashboardReport.py.

◆ _finalise_data()

dict FoScanner.DashboardReport.DashboardReport._finalise_data (   self,
list  license_results,
list  failed_results 
)
private
Compute all statistics from raw scanner results.

:return: A dict with keys: sorted_licenses, failed_by_license,
         unknown_files, unique_licenses, total_files,
         component_count, dep_count.

Definition at line 113 of file DashboardReport.py.

◆ _get_counts()

tuple[int, int] FoScanner.DashboardReport.DashboardReport._get_counts (   self)
private
Return (total_components, dependency_count).

Definition at line 104 of file DashboardReport.py.

◆ _markdown_builder()

str FoScanner.DashboardReport.DashboardReport._markdown_builder (   self,
dict  data 
)
private
Assemble the full Markdown string from pre-computed *data*.

:param data: Dict returned by :meth:`_finalise_data`.
:return: Markdown string.

Definition at line 165 of file DashboardReport.py.

◆ finalize_document()

None FoScanner.DashboardReport.DashboardReport.finalize_document (   self)
Collect scanner results and assemble the Markdown dashboard.

Reimplemented from FoScanner.ReportBase.ReportBase.

Definition at line 60 of file DashboardReport.py.

◆ write_report()

None FoScanner.DashboardReport.DashboardReport.write_report (   self,
str  file_name 
)
Write the dashboard Markdown to *file_name* and GITHUB_STEP_SUMMARY.

Reimplemented from FoScanner.ReportBase.ReportBase.

Definition at line 70 of file DashboardReport.py.


The documentation for this class was generated from the following file: