Skip to content

Commit

Permalink
refactor(model): Inline some default parameters in a test function
Browse files Browse the repository at this point in the history
Make the code more compact as the comments do not add much value, and the
variables were named inconsistently anyway.

Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
  • Loading branch information
sschuberth committed Sep 9, 2024
1 parent f5d54b8 commit b0fc861
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions model/src/test/kotlin/AdvisorResultTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -277,15 +277,6 @@ class AdvisorResultTest : WordSpec({
}
})

/** The prefix for URIs pointing to the source of vulnerabilities. */
private const val SOURCE_URI_PREFIX = "http://cve.mitre.org/cgi-bin/cvename.cgi?name="

/** A scoring system used by vulnerabilities. */
private const val SCORING_SYSTEM = "cvssv3.1_qr"

/** The default severity assigned to vulnerabilities. */
private const val DEFAULT_SEVERITY = "MODERATE"

/** Test package identifiers. */
private val langId = Identifier("Maven", "org.apache.commons", "commons-lang3", "3.8")
private val queryId = Identifier("NPM", "", "jQuery", "2.1.4")
Expand All @@ -296,9 +287,9 @@ private val queryId = Identifier("NPM", "", "jQuery", "2.1.4")
*/
private fun createVulnerability(
id: String,
uriPrefix: String = SOURCE_URI_PREFIX,
scoringSystem: String = SCORING_SYSTEM,
severity: String = DEFAULT_SEVERITY
uriPrefix: String = "http://cve.mitre.org/cgi-bin/cvename.cgi?name=",
scoringSystem: String = "cvssv3.1_qr",
severity: String = "MODERATE"
): Vulnerability =
Vulnerability(
id = id,
Expand Down

0 comments on commit b0fc861

Please sign in to comment.