Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions src/main/java/example/Start.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,24 @@ private static void doVulnerableCode() throws SQLException {
DriverManager.getConnection("jdbc:derby:memory:myDB;create=true", "login", "");
}

private static void doVulnerableCode(String output) throws SQLException {

Connection conn = DriverManager.getConnection("jdbc:derby:memory:myDB;create=true", "login", "");
System.out.println(output);
}

private static void doVulnerableCode(boolean bool) throws SQLException {
if (bool) {
DriverManager.getConnection("jdbc:derby:memory:myDB;create=true", "login", "");
}
}

private static void doVulnerableCode(boolean bool, String output) throws SQLException {
if (bool && output.equals("test")) {
DriverManager.getConnection("jdbc:derby:memory:myDB;create=true", "login", "");

Check failure

Code scanning / SonarCloud

A secure password should be used when connecting to a database

<!--SONAR_ISSUE_KEY:AY3Fw-ggiDLXXRG5HpId-->Add password protection to this database. <p>See more on <a href="https://sonarcloud.io/project/issues?id=antoine-vinot-sonarsource_CodeScanningSample&issues=AY3Fw-ggiDLXXRG5HpId&open=AY3Fw-ggiDLXXRG5HpId&pullRequest=4">SonarCloud</a></p>

Check failure

Code scanning / SonarCloudsquad-3

A secure password should be used when connecting to a database

<!--SONAR_ISSUE_KEY:AY_jg32RrPNksJJcSqk_-->Add password protection to this database. <p>See more on <a href="https://squad-3-core.sc-dev.io/project/issues?id=antoine-vinot-sonarsource_CodeScanningSample&issues=AY_jg32RrPNksJJcSqk_&open=AY_jg32RrPNksJJcSqk_&pullRequest=4">SonarCloud</a></p>

Check failure

Code scanning / SonarCloudDev

A secure password should be used when connecting to a database

<!--SONAR_ISSUE_KEY:AZJXufaRCPbxHiHE8izV-->Add password protection to this database. <p>See more on <a href="https://dev.sc-dev.io/project/issues?id=antoine-vinot-sonarsource_CodeScanningSample&issues=AZJXufaRCPbxHiHE8izV&open=AZJXufaRCPbxHiHE8izV&pullRequest=4">SonarCloud</a></p>
}
}

private static void doVulnerableCode(String output) throws SQLException {

Connection conn = DriverManager.getConnection("jdbc:derby:memory:myDB;create=true", "login", "");

Check failure

Code scanning / SonarCloud

A secure password should be used when connecting to a database

<!--SONAR_ISSUE_KEY:AY3Fw-ggiDLXXRG5HpIe-->Add password protection to this database. <p>See more on <a href="https://sonarcloud.io/project/issues?id=antoine-vinot-sonarsource_CodeScanningSample&issues=AY3Fw-ggiDLXXRG5HpIe&open=AY3Fw-ggiDLXXRG5HpIe&pullRequest=4">SonarCloud</a></p>

Check failure

Code scanning / SonarCloudsquad-3

A secure password should be used when connecting to a database

<!--SONAR_ISSUE_KEY:AY_jg32RrPNksJJcSqlA-->Add password protection to this database. <p>See more on <a href="https://squad-3-core.sc-dev.io/project/issues?id=antoine-vinot-sonarsource_CodeScanningSample&issues=AY_jg32RrPNksJJcSqlA&open=AY_jg32RrPNksJJcSqlA&pullRequest=4">SonarCloud</a></p>

Check failure

Code scanning / SonarCloudDev

A secure password should be used when connecting to a database

<!--SONAR_ISSUE_KEY:AZJXufaRCPbxHiHE8izW-->Add password protection to this database. <p>See more on <a href="https://dev.sc-dev.io/project/issues?id=antoine-vinot-sonarsource_CodeScanningSample&issues=AZJXufaRCPbxHiHE8izW&open=AZJXufaRCPbxHiHE8izW&pullRequest=4">SonarCloud</a></p>
System.out.println(output);
}



}