zHd4/java-project-72

View on GitHub

Showing 2 of 2 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open

public static Optional<Url> findByName(String name) throws SQLException {
String sql = "SELECT * FROM urls WHERE name=?";
 
try (Connection connection = getDataSource().getConnection();
PreparedStatement statement = connection.prepareStatement(sql)) {
app/src/main/java/app/pageanalyzer/repository/UrlsRepository.java on lines 41..63

Similar blocks of code found in 2 locations. Consider refactoring.
Open

public static Optional<Url> findById(long id) throws SQLException {
String sql = "SELECT * FROM urls WHERE id=?";
 
try (Connection connection = getDataSource().getConnection();
PreparedStatement statement = connection.prepareStatement(sql)) {
app/src/main/java/app/pageanalyzer/repository/UrlsRepository.java on lines 65..87
Severity
Category
Status
Source
Language