Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Static HTML report model clean-ups #8606

Merged
merged 9 commits into from
May 3, 2024
Merged

Conversation

fviernau
Copy link
Member

@fviernau fviernau commented May 2, 2024

A couple of trivial refactors focusing on cleaning-up the model classes of the static HTML report.

Please see the individual commit messages.

Part of: #7921.

@fviernau fviernau requested a review from a team as a code owner May 2, 2024 07:06
@fviernau fviernau force-pushed the trivial-static-html-model-fixes branch 2 times, most recently from 8d8849a to 259845b Compare May 2, 2024 07:10
Copy link

codecov bot commented May 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 67.97%. Comparing base (9b34a7b) to head (704a86f).

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #8606   +/-   ##
=========================================
  Coverage     67.97%   67.97%           
  Complexity     1005     1005           
=========================================
  Files           244      244           
  Lines          7844     7844           
  Branches        876      876           
=========================================
  Hits           5332     5332           
  Misses         2129     2129           
  Partials        383      383           
Flag Coverage Δ
funTest-non-docker 34.62% <ø> (-0.02%) ⬇️
test 37.93% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

This is more consistent with ORT's code base, which usually does not use
the term "model" as a class name suffix.

Signed-off-by: Frank Viernau <frank_viernau@epam.com>
Also move the class into `ProjectTable` to allow for that shorter name.

Signed-off-by: Frank Viernau <frank_viernau@epam.com>
Also move the class into `IssueTable` to allow for that shorter name.

Signed-off-by: Frank Viernau <frank_viernau@epam.com>
Move all direct nested class of `ReportTable` to the top level for a
better overview.

Signed-off-by: Frank Viernau <frank_viernau@epam.com>
This is only needed in the static HTML reporter. So, move it next to the
other helper functions.

Signed-off-by: Frank Viernau <frank_viernau@epam.com>
@fviernau fviernau force-pushed the trivial-static-html-model-fixes branch from 259845b to 12e74fd Compare May 3, 2024 08:36
The report is table-based and consists of multiple tables. The previous
name made it sound like it would be a single table.

Signed-off-by: Frank Viernau <frank_viernau@epam.com>
@fviernau fviernau force-pushed the trivial-static-html-model-fixes branch from 12e74fd to be8df83 Compare May 3, 2024 08:37
@fviernau fviernau requested a review from sschuberth May 3, 2024 08:42
@@ -174,7 +174,7 @@ class StaticHtmlReporter : Reporter {
return document.serialize().normalizeLineBreaks()
}

private fun getRuleViolationSummaryString(ruleViolations: List<ResolvableViolation>): String {
private fun getRuleViolationSummaryString(ruleViolations: List<TableReportViolation>): String {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this also use plural "TablesReport..." to not have too many variants of the spelling, and to document that it belongs to the scope of TablesReport?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or maybe just move these classes inside of TablesReport and omit the prefix, similar to like you did for the Row classes?

`ResolvableIssue` and `ResolvableRuleViolation` are the representations
of issues and rule violations within the domain of the static HTML
report model. So, use the name of the model as the prefix, instead of
the "Resolvable" prefix which focuses too much on only one of its
properties.

Signed-off-by: Frank Viernau <frank_viernau@epam.com>
This is a fix-up of 237f3e2 and 9c6b867.

Signed-off-by: Frank Viernau <frank_viernau@epam.com>
This is a fix-up for 9c6b867.

Signed-off-by: Frank Viernau <frank_viernau@epam.com>
@fviernau fviernau force-pushed the trivial-static-html-model-fixes branch from be8df83 to 704a86f Compare May 3, 2024 09:23
@fviernau fviernau requested a review from sschuberth May 3, 2024 09:25
@fviernau fviernau enabled auto-merge (rebase) May 3, 2024 09:32
@fviernau fviernau merged commit 8ed8e2b into main May 3, 2024
21 checks passed
@fviernau fviernau deleted the trivial-static-html-model-fixes branch May 3, 2024 09:41
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.

2 participants