Skip to content

Commit e855ea5

Browse files
committed
refactor(reporters)!: Inline isFullFileLocation()
Signed-off-by: Sebastian Schuberth <[email protected]>
1 parent bf9b61a commit e855ea5

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

plugins/reporters/fossid/src/main/resources/templates/asciidoc/fossid_snippet.ftl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,11 @@ License(s):
8686
| Source Location | pURL | License | File | URL | Score | Release Date
8787

8888
.${snippetCount*2}+|
89-
[#if helper.isFullFileLocation(sourceLocation)]
90-
Full match
91-
[#else]
89+
[#if sourceLocation.hasLineRange]
9290
Partial match +
9391
${sourceLocation.startLine?c}-${sourceLocation.endLine?c}
92+
[#else]
93+
Full match
9494
[/#if]
9595

9696
[#list snippetFinding.snippets as snippet ]

plugins/reporters/freemarker/src/main/kotlin/FreemarkerTemplateProcessor.kt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -339,12 +339,6 @@ class FreemarkerTemplateProcessor(
339339
fun groupSnippetsBySourceLines(snippetFindings: Collection<SnippetFinding>): Map<TextLocation, SnippetFinding> =
340340
snippetFindings.associateBy { it.sourceLocation }
341341

342-
/**
343-
* Return a flag if the given [sourceLocation] refers to the full source file.
344-
*/
345-
@Suppress("unused") // This function is used in the templates.
346-
fun isFullFileLocation(sourceLocation: TextLocation) = !sourceLocation.hasLineRange
347-
348342
/**
349343
* Collect all the licenses present in a collection of [SnippetFinding]s.
350344
*/

0 commit comments

Comments
 (0)