Added checkstyle, pmd, spotbugs, sonarqube.
This commit is contained in:
parent
f366f9c037
commit
7245515df1
9 changed files with 821 additions and 142 deletions
16
.idea/checkstyle-idea.xml
generated
Normal file
16
.idea/checkstyle-idea.xml
generated
Normal file
|
@ -0,0 +1,16 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CheckStyle-IDEA">
|
||||
<option name="configuration">
|
||||
<map>
|
||||
<entry key="checkstyle-version" value="8.19" />
|
||||
<entry key="copy-libs" value="true" />
|
||||
<entry key="location-0" value="BUNDLED:(bundled):Sun Checks" />
|
||||
<entry key="location-1" value="BUNDLED:(bundled):Google Checks" />
|
||||
<entry key="scan-before-checkin" value="false" />
|
||||
<entry key="scanscope" value="JavaOnly" />
|
||||
<entry key="suppress-errors" value="false" />
|
||||
</map>
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
59
.idea/inspectionProfiles/Project_Default.xml
generated
Normal file
59
.idea/inspectionProfiles/Project_Default.xml
generated
Normal file
|
@ -0,0 +1,59 @@
|
|||
<component name="InspectionProjectProfileManager">
|
||||
<profile version="1.0">
|
||||
<option name="myName" value="Project Default" />
|
||||
<inspection_tool class="AndroidLintNewerVersionAvailable" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="FieldMayBeFinal" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="FieldNamingConvention" enabled="true" level="WARNING" enabled_by_default="true">
|
||||
<extension name="InstanceVariableNamingConvention" enabled="true">
|
||||
<option name="m_regex" value="^[a-z][a-z0-9][a-zA-Z0-9]*$" />
|
||||
<option name="m_minLength" value="2" />
|
||||
<option name="m_maxLength" value="32" />
|
||||
</extension>
|
||||
</inspection_tool>
|
||||
<inspection_tool class="GroovyVariableCanBeFinal" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="JavaDoc" enabled="true" level="WARNING" enabled_by_default="true">
|
||||
<option name="TOP_LEVEL_CLASS_OPTIONS">
|
||||
<value>
|
||||
<option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
|
||||
<option name="REQUIRED_TAGS" value="" />
|
||||
</value>
|
||||
</option>
|
||||
<option name="INNER_CLASS_OPTIONS">
|
||||
<value>
|
||||
<option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
|
||||
<option name="REQUIRED_TAGS" value="" />
|
||||
</value>
|
||||
</option>
|
||||
<option name="METHOD_OPTIONS">
|
||||
<value>
|
||||
<option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
|
||||
<option name="REQUIRED_TAGS" value="@return@param@throws or @exception" />
|
||||
</value>
|
||||
</option>
|
||||
<option name="FIELD_OPTIONS">
|
||||
<value>
|
||||
<option name="ACCESS_JAVADOC_REQUIRED_FOR" value="none" />
|
||||
<option name="REQUIRED_TAGS" value="" />
|
||||
</value>
|
||||
</option>
|
||||
<option name="IGNORE_DEPRECATED" value="false" />
|
||||
<option name="IGNORE_JAVADOC_PERIOD" value="true" />
|
||||
<option name="IGNORE_DUPLICATED_THROWS" value="false" />
|
||||
<option name="IGNORE_POINT_TO_ITSELF" value="false" />
|
||||
<option name="myAdditionalJavadocTags" value="created" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="LiteralAsArgToStringEquals" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="LocalCanBeFinal" enabled="true" level="WARNING" enabled_by_default="true">
|
||||
<option name="REPORT_VARIABLES" value="true" />
|
||||
<option name="REPORT_PARAMETERS" value="true" />
|
||||
<option name="REPORT_CATCH_PARAMETERS" value="false" />
|
||||
</inspection_tool>
|
||||
<inspection_tool class="NonFinalUtilityClass" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||
<inspection_tool class="UnnecessarySemicolon" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||
<inspection_tool class="WeakerAccess" enabled="false" level="WARNING" enabled_by_default="false">
|
||||
<option name="SUGGEST_PACKAGE_LOCAL_FOR_MEMBERS" value="true" />
|
||||
<option name="SUGGEST_PACKAGE_LOCAL_FOR_TOP_CLASSES" value="true" />
|
||||
<option name="SUGGEST_PRIVATE_FOR_INNERS" value="false" />
|
||||
</inspection_tool>
|
||||
</profile>
|
||||
</component>
|
15
.idea/modules/httpstatus.iml
generated
15
.idea/modules/httpstatus.iml
generated
|
@ -1,5 +1,5 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module external.linked.project.id="httpstatus" external.linked.project.path="$MODULE_DIR$/../.." external.root.project.path="$MODULE_DIR$/../.." external.system.id="GRADLE" external.system.module.group="net.thauvin.erik.httpstatus" external.system.module.version="1.0.3" type="JAVA_MODULE" version="4">
|
||||
<module external.linked.project.id="httpstatus" external.linked.project.path="$MODULE_DIR$/../.." external.root.project.path="$MODULE_DIR$/../.." external.system.id="GRADLE" external.system.module.group="net.thauvin.erik.httpstatus" external.system.module.version="1.0.4" type="JAVA_MODULE" version="4">
|
||||
<component name="NewModuleRootManager">
|
||||
<output url="file://$MODULE_DIR$/../../out/production/classes" />
|
||||
<output-test url="file://$MODULE_DIR$/../../out/test/classes" />
|
||||
|
@ -15,13 +15,12 @@
|
|||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Gradle: javax.servlet:javax.servlet-api:3.1.0" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Gradle: javax.servlet.jsp:jsp-api:2.2" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Gradle: javax.servlet:javax.servlet-api:3.1.0" level="project" />
|
||||
<orderEntry type="library" scope="RUNTIME" name="Gradle: javax.servlet.jsp:jsp-api:2.2" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Gradle: javax.servlet:javax.servlet-api:3.1.0" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Gradle: javax.servlet.jsp:jsp-api:2.2" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Gradle: org.testng:testng:6.13.1" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Gradle: com.github.spotbugs:spotbugs-annotations:3.1.12" level="project" />
|
||||
<orderEntry type="library" name="Gradle: javax.servlet:javax.servlet-api:4.0.1" level="project" />
|
||||
<orderEntry type="library" name="Gradle: javax.servlet.jsp:jsp-api:2.2.1-b03" level="project" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="Gradle: com.google.code.findbugs:jsr305:3.0.2" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Gradle: org.testng:testng:6.14.3" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Gradle: com.beust:jcommander:1.72" level="project" />
|
||||
<orderEntry type="library" scope="TEST" name="Gradle: org.apache-extras.beanshell:bsh:2.0b6" level="project" />
|
||||
</component>
|
||||
</module>
|
6
.idea/vcs.xml
generated
Normal file
6
.idea/vcs.xml
generated
Normal file
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
|
@ -1,5 +1,20 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CheckStyle-IDEA">
|
||||
<option name="configuration">
|
||||
<map>
|
||||
<entry key="active-configuration" value="LOCAL_FILE:K:/java/HttpStatus/config/checkstyle/checkstyle.xml:Erik's Checks" />
|
||||
<entry key="checkstyle-version" value="8.19" />
|
||||
<entry key="copy-libs" value="true" />
|
||||
<entry key="location-0" value="BUNDLED:(bundled):Sun Checks" />
|
||||
<entry key="location-1" value="BUNDLED:(bundled):Google Checks" />
|
||||
<entry key="location-2" value="LOCAL_FILE:K:/java/HttpStatus/config/checkstyle/checkstyle.xml:Erik's Checks" />
|
||||
<entry key="scan-before-checkin" value="false" />
|
||||
<entry key="scanscope" value="JavaOnlyWithTests" />
|
||||
<entry key="suppress-errors" value="false" />
|
||||
</map>
|
||||
</option>
|
||||
</component>
|
||||
<component name="ClientPropertiesManager">
|
||||
<properties class="javax.swing.AbstractButton">
|
||||
<property name="hideActionText" class="java.lang.Boolean" />
|
||||
|
@ -159,6 +174,22 @@
|
|||
</MavenGeneralSettings>
|
||||
</option>
|
||||
</component>
|
||||
<component name="PDMPlugin">
|
||||
<option name="customRuleSets">
|
||||
<list>
|
||||
<option value="K:\java\HttpStatus\config\pmd.xml" />
|
||||
</list>
|
||||
</option>
|
||||
<option name="options">
|
||||
<map>
|
||||
<entry key="Encoding" value="" />
|
||||
<entry key="Target JDK" value="1.8" />
|
||||
</map>
|
||||
</option>
|
||||
</component>
|
||||
<component name="ProjectCodeStyleConfiguration">
|
||||
<option name="PREFERRED_PROJECT_CODE_STYLE" value="Erik's Code Style" />
|
||||
</component>
|
||||
<component name="ProjectInspectionProfilesVisibleTreeState">
|
||||
<entry key="Project Default">
|
||||
<profile-state>
|
||||
|
@ -191,10 +222,10 @@
|
|||
</component>
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/modules/httpstatus.iml" filepath="$PROJECT_DIR$/.idea/modules/httpstatus.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/modules/httpstatus.iml" filepath="$PROJECT_DIR$/.idea/modules/httpstatus.iml" group="httpstatus" />
|
||||
</modules>
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" project-jdk-name="9.0.x" project-jdk-type="JavaSDK">
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_8" default="false" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/build/classes" />
|
||||
</component>
|
||||
<component name="PropertiesComponent">
|
||||
|
@ -307,31 +338,58 @@
|
|||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.beust/jcommander/1.72/7ef123d5dfb6f839b41265648ff1be34982d50f8/jcommander-1.72-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
<library name="Gradle: javax.servlet.jsp:jsp-api:2.2">
|
||||
<library name="Gradle: com.github.spotbugs:spotbugs-annotations:3.1.12">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/javax.servlet.jsp/jsp-api/2.2/5bf0c26ef77df58c7c28be2d9d52246f2b437a54/jsp-api-2.2.jar!/" />
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.github.spotbugs/spotbugs-annotations/3.1.12/ba2c77a05091820668987292f245f3b089387bfa/spotbugs-annotations-3.1.12.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/javax.servlet.jsp/jsp-api/2.2/78bc1457a1fc2f8a7037cd2b247062ab3daac212/jsp-api-2.2-sources.jar!/" />
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.github.spotbugs/spotbugs-annotations/3.1.12/1d7b1099a4318469157e2172e0559ce0c5b2a85b/spotbugs-annotations-3.1.12-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
<library name="Gradle: javax.servlet:javax.servlet-api:3.1.0">
|
||||
<library name="Gradle: com.google.code.findbugs:jsr305:3.0.2">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/javax.servlet/javax.servlet-api/3.1.0/3cd63d075497751784b2fa84be59432f4905bf7c/javax.servlet-api-3.1.0.jar!/" />
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.google.code.findbugs/jsr305/3.0.2/25ea2e8b0c338a877313bd4672d3fe056ea78f0d/jsr305-3.0.2.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/javax.servlet/javax.servlet-api/3.1.0/ab3976d4574c48d22dc1abf6a9e8bd0fdf928223/javax.servlet-api-3.1.0-sources.jar!/" />
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/com.google.code.findbugs/jsr305/3.0.2/b19b5927c2c25b6c70f093767041e641ae0b1b35/jsr305-3.0.2-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
<library name="Gradle: org.testng:testng:6.13.1">
|
||||
<library name="Gradle: javax.servlet.jsp:jsp-api:2.2.1-b03">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.testng/testng/6.13.1/2495393a0b4b7d7a4b49ea1f8516376f70f482c/testng-6.13.1.jar!/" />
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/javax.servlet.jsp/jsp-api/2.2.1-b03/c7205b380e9ceb4b96745656755f31f76ae01b74/jsp-api-2.2.1-b03.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.testng/testng/6.13.1/a2b77dfee647263d2c1010215441bfa3e28c4b9c/testng-6.13.1-sources.jar!/" />
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/javax.servlet.jsp/jsp-api/2.2.1-b03/5ee3f521021fd5d8c0a89a208a228c1ab10ef854/jsp-api-2.2.1-b03-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
<library name="Gradle: javax.servlet:javax.servlet-api:4.0.1">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/javax.servlet/javax.servlet-api/4.0.1/a27082684a2ff0bf397666c3943496c44541d1ca/javax.servlet-api-4.0.1.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/javax.servlet/javax.servlet-api/4.0.1/49a9da44db6e6b5f44ce15ddfcfe2b6666151b25/javax.servlet-api-4.0.1-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
<library name="Gradle: org.apache-extras.beanshell:bsh:2.0b6">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.apache-extras.beanshell/bsh/2.0b6/fb418f9b33a0b951e9a2978b4b6ee93b2707e72f/bsh-2.0b6.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.apache-extras.beanshell/bsh/2.0b6/76a65f674e8f2df409934824c49ca338987c63ae/bsh-2.0b6-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
<library name="Gradle: org.testng:testng:6.14.3">
|
||||
<CLASSES>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.testng/testng/6.14.3/d24515dc253e77e54b73df97e1fb2eb7faf34fdd/testng-6.14.3.jar!/" />
|
||||
</CLASSES>
|
||||
<JAVADOC />
|
||||
<SOURCES>
|
||||
<root url="jar://$USER_HOME$/.gradle/caches/modules-2/files-2.1/org.testng/testng/6.14.3/bfd2538501a129a142fe8366169c48b91609dc0b/testng-6.14.3-sources.jar!/" />
|
||||
</SOURCES>
|
||||
</library>
|
||||
</component>
|
||||
|
|
250
build.gradle
250
build.gradle
|
@ -1,20 +1,25 @@
|
|||
plugins {
|
||||
id "com.jfrog.bintray" version "1.8.0"
|
||||
id "com.github.ben-manes.versions" version "0.17.0"
|
||||
id 'checkstyle'
|
||||
id 'java'
|
||||
id 'jacoco'
|
||||
id 'idea'
|
||||
id 'application'
|
||||
id 'maven'
|
||||
id 'maven-publish'
|
||||
id 'pmd'
|
||||
id 'com.jfrog.bintray' version '1.8.4'
|
||||
id 'com.github.ben-manes.versions' version '0.21.0'
|
||||
id 'net.thauvin.erik.gradle.semver' version '1.0.0'
|
||||
id 'com.github.spotbugs' version '1.7.1'
|
||||
id 'org.sonarqube' version '2.7'
|
||||
}
|
||||
apply plugin: 'java'
|
||||
apply plugin: 'idea'
|
||||
apply plugin: 'application'
|
||||
apply plugin: 'maven'
|
||||
apply plugin: 'maven-publish'
|
||||
|
||||
import com.github.spotbugs.SpotBugsTask
|
||||
import org.apache.tools.ant.taskdefs.condition.Os
|
||||
|
||||
defaultTasks 'deploy'
|
||||
|
||||
def deployDir = 'deploy'
|
||||
def localProps = 'local.properties'
|
||||
def isRelease = 'release' in gradle.startParameter.taskNames
|
||||
|
||||
def mavenName = 'HttpStatus'
|
||||
def mavenDescription = 'HttpStatus JSP Tag Library'
|
||||
|
@ -28,30 +33,6 @@ def pkgLicenses = ['BSD 3-Clause']
|
|||
def pkgIssueTrackerUrl = mavenUrl + '/issues'
|
||||
def pkgLabels = ['jsp', 'tag library', 'http', 'status code', 'java']
|
||||
|
||||
def getVersion(isIncrement = false) {
|
||||
def propsFile = 'version.properties'
|
||||
def majorKey = 'version.major'
|
||||
def minorKey = 'version.minor'
|
||||
def patchKey = 'version.patch'
|
||||
def metaKey = 'version.buildmeta'
|
||||
def preKey = 'version.prerelease'
|
||||
if (isIncrement) {
|
||||
ant.propertyfile(file: propsFile) {
|
||||
entry(key: patchKey,
|
||||
type: 'int',
|
||||
default: '-1',
|
||||
operation: '+')
|
||||
}
|
||||
}
|
||||
def p = new Properties()
|
||||
file(propsFile).withInputStream { stream -> p.load(stream) }
|
||||
def metadata = p.getProperty(metaKey, '')
|
||||
def prerelease = p.getProperty(preKey, '')
|
||||
return (p.getProperty(majorKey, '1') + '.' + p.getProperty(minorKey, '0') + '.' + p.getProperty(patchKey, '0') +
|
||||
(prerelease.length() > 0 ? '-' + prerelease : '') + (metadata.length() > 0 ? '+' + metadata : ''))
|
||||
}
|
||||
|
||||
version = getVersion();
|
||||
group = 'net.thauvin.erik.httpstatus'
|
||||
|
||||
mainClassName = 'net.thauvin.erik.httpstatus.Reasons'
|
||||
|
@ -65,10 +46,66 @@ repositories {
|
|||
}
|
||||
|
||||
dependencies {
|
||||
compile 'javax.servlet:javax.servlet-api:4.0.0'
|
||||
compile 'javax.servlet.jsp:jsp-api:2.2'
|
||||
implementation 'javax.servlet:javax.servlet-api:4.0.1'
|
||||
implementation 'javax.servlet.jsp:jsp-api:2.2.1-b03'
|
||||
|
||||
testCompile 'org.testng:testng:6.13.1'
|
||||
spotbugsPlugins 'com.h3xstream.findsecbugs:findsecbugs-plugin:1.9.0'
|
||||
spotbugsPlugins 'com.mebigfatguy.fb-contrib:fb-contrib:7.4.3.sb'
|
||||
|
||||
compileOnly 'com.github.spotbugs:spotbugs-annotations:3.1.12'
|
||||
testCompileOnly 'com.github.spotbugs:spotbugs-annotations:3.1.12'
|
||||
|
||||
testImplementation 'org.testng:testng:6.14.3'
|
||||
}
|
||||
|
||||
javadoc {
|
||||
title = mavenDescription + ' ' + version
|
||||
options.tags = ['created']
|
||||
options.author = true
|
||||
options.links('https://docs.oracle.com/javaee/7/api/', 'https://docs.oracle.com/javase/8/docs/api/')
|
||||
//options.addStringOption('sourcepath', project.hasProperty('jdkSrc') ? jdkSrc : "$System.env.JAVA_HOME/src.zip")
|
||||
if (JavaVersion.current().isJava8Compatible()) {
|
||||
options.addStringOption('Xdoclint:none', '-quiet')
|
||||
}
|
||||
}
|
||||
|
||||
compileJava {
|
||||
//options.compilerArgs << '-Xlint:unchecked' << '-Xlint:deprecation'
|
||||
}
|
||||
|
||||
|
||||
jar {
|
||||
manifest.attributes('Main-Class': mainClassName)
|
||||
}
|
||||
|
||||
clean {
|
||||
doLast {
|
||||
project.delete(fileTree(deployDir))
|
||||
}
|
||||
}
|
||||
|
||||
test {
|
||||
useTestNG()
|
||||
}
|
||||
|
||||
pmd {
|
||||
ruleSetFiles = files("config/pmd.xml")
|
||||
ruleSets = []
|
||||
}
|
||||
|
||||
tasks.withType(SpotBugsTask) {
|
||||
reports {
|
||||
xml.enabled = false
|
||||
html.enabled = true
|
||||
}
|
||||
excludeFilter = file("$projectDir/config/spotbugs/excludeFilter.xml")
|
||||
}
|
||||
|
||||
tasks.withType(Checkstyle) {
|
||||
reports {
|
||||
xml.enabled = false
|
||||
html.enabled = true
|
||||
}
|
||||
}
|
||||
|
||||
bintray {
|
||||
|
@ -97,26 +134,23 @@ bintray {
|
|||
}
|
||||
}
|
||||
|
||||
def pomConfig = {
|
||||
licenses {
|
||||
license {
|
||||
name mavenLicense
|
||||
url mavenLicenseUrl
|
||||
distribution 'repo'
|
||||
}
|
||||
}
|
||||
developers {
|
||||
developer {
|
||||
id 'ethauvin'
|
||||
name 'Erik C. Thauvin'
|
||||
email 'erik@thauvin.net'
|
||||
}
|
||||
}
|
||||
scm {
|
||||
connection 'scm:git:' + mavenScmCon
|
||||
developerConnection 'scm:git:' + mavenScmDevCon
|
||||
url mavenScmCon
|
||||
}
|
||||
task javadocJar(type: Jar, dependsOn: javadoc) {
|
||||
group = 'Build'
|
||||
description = 'Builds an archive of the javadoc docs.'
|
||||
archiveClassifier = 'javadoc'
|
||||
from javadoc.destinationDir
|
||||
}
|
||||
|
||||
task sourcesJar(type: Jar) {
|
||||
group = 'Build'
|
||||
description = 'Builds an archive of the source code.'
|
||||
archiveClassifier = 'sources'
|
||||
from sourceSets.main.allSource
|
||||
}
|
||||
|
||||
artifacts {
|
||||
archives javadocJar
|
||||
archives sourcesJar
|
||||
}
|
||||
|
||||
publishing {
|
||||
|
@ -127,73 +161,35 @@ publishing {
|
|||
artifact javadocJar
|
||||
groupId project.group
|
||||
artifactId rootProject.name
|
||||
version project.version
|
||||
|
||||
pom.withXml {
|
||||
def root = asNode()
|
||||
root.appendNode('name', mavenName)
|
||||
root.appendNode('description', mavenDescription)
|
||||
root.appendNode('url', mavenUrl)
|
||||
root.children().last() + pomConfig
|
||||
pom {
|
||||
name = mavenName
|
||||
description = mavenDescription
|
||||
url = mavenUrl
|
||||
licenses {
|
||||
license {
|
||||
name = mavenLicense
|
||||
url = mavenLicenseUrl
|
||||
distribution = 'repo'
|
||||
}
|
||||
}
|
||||
developers {
|
||||
developer {
|
||||
id = 'ethauvin'
|
||||
name = 'Erik C. Thauvin'
|
||||
email = 'erik@thauvin.net'
|
||||
}
|
||||
}
|
||||
scm {
|
||||
connection = 'scm:git:' + mavenScmCon
|
||||
developerConnection = 'scm:git:' + mavenScmDevCon
|
||||
url = mavenScmCon
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
task javadocJar(type: Jar, dependsOn: javadoc) {
|
||||
group = 'Build'
|
||||
description = 'Builds an archive of the javadoc docs.'
|
||||
classifier = 'javadoc'
|
||||
from javadoc.destinationDir
|
||||
}
|
||||
|
||||
task sourcesJar(type: Jar) {
|
||||
group = 'Build'
|
||||
description = 'Builds an archive of the source code.'
|
||||
classifier = 'sources'
|
||||
from sourceSets.main.allSource
|
||||
}
|
||||
|
||||
artifacts {
|
||||
archives javadocJar
|
||||
archives sourcesJar
|
||||
}
|
||||
|
||||
javadoc {
|
||||
title = mavenDescription + ' ' + version
|
||||
options.tags = ['created']
|
||||
options.author = true
|
||||
options.links('https://docs.oracle.com/javaee/7/api/', 'http://docs.oracle.com/javase/8/docs/api/')
|
||||
//options.addStringOption('sourcepath', project.hasProperty('jdkSrc') ? jdkSrc : "$System.env.JAVA_HOME/src.zip")
|
||||
if (JavaVersion.current().isJava8Compatible()) {
|
||||
options.addStringOption('Xdoclint:none', '-quiet')
|
||||
}
|
||||
}
|
||||
|
||||
compileJava {
|
||||
doFirst {
|
||||
project.version = getVersion(isRelease)
|
||||
}
|
||||
//options.compilerArgs << '-Xlint:unchecked' << '-Xlint:deprecation'
|
||||
}
|
||||
|
||||
|
||||
jar {
|
||||
manifest.attributes('Main-Class': mainClassName)
|
||||
}
|
||||
|
||||
clean {
|
||||
delete deployDir
|
||||
}
|
||||
|
||||
test {
|
||||
useTestNG()
|
||||
}
|
||||
|
||||
task wrapper(type: Wrapper) {
|
||||
gradleVersion = gradle.gradleVersion
|
||||
}
|
||||
|
||||
task copyToDeploy(type: Copy) {
|
||||
from(configurations.runtime) {
|
||||
exclude 'javax.servlet-api-*.jar'
|
||||
|
@ -203,7 +199,7 @@ task copyToDeploy(type: Copy) {
|
|||
into deployDir
|
||||
}
|
||||
|
||||
task deploy(dependsOn: ['build', 'copyToDeploy']) {
|
||||
task deploy(dependsOn: ['clean', 'build', 'copyToDeploy']) {
|
||||
description = 'Copies all needed files to the ${deployDir} directory.'
|
||||
group = 'Publishing'
|
||||
outputs.dir deployDir
|
||||
|
@ -211,18 +207,16 @@ task deploy(dependsOn: ['build', 'copyToDeploy']) {
|
|||
mustRunAfter clean
|
||||
}
|
||||
|
||||
task release(dependsOn: ['wrapper', 'clean', 'deploy']) {
|
||||
task release(dependsOn: ['wrapper', 'deploy']) {
|
||||
group = 'Publishing'
|
||||
description = 'Releases new version.'
|
||||
doFirst {
|
||||
isRelease = true
|
||||
}
|
||||
}
|
||||
|
||||
task pandoc(type: Exec) {
|
||||
group = 'Documentation'
|
||||
def pandoc_args = ['--from', 'markdown_github',
|
||||
def pandoc_args = ['--from', 'gfm',
|
||||
'--to', 'html5',
|
||||
'--metadata', "pagetitle=$mavenDescription",
|
||||
'-s',
|
||||
'-c', 'github-pandoc.css',
|
||||
'-o', 'docs/README.html',
|
||||
|
@ -239,3 +233,13 @@ task pandoc(type: Exec) {
|
|||
}
|
||||
}
|
||||
|
||||
sonarqube {
|
||||
properties {
|
||||
property("sonar.projectKey", "ethauvin_HttpStatus")
|
||||
property("sonar.sourceEncoding", "UTF-8")
|
||||
}
|
||||
}
|
||||
|
||||
tasks.sonarqube {
|
||||
dependsOn("jacocoTestReport")
|
||||
}
|
||||
|
|
267
config/checkstyle/checkstyle.xml
Normal file
267
config/checkstyle/checkstyle.xml
Normal file
|
@ -0,0 +1,267 @@
|
|||
<?xml version="1.0"?>
|
||||
<!DOCTYPE module PUBLIC
|
||||
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
|
||||
"https://checkstyle.org/dtds/configuration_1_3.dtd">
|
||||
|
||||
<!--
|
||||
Checkstyle configuration that checks the Google coding conventions from Google Java Style
|
||||
that can be found at https://google.github.io/styleguide/javaguide.html.
|
||||
|
||||
Checkstyle is very configurable. Be sure to read the documentation at
|
||||
http://checkstyle.sf.net (or in your downloaded distribution).
|
||||
|
||||
To completely disable a check, just comment it out or delete it from the file.
|
||||
|
||||
Authors: Max Vetrenko, Ruslan Diachenko, Roman Ivanov.
|
||||
-->
|
||||
|
||||
<module name="Checker">
|
||||
<property name="charset" value="UTF-8"/>
|
||||
|
||||
<property name="severity" value="warning"/>
|
||||
|
||||
<property name="fileExtensions" value="java, properties, xml"/>
|
||||
<!-- Excludes all 'module-info.java' files -->
|
||||
<!-- See https://checkstyle.org/config_filefilters.html -->
|
||||
<module name="BeforeExecutionExclusionFileFilter">
|
||||
<property name="fileNamePattern" value="module\-info\.java$"/>
|
||||
</module>
|
||||
<!-- Checks for whitespace -->
|
||||
<!-- See http://checkstyle.sf.net/config_whitespace.html -->
|
||||
<module name="FileTabCharacter">
|
||||
<property name="eachLine" value="true"/>
|
||||
</module>
|
||||
|
||||
<module name="SuppressWarningsFilter"/>
|
||||
|
||||
<module name="TreeWalker">
|
||||
<module name="SuppressWarningsHolder"/>
|
||||
<module name="OuterTypeFilename"/>
|
||||
<module name="IllegalTokenText">
|
||||
<property name="tokens" value="STRING_LITERAL, CHAR_LITERAL"/>
|
||||
<property name="format"
|
||||
value="\\u00(09|0(a|A)|0(c|C)|0(d|D)|22|27|5(C|c))|\\(0(10|11|12|14|15|42|47)|134)"/>
|
||||
<property name="message"
|
||||
value="Consider using special escape sequence instead of octal value or Unicode escaped value."/>
|
||||
</module>
|
||||
<module name="AvoidEscapedUnicodeCharacters">
|
||||
<property name="allowEscapesForControlCharacters" value="true"/>
|
||||
<property name="allowByTailComment" value="true"/>
|
||||
<property name="allowNonPrintableEscapes" value="true"/>
|
||||
</module>
|
||||
<module name="LineLength">
|
||||
<property name="max" value="120"/>
|
||||
<property name="ignorePattern" value="^package.*|^import.*|a href|href|http://|https://|ftp://"/>
|
||||
</module>
|
||||
<module name="AvoidStarImport"/>
|
||||
<module name="OneTopLevelClass"/>
|
||||
<module name="NoLineWrap"/>
|
||||
<module name="EmptyBlock">
|
||||
<property name="option" value="TEXT"/>
|
||||
<property name="tokens"
|
||||
value="LITERAL_TRY, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE, LITERAL_SWITCH"/>
|
||||
</module>
|
||||
<module name="NeedBraces"/>
|
||||
<module name="LeftCurly"/>
|
||||
<module name="RightCurly">
|
||||
<property name="id" value="RightCurlySame"/>
|
||||
<property name="tokens"
|
||||
value="LITERAL_TRY, LITERAL_CATCH, LITERAL_FINALLY, LITERAL_IF, LITERAL_ELSE,
|
||||
LITERAL_DO"/>
|
||||
</module>
|
||||
<module name="RightCurly">
|
||||
<property name="id" value="RightCurlyAlone"/>
|
||||
<property name="option" value="alone"/>
|
||||
<property name="tokens"
|
||||
value="CLASS_DEF, METHOD_DEF, CTOR_DEF, LITERAL_FOR, LITERAL_WHILE, STATIC_INIT,
|
||||
INSTANCE_INIT"/>
|
||||
</module>
|
||||
<module name="WhitespaceAround">
|
||||
<property name="allowEmptyConstructors" value="true"/>
|
||||
<property name="allowEmptyLambdas" value="true"/>
|
||||
<property name="allowEmptyMethods" value="true"/>
|
||||
<property name="allowEmptyTypes" value="true"/>
|
||||
<property name="allowEmptyLoops" value="true"/>
|
||||
<message key="ws.notFollowed"
|
||||
value="WhitespaceAround: ''{0}'' is not followed by whitespace. Empty blocks may only be represented as '{}' when not part of a multi-block statement (4.1.3)"/>
|
||||
<message key="ws.notPreceded"
|
||||
value="WhitespaceAround: ''{0}'' is not preceded with whitespace."/>
|
||||
</module>
|
||||
<module name="OneStatementPerLine"/>
|
||||
<module name="MultipleVariableDeclarations"/>
|
||||
<module name="ArrayTypeStyle"/>
|
||||
<module name="MissingSwitchDefault"/>
|
||||
<module name="FallThrough"/>
|
||||
<module name="UpperEll"/>
|
||||
<module name="ModifierOrder"/>
|
||||
<module name="EmptyLineSeparator">
|
||||
<property name="allowNoEmptyLineBetweenFields" value="true"/>
|
||||
</module>
|
||||
<module name="SeparatorWrap">
|
||||
<property name="id" value="SeparatorWrapDot"/>
|
||||
<property name="tokens" value="DOT"/>
|
||||
<property name="option" value="nl"/>
|
||||
</module>
|
||||
<module name="SeparatorWrap">
|
||||
<property name="id" value="SeparatorWrapComma"/>
|
||||
<property name="tokens" value="COMMA"/>
|
||||
<property name="option" value="EOL"/>
|
||||
</module>
|
||||
<module name="SeparatorWrap">
|
||||
<!-- ELLIPSIS is EOL until https://github.com/google/styleguide/issues/258 -->
|
||||
<property name="id" value="SeparatorWrapEllipsis"/>
|
||||
<property name="tokens" value="ELLIPSIS"/>
|
||||
<property name="option" value="EOL"/>
|
||||
</module>
|
||||
<module name="SeparatorWrap">
|
||||
<!-- ARRAY_DECLARATOR is EOL until https://github.com/google/styleguide/issues/259 -->
|
||||
<property name="id" value="SeparatorWrapArrayDeclarator"/>
|
||||
<property name="tokens" value="ARRAY_DECLARATOR"/>
|
||||
<property name="option" value="EOL"/>
|
||||
</module>
|
||||
<module name="SeparatorWrap">
|
||||
<property name="id" value="SeparatorWrapMethodRef"/>
|
||||
<property name="tokens" value="METHOD_REF"/>
|
||||
<property name="option" value="nl"/>
|
||||
</module>
|
||||
<module name="PackageName">
|
||||
<property name="format" value="^[a-z]+(\.[a-z][a-z0-9]*)*$"/>
|
||||
<message key="name.invalidPattern"
|
||||
value="Package name ''{0}'' must match pattern ''{1}''."/>
|
||||
</module>
|
||||
<module name="TypeName">
|
||||
<message key="name.invalidPattern"
|
||||
value="Type name ''{0}'' must match pattern ''{1}''."/>
|
||||
</module>
|
||||
<module name="MemberName">
|
||||
<property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9]*$"/>
|
||||
<message key="name.invalidPattern"
|
||||
value="Member name ''{0}'' must match pattern ''{1}''."/>
|
||||
</module>
|
||||
<module name="ParameterName">
|
||||
<property name="format" value="^[a-z]([a-z0-9][a-zA-Z0-9]*)?$"/>
|
||||
<message key="name.invalidPattern"
|
||||
value="Parameter name ''{0}'' must match pattern ''{1}''."/>
|
||||
</module>
|
||||
<module name="LambdaParameterName">
|
||||
<property name="format" value="^[a-z]([a-z0-9][a-zA-Z0-9]*)?$"/>
|
||||
<message key="name.invalidPattern"
|
||||
value="Lambda parameter name ''{0}'' must match pattern ''{1}''."/>
|
||||
</module>
|
||||
<module name="CatchParameterName">
|
||||
<property name="format" value="^[a-z]([a-z0-9][a-zA-Z0-9]*)?$"/>
|
||||
<message key="name.invalidPattern"
|
||||
value="Catch parameter name ''{0}'' must match pattern ''{1}''."/>
|
||||
</module>
|
||||
<module name="LocalVariableName">
|
||||
<property name="tokens" value="VARIABLE_DEF"/>
|
||||
<property name="format" value="^[a-z]([a-z0-9][a-zA-Z0-9]*)?$"/>
|
||||
<message key="name.invalidPattern"
|
||||
value="Local variable name ''{0}'' must match pattern ''{1}''."/>
|
||||
</module>
|
||||
<module name="ClassTypeParameterName">
|
||||
<property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
|
||||
<message key="name.invalidPattern"
|
||||
value="Class type name ''{0}'' must match pattern ''{1}''."/>
|
||||
</module>
|
||||
<module name="MethodTypeParameterName">
|
||||
<property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
|
||||
<message key="name.invalidPattern"
|
||||
value="Method type name ''{0}'' must match pattern ''{1}''."/>
|
||||
</module>
|
||||
<module name="InterfaceTypeParameterName">
|
||||
<property name="format" value="(^[A-Z][0-9]?)$|([A-Z][a-zA-Z0-9]*[T]$)"/>
|
||||
<message key="name.invalidPattern"
|
||||
value="Interface type name ''{0}'' must match pattern ''{1}''."/>
|
||||
</module>
|
||||
<module name="NoFinalizer"/>
|
||||
<module name="GenericWhitespace">
|
||||
<message key="ws.followed"
|
||||
value="GenericWhitespace ''{0}'' is followed by whitespace."/>
|
||||
<message key="ws.preceded"
|
||||
value="GenericWhitespace ''{0}'' is preceded with whitespace."/>
|
||||
<message key="ws.illegalFollow"
|
||||
value="GenericWhitespace ''{0}'' should followed by whitespace."/>
|
||||
<message key="ws.notPreceded"
|
||||
value="GenericWhitespace ''{0}'' is not preceded with whitespace."/>
|
||||
</module>
|
||||
<module name="Indentation">
|
||||
<property name="basicOffset" value="4"/>
|
||||
<property name="braceAdjustment" value="0"/>
|
||||
<property name="caseIndent" value="4"/>
|
||||
<property name="throwsIndent" value="4"/>
|
||||
<property name="lineWrappingIndentation" value="4"/>
|
||||
<property name="arrayInitIndent" value="4"/>
|
||||
</module>
|
||||
<module name="AbbreviationAsWordInName">
|
||||
<property name="ignoreFinal" value="false"/>
|
||||
<property name="allowedAbbreviationLength" value="1"/>
|
||||
</module>
|
||||
<module name="OverloadMethodsDeclarationOrder"/>
|
||||
<module name="VariableDeclarationUsageDistance"/>
|
||||
<module name="CustomImportOrder">
|
||||
<property name="customImportOrderRules"
|
||||
value="THIRD_PARTY_PACKAGE###SPECIAL_IMPORTS###STANDARD_JAVA_PACKAGE###STATIC"/>
|
||||
<property name="specialImportsRegExp" value="^javax\."/>
|
||||
<property name="standardPackageRegExp" value="^java\."/>
|
||||
<property name="sortImportsInGroupAlphabetically" value="true"/>
|
||||
<property name="separateLineBetweenGroups" value="false"/>
|
||||
</module>
|
||||
<module name="MethodParamPad"/>
|
||||
<module name="NoWhitespaceBefore">
|
||||
<property name="tokens"
|
||||
value="COMMA, SEMI, POST_INC, POST_DEC, DOT, ELLIPSIS, METHOD_REF"/>
|
||||
<property name="allowLineBreaks" value="true"/>
|
||||
</module>
|
||||
<module name="ParenPad"/>
|
||||
<module name="OperatorWrap">
|
||||
<property name="option" value="NL"/>
|
||||
<property name="tokens"
|
||||
value="BAND, BOR, BSR, BXOR, DIV, EQUAL, GE, GT, LAND, LE, LITERAL_INSTANCEOF, LOR,
|
||||
LT, MINUS, MOD, NOT_EQUAL, PLUS, QUESTION, SL, SR, STAR, METHOD_REF "/>
|
||||
</module>
|
||||
<module name="AnnotationLocation">
|
||||
<property name="id" value="AnnotationLocationMostCases"/>
|
||||
<property name="tokens"
|
||||
value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF"/>
|
||||
</module>
|
||||
<module name="AnnotationLocation">
|
||||
<property name="id" value="AnnotationLocationVariables"/>
|
||||
<property name="tokens" value="VARIABLE_DEF"/>
|
||||
<property name="allowSamelineMultipleAnnotations" value="true"/>
|
||||
</module>
|
||||
<module name="NonEmptyAtclauseDescription"/>
|
||||
<module name="JavadocTagContinuationIndentation"/>
|
||||
<module name="SummaryJavadoc">
|
||||
<property name="forbiddenSummaryFragments"
|
||||
value="^@return the *|^This method returns |^A [{]@code [a-zA-Z0-9]+[}]( is a )"/>
|
||||
</module>
|
||||
<module name="JavadocParagraph"/>
|
||||
<module name="AtclauseOrder">
|
||||
<property name="tagOrder" value="@param, @return, @throws, @deprecated"/>
|
||||
<property name="target"
|
||||
value="CLASS_DEF, INTERFACE_DEF, ENUM_DEF, METHOD_DEF, CTOR_DEF, VARIABLE_DEF"/>
|
||||
</module>
|
||||
<module name="JavadocMethod">
|
||||
<property name="scope" value="public"/>
|
||||
<property name="allowMissingParamTags" value="true"/>
|
||||
<property name="allowMissingThrowsTags" value="true"/>
|
||||
<property name="allowMissingReturnTag" value="true"/>
|
||||
<property name="minLineCount" value="2"/>
|
||||
<property name="allowedAnnotations" value="Override, Test"/>
|
||||
<property name="allowThrowsTagsForSubclasses" value="true"/>
|
||||
</module>
|
||||
<module name="MethodName">
|
||||
<property name="format" value="^[a-z][a-z0-9][a-zA-Z0-9_]*$"/>
|
||||
<message key="name.invalidPattern"
|
||||
value="Method name ''{0}'' must match pattern ''{1}''."/>
|
||||
</module>
|
||||
<module name="SingleLineJavadoc">
|
||||
<property name="ignoreInlineTags" value="false"/>
|
||||
</module>
|
||||
<module name="EmptyCatchBlock">
|
||||
<property name="exceptionVariableName" value="expected"/>
|
||||
</module>
|
||||
<module name="CommentsIndentation"/>
|
||||
</module>
|
||||
</module>
|
254
config/pmd.xml
Normal file
254
config/pmd.xml
Normal file
|
@ -0,0 +1,254 @@
|
|||
<?xml version="1.0"?>
|
||||
<ruleset name="erik"
|
||||
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 https://pmd.sourceforge.io/ruleset_2_0_0.xsd">
|
||||
<description>Erik's Ruleset</description>
|
||||
<!-- BEST PRACTICES -->
|
||||
<rule ref="category/java/bestpractices.xml/AvoidStringBufferField"/>
|
||||
<rule ref="category/java/bestpractices.xml/AvoidUsingHardCodedIP"/>
|
||||
<rule ref="category/java/bestpractices.xml/CheckResultSet"/>
|
||||
<rule ref="category/java/bestpractices.xml/ConstantsInInterface"/>
|
||||
<rule ref="category/java/bestpractices.xml/DefaultLabelNotLastInSwitchStmt"/>
|
||||
<rule ref="category/java/bestpractices.xml/ForLoopCanBeForeach"/>
|
||||
<rule ref="category/java/bestpractices.xml/GuardLogStatement"/>
|
||||
<rule ref="category/java/bestpractices.xml/LooseCoupling"/>
|
||||
<rule ref="category/java/bestpractices.xml/MethodReturnsInternalArray"/>
|
||||
<rule ref="category/java/bestpractices.xml/MissingOverride"/>
|
||||
<rule ref="category/java/bestpractices.xml/PositionLiteralsFirstInCaseInsensitiveComparisons"/>
|
||||
<rule ref="category/java/bestpractices.xml/PositionLiteralsFirstInComparisons"/>
|
||||
<rule ref="category/java/bestpractices.xml/PreserveStackTrace"/>
|
||||
<rule ref="category/java/bestpractices.xml/ReplaceEnumerationWithIterator"/>
|
||||
<rule ref="category/java/bestpractices.xml/ReplaceHashtableWithMap"/>
|
||||
<rule ref="category/java/bestpractices.xml/ReplaceVectorWithList"/>
|
||||
<rule ref="category/java/bestpractices.xml/SwitchStmtsShouldHaveDefault"/>
|
||||
<rule ref="category/java/bestpractices.xml/SystemPrintln"/>
|
||||
<rule ref="category/java/bestpractices.xml/UnusedFormalParameter"/>
|
||||
<rule ref="category/java/bestpractices.xml/UnusedImports"/>
|
||||
<rule ref="category/java/bestpractices.xml/UnusedLocalVariable"/>
|
||||
<rule ref="category/java/bestpractices.xml/UnusedPrivateField"/>
|
||||
<rule ref="category/java/bestpractices.xml/UnusedPrivateMethod"/>
|
||||
<rule ref="category/java/bestpractices.xml/UseAssertEqualsInsteadOfAssertTrue"/>
|
||||
<rule ref="category/java/bestpractices.xml/UseAssertNullInsteadOfAssertTrue"/>
|
||||
<rule ref="category/java/bestpractices.xml/UseAssertSameInsteadOfAssertTrue"/>
|
||||
<rule ref="category/java/bestpractices.xml/UseAssertTrueInsteadOfAssertEquals"/>
|
||||
<rule ref="category/java/bestpractices.xml/UseCollectionIsEmpty"/>
|
||||
<rule ref="category/java/bestpractices.xml/UseVarargs"/>
|
||||
|
||||
|
||||
<!-- NAMING CONVENTIONS -->
|
||||
<rule ref="category/java/codestyle.xml/FormalParameterNamingConventions"/>
|
||||
<rule ref="category/java/codestyle.xml/GenericsNaming"/>
|
||||
<rule ref="category/java/codestyle.xml/LocalVariableNamingConventions"/>
|
||||
<rule ref="category/java/codestyle.xml/MethodNamingConventions"/>
|
||||
<rule ref="category/java/codestyle.xml/PackageCase"/>
|
||||
|
||||
|
||||
<!-- OTHER -->
|
||||
<rule ref="category/java/codestyle.xml/AvoidDollarSigns"/>
|
||||
<rule ref="category/java/codestyle.xml/AvoidProtectedFieldInFinalClass"/>
|
||||
<rule ref="category/java/codestyle.xml/AvoidProtectedMethodInFinalClassNotExtending"/>
|
||||
<rule ref="category/java/codestyle.xml/AvoidUsingNativeCode"/>
|
||||
<rule ref="category/java/codestyle.xml/BooleanGetMethodName"/>
|
||||
<rule ref="category/java/codestyle.xml/CallSuperInConstructor"/>
|
||||
<rule ref="category/java/codestyle.xml/ControlStatementBraces"/>
|
||||
<rule ref="category/java/codestyle.xml/DontImportJavaLang"/>
|
||||
<rule ref="category/java/codestyle.xml/DuplicateImports"/>
|
||||
<rule ref="category/java/codestyle.xml/EmptyMethodInAbstractClassShouldBeAbstract"/>
|
||||
<rule ref="category/java/codestyle.xml/ExtendsObject"/>
|
||||
<rule ref="category/java/codestyle.xml/FieldDeclarationsShouldBeAtStartOfClass"/>
|
||||
<rule ref="category/java/codestyle.xml/ForLoopShouldBeWhileLoop"/>
|
||||
<rule ref="category/java/codestyle.xml/IdenticalCatchBranches"/>
|
||||
<rule ref="category/java/codestyle.xml/LocalVariableCouldBeFinal"/>
|
||||
<rule ref="category/java/codestyle.xml/MethodArgumentCouldBeFinal"/>
|
||||
<rule ref="category/java/codestyle.xml/NoPackage"/>
|
||||
<rule ref="category/java/codestyle.xml/PrematureDeclaration"/>
|
||||
<rule ref="category/java/codestyle.xml/TooManyStaticImports"/>
|
||||
<rule ref="category/java/codestyle.xml/UnnecessaryAnnotationValueElement"/>
|
||||
<rule ref="category/java/codestyle.xml/UnnecessaryConstructor"/>
|
||||
<rule ref="category/java/codestyle.xml/UnnecessaryFullyQualifiedName"/>
|
||||
<rule ref="category/java/codestyle.xml/UnnecessaryLocalBeforeReturn"/>
|
||||
<rule ref="category/java/codestyle.xml/UnnecessaryReturn"/>
|
||||
<rule ref="category/java/codestyle.xml/UselessQualifiedThis"/>
|
||||
|
||||
|
||||
<!-- DESIGN -->
|
||||
<rule ref="category/java/design.xml/AbstractClassWithoutAnyMethod"/>
|
||||
<rule ref="category/java/design.xml/AvoidRethrowingException"/>
|
||||
<rule ref="category/java/design.xml/AvoidThrowingNewInstanceOfSameException"/>
|
||||
<rule ref="category/java/design.xml/AvoidThrowingNullPointerException"/>
|
||||
<rule ref="category/java/design.xml/AvoidThrowingRawExceptionTypes"/>
|
||||
<rule ref="category/java/design.xml/ClassWithOnlyPrivateConstructorsShouldBeFinal"/>
|
||||
<rule ref="category/java/design.xml/CollapsibleIfStatements"/>
|
||||
<rule ref="category/java/design.xml/CouplingBetweenObjects"/>
|
||||
<rule ref="category/java/design.xml/DataClass"/>
|
||||
<rule ref="category/java/design.xml/DoNotExtendJavaLangError"/>
|
||||
<rule ref="category/java/design.xml/ExceptionAsFlowControl"/>
|
||||
<rule ref="category/java/design.xml/ExcessivePublicCount"/>
|
||||
<rule ref="category/java/design.xml/FinalFieldCouldBeStatic"/>
|
||||
<rule ref="category/java/design.xml/ImmutableField"/>
|
||||
<rule ref="category/java/design.xml/LogicInversion"/>
|
||||
<rule ref="category/java/design.xml/SignatureDeclareThrowsException"/>
|
||||
<rule ref="category/java/design.xml/SimplifiedTernary"/>
|
||||
<rule ref="category/java/design.xml/SimplifyBooleanAssertion"/>
|
||||
<rule ref="category/java/design.xml/SimplifyBooleanExpressions"/>
|
||||
<rule ref="category/java/design.xml/SimplifyBooleanReturns"/>
|
||||
<rule ref="category/java/design.xml/SimplifyConditional"/>
|
||||
<rule ref="category/java/design.xml/SingularField"/>
|
||||
<rule ref="category/java/design.xml/SwitchDensity"/>
|
||||
<rule ref="category/java/design.xml/UselessOverridingMethod"/>
|
||||
<rule ref="category/java/design.xml/UseUtilityClass"/>
|
||||
|
||||
<!-- DOCUMENTATION -->
|
||||
<rule ref="category/java/documentation.xml/UncommentedEmptyConstructor"/>
|
||||
<rule ref="category/java/documentation.xml/UncommentedEmptyMethodBody"/>
|
||||
|
||||
|
||||
<!-- ERROR PRONE -->
|
||||
<rule ref="category/java/errorprone.xml/AssignmentInOperand">
|
||||
<properties>
|
||||
<property name="allowWhile" value="true"/>
|
||||
</properties>
|
||||
</rule>
|
||||
<rule ref="category/java/errorprone.xml/AssignmentToNonFinalStatic"/>
|
||||
<rule ref="category/java/errorprone.xml/AvoidAccessibilityAlteration"/>
|
||||
<rule ref="category/java/errorprone.xml/AvoidAssertAsIdentifier"/>
|
||||
<rule ref="category/java/errorprone.xml/AvoidBranchingStatementAsLastInLoop"/>
|
||||
<rule ref="category/java/errorprone.xml/AvoidCallingFinalize"/>
|
||||
<rule ref="category/java/errorprone.xml/AvoidCatchingThrowable"/>
|
||||
<rule ref="category/java/errorprone.xml/AvoidDecimalLiteralsInBigDecimalConstructor"/>
|
||||
<rule ref="category/java/errorprone.xml/AvoidDuplicateLiterals"/>
|
||||
<rule ref="category/java/errorprone.xml/AvoidEnumAsIdentifier"/>
|
||||
<rule ref="category/java/errorprone.xml/AvoidInstanceofChecksInCatchClause"/>
|
||||
<rule ref="category/java/errorprone.xml/AvoidLosingExceptionInformation"/>
|
||||
<rule ref="category/java/errorprone.xml/AvoidMultipleUnaryOperators"/>
|
||||
<rule ref="category/java/errorprone.xml/AvoidUsingOctalValues"/>
|
||||
<rule ref="category/java/errorprone.xml/BadComparison"/>
|
||||
<rule ref="category/java/errorprone.xml/BrokenNullCheck"/>
|
||||
<rule ref="category/java/errorprone.xml/CallSuperFirst"/>
|
||||
<rule ref="category/java/errorprone.xml/CallSuperLast"/>
|
||||
<rule ref="category/java/errorprone.xml/CheckSkipResult"/>
|
||||
<rule ref="category/java/errorprone.xml/ClassCastExceptionWithToArray"/>
|
||||
<rule ref="category/java/errorprone.xml/CloneMethodMustBePublic"/>
|
||||
<rule ref="category/java/errorprone.xml/CloneMethodMustImplementCloneable"/>
|
||||
<rule ref="category/java/errorprone.xml/CloneMethodReturnTypeMustMatchClassName"/>
|
||||
<rule ref="category/java/errorprone.xml/CloneThrowsCloneNotSupportedException"/>
|
||||
<rule ref="category/java/errorprone.xml/CloseResource"/>
|
||||
<rule ref="category/java/errorprone.xml/CompareObjectsWithEquals"/>
|
||||
<rule ref="category/java/errorprone.xml/ConstructorCallsOverridableMethod"/>>
|
||||
<rule ref="category/java/errorprone.xml/DoNotCallGarbageCollectionExplicitly"/>
|
||||
<rule ref="category/java/errorprone.xml/DoNotExtendJavaLangThrowable"/>
|
||||
<rule ref="category/java/errorprone.xml/DoNotHardCodeSDCard"/>
|
||||
<rule ref="category/java/errorprone.xml/DoNotThrowExceptionInFinally"/>
|
||||
<rule ref="category/java/errorprone.xml/DontImportSun"/>
|
||||
<rule ref="category/java/errorprone.xml/DontUseFloatTypeForLoopIndices"/>
|
||||
<rule ref="category/java/errorprone.xml/EqualsNull"/>
|
||||
<rule ref="category/java/errorprone.xml/FinalizeDoesNotCallSuperFinalize"/>
|
||||
<rule ref="category/java/errorprone.xml/FinalizeOnlyCallsSuperFinalize"/>
|
||||
<rule ref="category/java/errorprone.xml/FinalizeOverloaded"/>
|
||||
<rule ref="category/java/errorprone.xml/FinalizeShouldBeProtected"/>
|
||||
<rule ref="category/java/errorprone.xml/IdempotentOperations"/>
|
||||
<rule ref="category/java/errorprone.xml/ImportFromSamePackage"/>
|
||||
<rule ref="category/java/errorprone.xml/InstantiationToGetClass"/>
|
||||
<rule ref="category/java/errorprone.xml/InvalidSlf4jMessageFormat"/>
|
||||
<rule ref="category/java/errorprone.xml/JumbledIncrementer"/>
|
||||
<rule ref="category/java/errorprone.xml/JUnitSpelling"/>
|
||||
<rule ref="category/java/errorprone.xml/JUnitStaticSuite"/>
|
||||
<rule ref="category/java/errorprone.xml/LoggerIsNotStaticFinal"/>
|
||||
<rule ref="category/java/errorprone.xml/MethodWithSameNameAsEnclosingClass"/>
|
||||
<rule ref="category/java/errorprone.xml/MisplacedNullCheck"/>
|
||||
<rule ref="category/java/errorprone.xml/MissingBreakInSwitch"/>
|
||||
<rule ref="category/java/errorprone.xml/MissingSerialVersionUID"/>
|
||||
<rule ref="category/java/errorprone.xml/MissingStaticMethodInNonInstantiatableClass"/>
|
||||
<rule ref="category/java/errorprone.xml/MoreThanOneLogger"/>
|
||||
<rule ref="category/java/errorprone.xml/NonCaseLabelInSwitchStatement"/>
|
||||
<rule ref="category/java/errorprone.xml/NonStaticInitializer"/>
|
||||
<rule ref="category/java/errorprone.xml/NullAssignment"/>
|
||||
<rule ref="category/java/errorprone.xml/OverrideBothEqualsAndHashcode"/>
|
||||
<rule ref="category/java/errorprone.xml/ProperCloneImplementation"/>
|
||||
<rule ref="category/java/errorprone.xml/ProperLogger"/>
|
||||
<rule ref="category/java/errorprone.xml/ReturnEmptyArrayRatherThanNull"/>
|
||||
<rule ref="category/java/errorprone.xml/ReturnFromFinallyBlock"/>
|
||||
<rule ref="category/java/errorprone.xml/SimpleDateFormatNeedsLocale"/>
|
||||
<rule ref="category/java/errorprone.xml/SingleMethodSingleton"/>
|
||||
<rule ref="category/java/errorprone.xml/SingletonClassReturningNewInstance"/>
|
||||
<rule ref="category/java/errorprone.xml/StaticEJBFieldShouldBeFinal"/>
|
||||
<rule ref="category/java/errorprone.xml/StringBufferInstantiationWithChar"/>
|
||||
<rule ref="category/java/errorprone.xml/SuspiciousEqualsMethodName"/>
|
||||
<rule ref="category/java/errorprone.xml/SuspiciousHashcodeMethodName"/>
|
||||
<rule ref="category/java/errorprone.xml/SuspiciousOctalEscape"/>
|
||||
<rule ref="category/java/errorprone.xml/TestClassWithoutTestCases"/>
|
||||
<rule ref="category/java/errorprone.xml/UnconditionalIfStatement"/>
|
||||
<rule ref="category/java/errorprone.xml/UnnecessaryBooleanAssertion"/>
|
||||
<rule ref="category/java/errorprone.xml/UnnecessaryCaseChange"/>
|
||||
<rule ref="category/java/errorprone.xml/UnnecessaryConversionTemporary"/>
|
||||
<rule ref="category/java/errorprone.xml/UnusedNullCheckInEquals"/>
|
||||
<rule ref="category/java/errorprone.xml/UseCorrectExceptionLogging"/>
|
||||
<rule ref="category/java/errorprone.xml/UseEqualsToCompareStrings"/>
|
||||
<rule ref="category/java/errorprone.xml/UselessOperationOnImmutable"/>
|
||||
<rule ref="category/java/errorprone.xml/UseLocaleWithCaseConversions"/>
|
||||
<rule ref="category/java/errorprone.xml/EmptyCatchBlock">
|
||||
<properties>
|
||||
<property name="allowExceptionNameRegex">
|
||||
<value>^ignore$</value>
|
||||
</property>
|
||||
</properties>
|
||||
</rule>
|
||||
<rule ref="category/java/errorprone.xml/EmptyFinalizer"/>
|
||||
<rule ref="category/java/errorprone.xml/EmptyFinallyBlock"/>
|
||||
<rule ref="category/java/errorprone.xml/EmptyIfStmt"/>
|
||||
<rule ref="category/java/errorprone.xml/EmptyInitializer"/>
|
||||
<rule ref="category/java/errorprone.xml/EmptyStatementBlock"/>
|
||||
<rule ref="category/java/errorprone.xml/EmptyStatementNotInLoop"/>
|
||||
<rule ref="category/java/errorprone.xml/EmptySwitchStatements"/>
|
||||
<rule ref="category/java/errorprone.xml/EmptySynchronizedBlock"/>
|
||||
<rule ref="category/java/errorprone.xml/EmptyTryBlock"/>
|
||||
<rule ref="category/java/errorprone.xml/EmptyWhileStmt"/>
|
||||
|
||||
|
||||
<!-- MULTITHREADING -->
|
||||
<rule ref="category/java/multithreading.xml/AvoidSynchronizedAtMethodLevel"/>
|
||||
<rule ref="category/java/multithreading.xml/AvoidThreadGroup"/>
|
||||
<rule ref="category/java/multithreading.xml/AvoidUsingVolatile"/>
|
||||
<rule ref="category/java/multithreading.xml/DontCallThreadRun"/>
|
||||
<rule ref="category/java/multithreading.xml/DoubleCheckedLocking"/>
|
||||
<rule ref="category/java/multithreading.xml/NonThreadSafeSingleton"/>
|
||||
<rule ref="category/java/multithreading.xml/UseConcurrentHashMap"/>
|
||||
<rule ref="category/java/multithreading.xml/UseNotifyAllInsteadOfNotify"/>
|
||||
|
||||
<!-- PERFORMANCE -->
|
||||
<rule ref="category/java/performance.xml/AddEmptyString"/>
|
||||
<rule ref="category/java/performance.xml/AppendCharacterWithChar"/>
|
||||
<rule ref="category/java/performance.xml/AvoidArrayLoops"/>
|
||||
<rule ref="category/java/performance.xml/AvoidFileStream"/>
|
||||
<rule ref="category/java/performance.xml/AvoidInstantiatingObjectsInLoops"/>
|
||||
<rule ref="category/java/performance.xml/AvoidUsingShortType"/>
|
||||
<rule ref="category/java/performance.xml/BigIntegerInstantiation"/>
|
||||
<rule ref="category/java/performance.xml/BooleanInstantiation"/>
|
||||
<rule ref="category/java/performance.xml/ByteInstantiation"/>
|
||||
<rule ref="category/java/performance.xml/ConsecutiveAppendsShouldReuse"/>
|
||||
<rule ref="category/java/performance.xml/ConsecutiveLiteralAppends"/>
|
||||
<rule ref="category/java/performance.xml/InefficientEmptyStringCheck"/>
|
||||
<rule ref="category/java/performance.xml/InefficientStringBuffering"/>
|
||||
<rule ref="category/java/performance.xml/InsufficientStringBufferDeclaration"/>
|
||||
<rule ref="category/java/performance.xml/IntegerInstantiation"/>
|
||||
<rule ref="category/java/performance.xml/LongInstantiation"/>
|
||||
<rule ref="category/java/performance.xml/OptimizableToArrayCall"/>
|
||||
<rule ref="category/java/performance.xml/RedundantFieldInitializer"/>
|
||||
<rule ref="category/java/performance.xml/SimplifyStartsWith"/>
|
||||
<rule ref="category/java/performance.xml/ShortInstantiation"/>
|
||||
<rule ref="category/java/performance.xml/StringInstantiation"/>
|
||||
<rule ref="category/java/performance.xml/StringToString"/>
|
||||
<rule ref="category/java/performance.xml/TooFewBranchesForASwitchStatement"/>
|
||||
<rule ref="category/java/performance.xml/UnnecessaryWrapperObjectCreation"/>
|
||||
<rule ref="category/java/performance.xml/UseArrayListInsteadOfVector"/>
|
||||
<rule ref="category/java/performance.xml/UseArraysAsList"/>
|
||||
<rule ref="category/java/performance.xml/UseIndexOfChar"/>
|
||||
<rule ref="category/java/performance.xml/UselessStringValueOf"/>
|
||||
<rule ref="category/java/performance.xml/UseStringBufferForStringAppends"/>
|
||||
<rule ref="category/java/performance.xml/UseStringBufferLength"/>
|
||||
|
||||
<!-- SECURITY -->
|
||||
<rule ref="category/java/security.xml/HardCodedCryptoKey"/>
|
||||
<rule ref="category/java/security.xml/InsecureCryptoIv"/>
|
||||
</ruleset>
|
16
config/spotbugs/excludeFilter.xml
Normal file
16
config/spotbugs/excludeFilter.xml
Normal file
|
@ -0,0 +1,16 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<FindBugsFilter
|
||||
xmlns="https://github.com/spotbugs/filter/3.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="https://github.com/spotbugs/filter/3.0.0 https://raw.githubusercontent.com/spotbugs/spotbugs/3.1.0/spotbugs/etc/findbugsfilter.xsd">
|
||||
<!-- <Match>
|
||||
<Package name="com.foobar.*"/>
|
||||
<Class name="com.foobar.MyClass"/>
|
||||
<Or>
|
||||
<Method name="someMethod"/>
|
||||
<Method name="someOtherMethod"/>
|
||||
</Or>
|
||||
<Bug pattern="DLS_DEAD_LOCAL_STORE"/>
|
||||
<Confidence value="2"/>
|
||||
</Match>-->
|
||||
</FindBugsFilter>
|
Loading…
Add table
Add a link
Reference in a new issue