title: How to reduce cyclomatic complexity on a reactive code?
body: <p>I have a microservice using Spring Webflux that makes some requests to another services. The code looks like this:</p>
  <pre><code>public class ExampleService {
      
      @Autowired
      private WebClient webClient;
      
      @Value(&quot;${microservices.address-data.baseUrl}&quot;)
      private String exampleBaseUrl;
      
      @Value(&quot;${microservices.address-data.endpoints.get}&quot;)
      private String exampleGetEndpoint;
      
      @Value(&quot;${microservices.address-data.endpoints.post}&quot;)
      private String examplePostEndpoint;
      
      @Value(&quot;${microservices.address-data.endpoints.patch}&quot;)
      private String examplePatchEndpoint;
      
      public Flux&lt;exampleBO&gt; getexample(String customerId) {
          return webClient.mutate().baseUrl(exampleBaseUrl).build().get()
                  .uri(uriBuilder -&gt; uriBuilder.path(exampleGetEndpoint).build(customerId))
                  .retrieve().bodyToFlux(exampleBO.class);
          
      }
      public Mono&lt;Long&gt; saveexample(String customerId, Mono&lt;exampleBO&gt; personalData) {
          return webClient.mutate().baseUrl(exampleBaseUrl).build().post()
                  .uri(uriBuilder -&gt; uriBuilder.path(examplePostEndpoint).build(customerId))
                  .body(personalData, exampleBO.class).retrieve().bodyToMono(Long.class);
      }
      public Mono&lt;Long&gt; updateexample(String leadId, String addressId, Mono&lt;exampleBO&gt; example) {
          return webClient.mutate().baseUrl(exampleBaseUrl).build().patch()
                  .uri(uriBuilder -&gt; uriBuilder.path(examplePatchEndpoint).build(leadId, addressId))
                  .body(example, exampleBO.class).retrieve().bodyToMono(Long.class);
      }
  }
  </code></pre>
  <p>When Sonar analyzes this code, the measure of Cyclomatic Complexity has a value of 6 I don't know how to reduce this values, because I haven't any block with conditionals (if/else/switch). If in this service I have many classes like this, the final complexity will be high and I can pass the Sonar analysis.</p>