github-advanced-security[bot] commented on code in PR #884:
URL: 
https://github.com/apache/incubator-baremaps/pull/884#discussion_r1725129866


##########
baremaps-cli/src/main/java/org/apache/baremaps/cli/hillshade/Serve.java:
##########
@@ -0,0 +1,111 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to you under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.baremaps.cli.hillshade;
+
+import static org.apache.baremaps.utils.ObjectMapperUtils.objectMapper;
+
+import com.github.benmanes.caffeine.cache.CaffeineSpec;
+import com.linecorp.armeria.common.*;
+import com.linecorp.armeria.server.Server;
+import com.linecorp.armeria.server.annotation.JacksonResponseConverterFunction;
+import com.linecorp.armeria.server.cors.CorsService;
+import com.linecorp.armeria.server.docs.DocService;
+import com.linecorp.armeria.server.file.HttpFile;
+import java.util.concurrent.Callable;
+import org.apache.baremaps.raster.ElevationUtils;
+import org.apache.baremaps.server.BufferedImageResource;
+import org.apache.baremaps.server.VectorTileResource;
+import org.apache.baremaps.tilestore.raster.*;
+import org.apache.baremaps.tilestore.raster.RasterTileCache;
+import picocli.CommandLine.Command;
+import picocli.CommandLine.Option;
+
+@Command(name = "serve", description = "Start a tile server that computes 
hillshades.")
+public class Serve implements Callable<Integer> {
+
+  @Option(names = {"--host"}, paramLabel = "HOST", description = "The host of 
the server.")
+  private String host = "localhost";
+
+  @Option(names = {"--port"}, paramLabel = "PORT", description = "The port of 
the server.")
+  private int port = 9000;
+
+  @Override
+  public Integer call() throws Exception {
+
+    var serverBuilder = Server.builder();
+    serverBuilder.http(port);
+
+    var objectMapper = objectMapper();
+    var jsonResponseConverter = new 
JacksonResponseConverterFunction(objectMapper);
+
+    var elevationTileStore =
+        new RasterTileCache(new RasterElevationTileStore(), 
CaffeineSpec.parse("maximumSize=1000"));
+    var rasterHillshadeTileStore =
+        new RasterHillshadeTileStore(elevationTileStore, 
ElevationUtils::pixelToElevationTerrarium);

Review Comment:
   ## Unread local variable
   
   Variable 'RasterHillshadeTileStore rasterHillshadeTileStore' is never read.
   
   [Show more 
details](https://github.com/apache/incubator-baremaps/security/code-scanning/1545)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to