From 869bf65b619f9d51e6a86e38bb5cbcba8c164520 Mon Sep 17 00:00:00 2001 From: Frank Viernau Date: Tue, 21 May 2024 13:58:56 +0200 Subject: [PATCH] feat(static-html): Make the descriptions of issues more compact Only show the `Issue.message`, but stop showing `Issue.timestamp` and `Issue.severity`, to make the representation more compact and to align with the WebApp report. Note that the timestamp is rarely relevant and the severity is represented by a dedicated styling anyway. Signed-off-by: Frank Viernau --- ...ic-html-reporter-test-expected-output.html | 77 ++++++++----------- .../main/kotlin/TablesReportModelMapper.kt | 2 +- 2 files changed, 35 insertions(+), 44 deletions(-) diff --git a/plugins/reporters/static-html/src/funTest/assets/static-html-reporter-test-expected-output.html b/plugins/reporters/static-html/src/funTest/assets/static-html-reporter-test-expected-output.html index 455c7c663aa3e..17276879c8e89 100644 --- a/plugins/reporters/static-html/src/funTest/assets/static-html-reporter-test-expected-output.html +++ b/plugins/reporters/static-html/src/funTest/assets/static-html-reporter-test-expected-output.html @@ -577,7 +577,7 @@

Analyzer Issue Summary (1 errors, 2 warnings, 1 1 Gradle:org.ossreviewtoolkit.gradle.example:lib:1.0.0 -

2024-04-25T07:44:20.725613974Z [ERROR]: Gradle - Example error.

+

Example error.

How to fix
    @@ -596,7 +596,7 @@

    Analyzer Issue Summary (1 errors, 2 warnings, 1 2 Gradle:org.ossreviewtoolkit.gradle.example:lib:1.0.0 -

    2024-04-25T07:44:20.725613974Z [WARNING]: Gradle - Example warning.

    +

    Example warning.

    How to fix
      @@ -615,8 +615,7 @@

      Analyzer Issue Summary (1 errors, 2 warnings, 1 3 Maven:org.apache.commons:commons-text:1.1 -

      2024-04-25T07:44:20.725613974Z [WARNING]: Gradle - Example analyzer warning in included - package.

      +

      Example analyzer warning in included package.

      How to fix
        @@ -635,7 +634,7 @@

        Analyzer Issue Summary (1 errors, 2 warnings, 1 4 Gradle:org.ossreviewtoolkit.gradle.example:lib:1.0.0 -

        2024-04-25T07:44:20.725613974Z [HINT]: Gradle - Example hint.

        +

        Example hint.

        How to fix
          @@ -667,8 +666,7 @@

          Scanner Issue Summary (3 errors, 1 warnings, 1 hi 1 Gradle:org.ossreviewtoolkit.gradle.example:lib:1.0.0 -

          Unknown time [ERROR]: Dummy - DownloadException: No source artifact URL provided for - 'Gradle:org.ossreviewtoolkit.gradle.example:lib:1.0.0'.
          Caused by: DownloadException: No VCS URL provided for 'Gradle:org.ossreviewtoolkit.gradle.example:lib:1.0.0'. +

          DownloadException: No source artifact URL provided for 'Gradle:org.ossreviewtoolkit.gradle.example:lib:1.0.0'.
          Caused by: DownloadException: No VCS URL provided for 'Gradle:org.ossreviewtoolkit.gradle.example:lib:1.0.0'. Please make sure the published POM file includes the SCM connection, see: https://docs.gradle.org/current/userguide/publishing_maven.html#sec:modifying_the_generated_pom

          How to fix @@ -688,8 +686,7 @@

          Scanner Issue Summary (3 errors, 1 warnings, 1 hi 2 Gradle:org.ossreviewtoolkit.gradle.example:lib:1.0.0 -

          2024-04-22T10:36:10.661544294Z [ERROR]: FakeScanner - ERROR: Timeout after 300 seconds - while scanning file 'analyzer/src/funTest/assets/projects/synthetic/gradle/lib/included-file.dat'.

          +

          ERROR: Timeout after 300 seconds while scanning file 'analyzer/src/funTest/assets/projects/synthetic/gradle/lib/included-file.dat'.

          How to fix
            @@ -708,7 +705,7 @@

            Scanner Issue Summary (3 errors, 1 warnings, 1 hi 3 Gradle:org.ossreviewtoolkit.gradle.example:lib:1.0.0 -

            2024-04-25T07:44:20.725613974Z [ERROR]: FakeScanner - Example error.

            +

            Example error.

            How to fix
              @@ -727,7 +724,7 @@

              Scanner Issue Summary (3 errors, 1 warnings, 1 hi 4 Gradle:org.ossreviewtoolkit.gradle.example:lib:1.0.0 -

              2024-04-25T07:44:20.725613974Z [WARNING]: FakeScanner - Example warning.

              +

              Example warning.

              How to fix
                @@ -746,7 +743,7 @@

                Scanner Issue Summary (3 errors, 1 warnings, 1 hi 5 Gradle:org.ossreviewtoolkit.gradle.example:lib:1.0.0 -

                2024-04-25T07:44:20.725613974Z [HINT]: FakeScanner - Example hint.

                +

                Example hint.

                How to fix
                  @@ -778,7 +775,7 @@

                  Advisor Issue Summary (1 errors, 1 warnings, 1 hi 1 Maven:org.apache.commons:commons-text:1.1 -

                  Unknown time [ERROR]: VulnerableCode - Example advisor error.

                  +

                  Example advisor error.

                  How to fix
                    @@ -797,7 +794,7 @@

                    Advisor Issue Summary (1 errors, 1 warnings, 1 hi 2 Maven:org.apache.commons:commons-text:1.1 -

                    Unknown time [WARNING]: VulnerableCode - Example advisor warning.

                    +

                    Example advisor warning.

                    How to fix
                      @@ -816,7 +813,7 @@

                      Advisor Issue Summary (1 errors, 1 warnings, 1 hi 3 Maven:org.apache.commons:commons-text:1.1 -

                      Unknown time [HINT]: VulnerableCode - Example advisor hint.

                      +

                      Example advisor hint.

                      How to fix
                        @@ -899,30 +896,29 @@

                        Packages

                        -

                        2024-04-25T07:44:20.725613974Z [ERROR]: FakeScanner - Example error, resolved.

                        +

                        Example error, resolved.

                        Resolved by: CANT_FIX_ISSUE - Resolved for illustration.

                        -

                        2024-04-22T10:36:10.661544294Z [ERROR]: FakeScanner - ERROR: Timeout after 300 seconds - while scanning file 'project/file-within-excluded-project.dat'.

                        +

                        ERROR: Timeout after 300 seconds while scanning file 'project/file-within-excluded-project.dat'.

                        -

                        2024-04-25T07:44:20.725613974Z [HINT]: FakeScanner - Example hint.

                        +

                        Example hint.

                        -

                        2024-04-25T07:44:20.725613974Z [WARNING]: FakeScanner - Example warning.

                        +

                        Example warning.

                        -

                        2024-04-25T07:44:20.725613974Z [ERROR]: FakeScanner - Example error.

                        +

                        Example error.

                        @@ -989,45 +985,43 @@

                        Packages

                        -

                        2024-04-25T07:44:20.725613974Z [ERROR]: Gradle - Example error.

                        +

                        Example error.

                        -

                        Unknown time [ERROR]: Dummy - DownloadException: No source artifact URL provided for - 'Gradle:org.ossreviewtoolkit.gradle.example:lib:1.0.0'.
                        Caused by: DownloadException: No VCS URL provided for 'Gradle:org.ossreviewtoolkit.gradle.example:lib:1.0.0'. +

                        DownloadException: No source artifact URL provided for 'Gradle:org.ossreviewtoolkit.gradle.example:lib:1.0.0'.
                        Caused by: DownloadException: No VCS URL provided for 'Gradle:org.ossreviewtoolkit.gradle.example:lib:1.0.0'. Please make sure the published POM file includes the SCM connection, see: https://docs.gradle.org/current/userguide/publishing_maven.html#sec:modifying_the_generated_pom

                        -

                        2024-04-22T10:36:10.661544294Z [ERROR]: FakeScanner - ERROR: Timeout after 300 seconds - while scanning file 'analyzer/src/funTest/assets/projects/synthetic/gradle/lib/included-file.dat'.

                        +

                        ERROR: Timeout after 300 seconds while scanning file 'analyzer/src/funTest/assets/projects/synthetic/gradle/lib/included-file.dat'.

                        -

                        2024-04-25T07:44:20.725613974Z [ERROR]: FakeScanner - Example error.

                        +

                        Example error.

                        -

                        2024-04-25T07:44:20.725613974Z [WARNING]: Gradle - Example warning.

                        +

                        Example warning.

                        -

                        2024-04-25T07:44:20.725613974Z [WARNING]: FakeScanner - Example warning.

                        +

                        Example warning.

                        -

                        2024-04-25T07:44:20.725613974Z [HINT]: Gradle - Example hint.

                        +

                        Example hint.

                        -

                        2024-04-25T07:44:20.725613974Z [HINT]: FakeScanner - Example hint.

                        +

                        Example hint.

                        @@ -1036,22 +1030,21 @@

                        Packages

                        -

                        2024-04-25T07:44:20.725613974Z [ERROR]: Gradle - Example error, resolved.

                        +

                        Example error, resolved.

                        Resolved by: CANT_FIX_ISSUE - Resolved for illustration.

                        -

                        2024-04-25T07:44:20.725613974Z [ERROR]: FakeScanner - Example error, resolved.

                        +

                        Example error, resolved.

                        Resolved by: CANT_FIX_ISSUE - Resolved for illustration.

                        -

                        2024-04-22T10:36:10.661544294Z [ERROR]: FakeScanner - ERROR: Timeout after 300 seconds - while scanning file 'analyzer/src/funTest/assets/projects/synthetic/gradle/lib/excluded-file.dat'.

                        +

                        ERROR: Timeout after 300 seconds while scanning file 'analyzer/src/funTest/assets/projects/synthetic/gradle/lib/excluded-file.dat'.

                        @@ -1082,8 +1075,7 @@

                        Packages

                        -

                        2024-04-25T07:44:20.725613974Z [WARNING]: Gradle - Example analyzer warning in excluded - package.

                        +

                        Example analyzer warning in excluded package.

                        @@ -1194,23 +1186,22 @@

                        Packages

                        -

                        Unknown time [ERROR]: VulnerableCode - Example advisor error.

                        +

                        Example advisor error.

                        -

                        2024-04-25T07:44:20.725613974Z [WARNING]: Gradle - Example analyzer warning in included - package.

                        +

                        Example analyzer warning in included package.

                        -

                        Unknown time [WARNING]: VulnerableCode - Example advisor warning.

                        +

                        Example advisor warning.

                        -

                        Unknown time [HINT]: VulnerableCode - Example advisor hint.

                        +

                        Example advisor hint.

                        @@ -1219,7 +1210,7 @@

                        Packages

                        diff --git a/plugins/reporters/static-html/src/main/kotlin/TablesReportModelMapper.kt b/plugins/reporters/static-html/src/main/kotlin/TablesReportModelMapper.kt index 36fa789efee17..bcb13dc0c0b7a 100644 --- a/plugins/reporters/static-html/src/main/kotlin/TablesReportModelMapper.kt +++ b/plugins/reporters/static-html/src/main/kotlin/TablesReportModelMapper.kt @@ -90,7 +90,7 @@ private fun Issue.toTableReportIssue( val resolutions = ortResult.getResolutionsFor(this) return TablesReportIssue( source = source, - description = toString(), + description = message, resolutionDescription = buildString { if (resolutions.isNotEmpty()) { append(
                        -

                        Unknown time [ERROR]: VulnerableCode - Example advisor error, resolved.

                        +

                        Example advisor error, resolved.

                        Resolved by: CANT_FIX_ISSUE - A comment explaining why the issue can be ignored.