Remove pmd plugin from gradle build
This commit is contained in:
15
build.gradle
15
build.gradle
@@ -194,7 +194,6 @@ configure(libraryProjects) {
|
||||
|
||||
configure(staticAnalysisProjects) {
|
||||
apply plugin: "checkstyle"
|
||||
apply plugin: "pmd"
|
||||
apply plugin: "jacoco"
|
||||
|
||||
checkstyle {
|
||||
@@ -207,20 +206,6 @@ configure(staticAnalysisProjects) {
|
||||
checkstyleTest {
|
||||
source = "src/test/java"
|
||||
}
|
||||
|
||||
pmd {
|
||||
consoleOutput = true
|
||||
}
|
||||
pmdMain {
|
||||
ruleSets = []
|
||||
ruleSetFiles = files("${project.rootDir}/src/pmd/pmdRuleSet.xml")
|
||||
source = "src/main/java"
|
||||
}
|
||||
pmdTest {
|
||||
ruleSets = []
|
||||
ruleSetFiles = files("${project.rootDir}/src/pmd/pmdTestRuleSet.xml")
|
||||
source = "src/test/java"
|
||||
}
|
||||
}
|
||||
|
||||
configure(publishedProjects) {
|
||||
|
||||
@@ -26,14 +26,12 @@ import org.junit.jupiter.api.extension.ParameterResolver;
|
||||
|
||||
class BrokerPropertiesParameterResolver implements ParameterResolver {
|
||||
|
||||
@SuppressWarnings("PMD.AvoidUncheckedExceptionsInSignatures")
|
||||
@Override
|
||||
public boolean supportsParameter(ParameterContext parameterContext, ExtensionContext extensionContext)
|
||||
throws ParameterResolutionException {
|
||||
return parameterContext.getParameter().getType() == BrokerProperties.class;
|
||||
}
|
||||
|
||||
@SuppressWarnings("PMD.AvoidUncheckedExceptionsInSignatures")
|
||||
@Override
|
||||
public BrokerProperties resolveParameter(ParameterContext parameterContext, ExtensionContext extensionContext)
|
||||
throws ParameterResolutionException {
|
||||
|
||||
@@ -103,7 +103,6 @@ import static org.springframework.cloud.appbroker.acceptance.fixtures.cf.CloudFo
|
||||
@ExtendWith(SpringExtension.class)
|
||||
@ExtendWith(BrokerPropertiesParameterResolver.class)
|
||||
@EnableConfigurationProperties(AcceptanceTestProperties.class)
|
||||
@SuppressWarnings("PMD.GodClass")
|
||||
abstract class CloudFoundryAcceptanceTest {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(CloudFoundryAcceptanceTest.class);
|
||||
|
||||
@@ -29,7 +29,6 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.web.client.RestClientException;
|
||||
import org.springframework.web.client.RestTemplate;
|
||||
|
||||
@SuppressWarnings("PMD.DoNotUseThreads")
|
||||
@Service
|
||||
class HealthListener {
|
||||
|
||||
|
||||
@@ -73,7 +73,6 @@ import org.springframework.context.annotation.Configuration;
|
||||
/**
|
||||
* App Broker Auto-configuration
|
||||
*/
|
||||
@SuppressWarnings("PMD.CouplingBetweenObjects")
|
||||
@Configuration
|
||||
@AutoConfigureAfter(CloudFoundryAppDeployerAutoConfiguration.class)
|
||||
@ConditionalOnBean(AppDeployer.class)
|
||||
|
||||
@@ -29,7 +29,6 @@ import org.springframework.util.CollectionUtils;
|
||||
/**
|
||||
* An application deployed as part of the service provisioning process
|
||||
*/
|
||||
@SuppressWarnings("PMD.GodClass")
|
||||
public class BackingApplication {
|
||||
|
||||
private static final String VALUE_HIDDEN = "<value hidden>";
|
||||
|
||||
@@ -55,7 +55,7 @@ public final class ConfigurationBeanUtils {
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings({"unchecked", "PMD.AvoidCatchingGenericException"})
|
||||
@SuppressWarnings("unchecked")
|
||||
private static <T> T getTargetObject(Object candidate) {
|
||||
try {
|
||||
if (AopUtils.isAopProxy(candidate) && candidate instanceof Advised) {
|
||||
|
||||
@@ -137,7 +137,6 @@ import org.springframework.core.io.ResourceLoader;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
@SuppressWarnings({"PMD.GodClass", "PMD.CyclomaticComplexity", "PMD.ExcessiveClassLength"})
|
||||
public class CloudFoundryAppDeployer implements AppDeployer, ResourceLoaderAware {
|
||||
|
||||
private static final Duration DEFAULT_PLATFORM_OPERATION_DURATION = Duration.ofMinutes(10);
|
||||
|
||||
@@ -32,7 +32,7 @@ import org.springframework.cloud.appbroker.deployer.DeploymentProperties;
|
||||
* @author Greg Turnquist
|
||||
* @author Ilayaperumal Gopinathan
|
||||
*/
|
||||
@SuppressWarnings({"unused", "PMD.TooManyFields"})
|
||||
@SuppressWarnings("unused")
|
||||
public class CloudFoundryDeploymentProperties extends DeploymentProperties {
|
||||
|
||||
/**
|
||||
|
||||
@@ -91,7 +91,7 @@ import static org.mockito.BDDMockito.then;
|
||||
import static org.springframework.cloud.appbroker.deployer.DeploymentProperties.TARGET_PROPERTY_KEY;
|
||||
import static org.springframework.cloud.appbroker.deployer.cloudfoundry.CloudFoundryDeploymentProperties.DEFAULT_API_POLLING_TIMEOUT_SECONDS;
|
||||
|
||||
@SuppressWarnings({"UnassignedFluxMonoInstance", "PMD.ExcessiveClassLength"})
|
||||
@SuppressWarnings("UnassignedFluxMonoInstance")
|
||||
@ExtendWith(MockitoExtension.class)
|
||||
@MockitoSettings(strictness = Strictness.LENIENT)
|
||||
class CloudFoundryAppDeployerTest {
|
||||
|
||||
@@ -154,7 +154,7 @@ class CloudFoundryAppDeployerUpdateApplicationTest {
|
||||
private ResourceLoader resourceLoader;
|
||||
|
||||
@BeforeEach
|
||||
@SuppressWarnings({"PMD.ExcessiveMethodLength", "deprecation"})
|
||||
@SuppressWarnings("deprecation")
|
||||
void setUp() {
|
||||
CloudFoundryDeploymentProperties deploymentProperties = new CloudFoundryDeploymentProperties();
|
||||
CloudFoundryTargetProperties targetProperties = new CloudFoundryTargetProperties();
|
||||
|
||||
@@ -22,7 +22,6 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
/**
|
||||
* A Spring Boot application for running integration tests
|
||||
*/
|
||||
@SuppressWarnings("PMD.UseUtilityClass")
|
||||
@SpringBootApplication
|
||||
public class AppBrokerApplication {
|
||||
|
||||
|
||||
@@ -124,7 +124,6 @@ class CreateInstanceWithCustomTargetComponentTest extends WiremockComponentTest
|
||||
return new CustomSpaceTarget(customSpaceService);
|
||||
}
|
||||
|
||||
@SuppressWarnings({"PMD.UnusedFormalParameter"})
|
||||
static final class CustomSpaceTarget extends TargetFactory<CustomSpaceTarget.Config> {
|
||||
|
||||
private final CustomSpaceService customSpaceService;
|
||||
|
||||
@@ -1,69 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
~ Copyright 2002-2020 the original author or authors.
|
||||
~
|
||||
~ Licensed 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
|
||||
~
|
||||
~ https://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.
|
||||
-->
|
||||
|
||||
<ruleset name="Main ruleset"
|
||||
xmlns="https://pmd.sourceforge.net/ruleset/2.0.0"
|
||||
xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="https://pmd.sourceforge.net/ruleset/2.0.0 https://pmd.sourceforge.io/ruleset_2_0_0.xsd">
|
||||
<description>Main Ruleset</description>
|
||||
<rule ref="category/java/bestpractices.xml">
|
||||
<exclude name="GuardLogStatement" />
|
||||
</rule>
|
||||
<rule ref="category/java/codestyle.xml">
|
||||
<exclude name="AtLeastOneConstructor" />
|
||||
<exclude name="LocalVariableCouldBeFinal" />
|
||||
<exclude name="LongVariable" />
|
||||
<exclude name="MethodArgumentCouldBeFinal" />
|
||||
<exclude name="OnlyOneReturn" />
|
||||
<exclude name="ShortClassName" />
|
||||
<exclude name="ShortMethodName" />
|
||||
<exclude name="ShortVariable" />
|
||||
</rule>
|
||||
<rule ref="category/java/codestyle.xml/TooManyStaticImports">
|
||||
<properties>
|
||||
<property name="maximumStaticImports" value="0"/>
|
||||
</properties>
|
||||
</rule>
|
||||
<rule ref="category/java/design.xml">
|
||||
<exclude name="DataClass" />
|
||||
<exclude name="ExcessiveImports" />
|
||||
<exclude name="ExcessiveParameterList"/>
|
||||
<exclude name="LawOfDemeter" />
|
||||
<exclude name="LoosePackageCoupling" />
|
||||
<exclude name="TooManyMethods"/>
|
||||
<exclude name="UseObjectForClearerAPI" />
|
||||
</rule>
|
||||
<!-- <rule ref="category/java/documentation.xml">-->
|
||||
<!-- <exclude name="CommentSize" />-->
|
||||
<!-- </rule>-->
|
||||
<!-- <rule ref="category/java/documentation.xml/CommentRequired">-->
|
||||
<!-- <properties>-->
|
||||
<!-- <property name="fieldCommentRequirement" value="Ignored" />-->
|
||||
<!-- </properties>-->
|
||||
<!-- </rule>-->
|
||||
<rule ref="category/java/errorprone.xml">
|
||||
<exclude name="AvoidFieldNameMatchingMethodName" />
|
||||
<exclude name="DataflowAnomalyAnalysis" />
|
||||
<exclude name="InvalidLogMessageFormat" />
|
||||
<exclude name="ReturnEmptyCollectionRatherThanNull" />
|
||||
</rule>
|
||||
<rule ref="category/java/multithreading.xml">
|
||||
<exclude name="UseConcurrentHashMap" />
|
||||
</rule>
|
||||
<rule ref="category/java/performance.xml" />
|
||||
<rule ref="category/java/security.xml" />
|
||||
</ruleset>
|
||||
@@ -1,80 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<!--
|
||||
~ Copyright 2002-2020 the original author or authors.
|
||||
~
|
||||
~ Licensed 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
|
||||
~
|
||||
~ https://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.
|
||||
-->
|
||||
|
||||
<ruleset name="Test Ruleset"
|
||||
xmlns="https://pmd.sourceforge.net/ruleset/2.0.0"
|
||||
xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="https://pmd.sourceforge.net/ruleset/2.0.0 https://pmd.sourceforge.io/ruleset_2_0_0.xsd">
|
||||
<description>Test Ruleset</description>
|
||||
<rule ref="category/java/bestpractices.xml">
|
||||
<exclude name="AbstractClassWithoutAbstractMethod"/>
|
||||
<exclude name="DoubleBraceInitialization" />
|
||||
<exclude name="JUnitAssertionsShouldIncludeMessage" />
|
||||
<exclude name="JUnitTestContainsTooManyAsserts"/>
|
||||
<exclude name="JUnitTestsShouldIncludeAssert" />
|
||||
</rule>
|
||||
<rule ref="category/java/codestyle.xml">
|
||||
<exclude name="AtLeastOneConstructor" />
|
||||
<exclude name="CommentDefaultAccessModifier" />
|
||||
<exclude name="DefaultPackage" />
|
||||
<exclude name="LocalVariableCouldBeFinal"/>
|
||||
<exclude name="LongVariable" />
|
||||
<exclude name="MethodArgumentCouldBeFinal"/>
|
||||
<exclude name="OnlyOneReturn" />
|
||||
<exclude name="ShortMethodName" />
|
||||
<exclude name="ShortVariable" />
|
||||
<exclude name="TooManyStaticImports"/>
|
||||
</rule>
|
||||
<rule ref="category/java/codestyle.xml/LinguisticNaming">
|
||||
<properties>
|
||||
<property name="checkGetters" value="false" />
|
||||
<property name="checkSetters" value="false" />
|
||||
<property name="checkBooleanMethod" value="false" />
|
||||
</properties>
|
||||
</rule>
|
||||
<rule ref="category/java/design.xml">
|
||||
<exclude name="CouplingBetweenObjects" />
|
||||
<exclude name="DataClass" />
|
||||
<exclude name="ExcessiveImports" />
|
||||
<exclude name="ExcessivePublicCount" />
|
||||
<exclude name="LawOfDemeter" />
|
||||
<exclude name="LoosePackageCoupling" />
|
||||
<exclude name="SignatureDeclareThrowsException"/>
|
||||
<exclude name="TooManyMethods"/>
|
||||
<exclude name="UseObjectForClearerAPI" />
|
||||
<exclude name="AvoidThrowingRawExceptionTypes" />
|
||||
</rule>
|
||||
<rule ref="category/java/documentation.xml">
|
||||
<exclude name="CommentRequired" />
|
||||
<exclude name="CommentSize" />
|
||||
<exclude name="UncommentedEmptyConstructor"/>
|
||||
<exclude name="UncommentedEmptyMethodBody"/>
|
||||
</rule>
|
||||
<rule ref="category/java/errorprone.xml">
|
||||
<exclude name="AvoidDuplicateLiterals" />
|
||||
<exclude name="DataflowAnomalyAnalysis" />
|
||||
<exclude name="InvalidLogMessageFormat" />
|
||||
<exclude name="NonStaticInitializer" />
|
||||
<exclude name="TestClassWithoutTestCases" />
|
||||
</rule>
|
||||
<rule ref="category/java/multithreading.xml">
|
||||
<exclude name="UseConcurrentHashMap" />
|
||||
<exclude name="DoNotUseThreads"/>
|
||||
</rule>
|
||||
<rule ref="category/java/performance.xml" />
|
||||
<rule ref="category/java/security.xml" />
|
||||
</ruleset>
|
||||
Reference in New Issue
Block a user