kitdim/java-project

View on GitHub

Showing 3 of 5 total issues

Method create has 29 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static void create(Context ctx) throws SQLException {
        String input = ctx.formParamAsClass("url", String.class)
                .get()
                .trim()
                .toLowerCase();
Severity: Minor
Found in app/src/main/java/hexlet/code/controller/UrlController.java - About 1 hr to fix

    Method createCheck has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public static void createCheck(Context ctx) throws SQLException {
            Long urlId = ctx.pathParamAsClass("id", Long.class).get();
            Url url = UrlsRepository.find(urlId)
                    .orElseThrow(() -> new NotFoundResponse("Entity with id = " + urlId + " not found"));
            try {
    Severity: Minor
    Found in app/src/main/java/hexlet/code/controller/UrlCheckController.java - About 1 hr to fix

      Method getEntities has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public static Optional<List<UrlCheck>> getEntities(Long searchId) throws SQLException {
              var sql = "SELECT * FROM url_checks where url_id = ?";
              try (var conn = dataSource.getConnection();
                   var stmt = conn.prepareStatement(sql)) {
                  stmt.setLong(1, searchId);
      Severity: Minor
      Found in app/src/main/java/hexlet/code/repository/UrlsCheckRepository.java - About 1 hr to fix
        Severity
        Category
        Status
        Source
        Language