You can skip code coverage for some java files using pom.xml or else sonar-project.properties.
Ex: use the below plugin, give the packages of java files which does not require code coverage in the tag
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.5</version>
<executions>
<execution>
<id>default-prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>default-report</id>
<goals>
<goal>report</goal>
</goals>
</execution>
<execution>
<id>default-check</id>
<goals>
<goal>check</goal>
</goals>
<configuration>
<excludes>
<exclude>com/sbi/mdcm/v1_0_0/insurancequote/autogen/**</exclude>
<exclude>com/sbi/mdcm/v1_0_0/insurancequote_resources/autogen/**</exclude>
</excludes>
<rules>
<rule>
<element>BUNDLE</element>
<limits>
<limit>
<counter>COMPLEXITY</counter>
<value>COVEREDRATIO</value>
<minimum>0.80</minimum>
</limit>
</limits>
</rule>
</rules>
</configuration>
</execution>
</executions>
</plugin>
sonar-project.properties:
sonar.exclusions=**/com/sbi/mdcm/v1_0/insurancepolicy_adapter/osi/model/*.java