Skip to content

[Feature] Generate a single combined report across multiple .ecore files#113

Merged
samatstariongroup merged 5 commits into
developmentfrom
GH89
Jul 5, 2026
Merged

[Feature] Generate a single combined report across multiple .ecore files#113
samatstariongroup merged 5 commits into
developmentfrom
GH89

Conversation

@samatstariongroup

Copy link
Copy Markdown
Member

Summary

Adds the ability to generate a single report (HTML, Markdown, Excel or model-inspection) that documents a multi-file Ecore metamodel, rather than one report per input file (fixes #89). The existing single-file behaviour is unchanged.

What is delivered

  • Base (ReportGenerator): LoadRootPackages(FileInfo) (entry model plus every cross-referenced model reachable from it) and LoadRootPackages(DirectoryInfo) (every .ecore in a folder), both returning the root EPackage of every resource in one ResourceSet.
  • Payload (HandleBarsReportGenerator): CreateHandlebarsPayload(IReadOnlyList<EPackage>) aggregates enums, primitive/other data types, classes and interfaces across all root packages; the single-package overload delegates to it.
  • Generators: GenerateCombinedReport(...) overloads on HtmlReportGenerator, MarkdownReportGenerator, XlReportGenerator and ModelInspector — both the entry-reachable (FileInfo) and directory-wide (DirectoryInfo) shapes. The Excel info sheet gains an "Included Packages" row.
  • Interfaces: IReportGenerator.GenerateCombinedReport(FileInfo, FileInfo) (drives the CLI polymorphically) plus format-specific directory/string overloads.
  • CLI: --include-referenced-models / -r on every report command; when set the handler calls GenerateCombinedReport instead of GenerateReport.

Design notes

Testing

  • Full solution green (dotnet test EcoreNetto.sln): 338 tests.
  • Combined-report tests against the full Eclipse Capella metamodel (21 files) for HTML, Markdown, Excel and inspection — a single output whose content originates from several different .ecore files; plus entry-reachable tests, a CLI -r handler test and null-guard tests.
  • New combined-report code meets the >= 80% new-code coverage bar.

Acceptance criteria

  • Single HTML report containing packages from all Capella files
  • Single Excel report containing packages from all Capella files
  • Single Markdown report containing packages from all Capella files
  • Existing single-file behaviour unchanged
  • Cross-file references remain resolved
  • Tests cover the combined-report path (Capella), augmenting the per-file fixture

Add ReportGenerator.LoadRootPackages(FileInfo/DirectoryInfo) and an aggregate
CreateHandlebarsPayload(IReadOnlyList<EPackage>) so a single HTML, Markdown, Excel or
inspection report can document a whole multi-file metamodel. Each generator gains
GenerateCombinedReport overloads (entry + reachable, and directory-wide) while the existing
single-file behaviour is unchanged.
…ommands

When set, the report handler produces a single combined report that also includes every
cross-referenced .ecore model reachable from the input model.
…d inspection

Add combined-report tests against the Capella metamodel (directory-wide and entry-reachable),
a CLI -r handler test and null-guard tests for the new GenerateCombinedReport overloads.

fixes #89
…the CLI

Promote GenerateCombinedReport(DirectoryInfo, FileInfo) to IReportGenerator so the report
handler can produce a directory-wide combined report polymorphically, and implement it on the
model inspector. Add the -d/--input-directory option (input-model is no longer required) and
route directory -> combined-directory, -r -> entry-reachable, otherwise single-file, validating
that the directory exists. Covered by CLI handler tests.
@samatstariongroup

Copy link
Copy Markdown
Member Author

Added CLI directory mode (follow-up commit): the combined report can now be driven from the command line.

  • -d / --input-directory <dir> produces one combined report for every .ecore in the directory (all files).
  • -i <entry.ecore> -r / --include-referenced-models produces one combined report of the entry plus everything reachable from it.
  • -i <entry.ecore> alone is unchanged (single-file report).

To make this polymorphic across all report types, GenerateCombinedReport(DirectoryInfo, FileInfo) was promoted to IReportGenerator (and implemented on the model inspector); --input-model is no longer required (either -i or -d). Covered by CLI handler tests.

Mirror CapellaHtmlReportGeneratorTestFixture for Markdown and Excel: a per-file report over all
21 Capella files plus a single combined report of the whole metamodel (and an entry-reachable
combined report). Move the Capella combined-report assertions out of the generic Markdown/Excel
fixtures to avoid duplication; the generic fixtures keep their recipe content and null-guard tests.
@github-actions

github-actions Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor
Package Line Rate Branch Rate Complexity Health
ECoreNetto 91% 87% 690
ECoreNetto.Extensions 99% 92% 150
ECoreNetto.HandleBars 99% 95% 102
ECoreNetto.Reporting 89% 78% 397
ECoreNetto.Tools 96% 93% 65
Summary 92% (3603 / 3914) 86% (992 / 1160) 1404

@sonarqubecloud

sonarqubecloud Bot commented Jul 5, 2026

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
3.5% Duplication on New Code (required ≤ 3%)

See analysis details on SonarQube Cloud

@samatstariongroup samatstariongroup merged commit 3508b66 into development Jul 5, 2026
13 of 14 checks passed
@samatstariongroup samatstariongroup deleted the GH89 branch July 5, 2026 21:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Generate a single HTML report combining multiple input .ecore files

1 participant