Skip to content

Commit cb0d680

Browse files
committed
ci: decomission of PMD
The following issue won't be fixed: Closes #195 Closes #261 Closes #1018 Closes #1250 Closes #1646 Part of #1669
1 parent 0248534 commit cb0d680

File tree

91 files changed

+23
-528
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+23
-528
lines changed

.github/workflows/static-analysis.yml

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -16,31 +16,6 @@ defaults:
1616

1717
jobs:
1818

19-
run-pmd:
20-
name: Run PMD
21-
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idruns-on
22-
runs-on: ubuntu-20.04
23-
steps:
24-
- name: Clone source code
25-
uses: actions/[email protected] # https://github.com/actions/checkout
26-
with:
27-
# Whether to configure the token or SSH key with the local git config. Default: true
28-
persist-credentials: false
29-
- name: Install JDK
30-
uses: actions/[email protected] # https://github.com/actions/setup-java
31-
with:
32-
distribution: 'adopt' # https://github.com/actions/setup-java#supported-distributions
33-
java-version: '8' # https://github.com/actions/setup-java#supported-version-syntax
34-
- name: Restore existing cache
35-
uses: actions/[email protected] # https://github.com/actions/cache
36-
with:
37-
# https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#input-parameters-for-the-cache-action
38-
key: maven-repository-${{ hashFiles('pom.xml') }}
39-
path: ~/.m2/repository
40-
restore-keys: maven-repository-
41-
- name: Run PMD
42-
run: ./src/main/scripts/execute-command.sh pmd
43-
4419
check-license:
4520
name: Check license in file headers
4621
# https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idruns-on

pom.xml

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,6 @@
644644

645645
<native2ascii.plugin.version>2.0.1</native2ascii.plugin.version>
646646
<nodejs.version>v10.16.0</nodejs.version>
647-
<pmd.plugin.version>3.12.0</pmd.plugin.version>
648647

649648
<!-- Redefine default value from spring-boot-dependencies -->
650649
<postgresql.version>9.4.1212.jre7</postgresql.version>
@@ -912,20 +911,6 @@
912911
</configuration>
913912
</plugin>
914913

915-
<plugin>
916-
<groupId>org.apache.maven.plugins</groupId>
917-
<artifactId>maven-pmd-plugin</artifactId>
918-
<version>${pmd.plugin.version}</version>
919-
<configuration>
920-
<linkXRef>false</linkXRef>
921-
<verbose>true</verbose>
922-
<targetJdk>${java.version}</targetJdk>
923-
<rulesets>
924-
<ruleset>${basedir}/src/main/config/pmd.xml</ruleset>
925-
</rulesets>
926-
</configuration>
927-
</plugin>
928-
929914
<plugin>
930915
<groupId>org.apache.maven.plugins</groupId>
931916
<artifactId>maven-resources-plugin</artifactId>

src/main/config/pmd.xml

Lines changed: 0 additions & 323 deletions
This file was deleted.

src/main/java/ru/mystamps/web/common/JdbcUtils.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ private JdbcUtils() {
2828
}
2929

3030
// @see https://stackoverflow.com/q/2920364/checking-for-a-null-int-value-from-a-java-resultset
31-
@SuppressWarnings("PMD.PrematureDeclaration")
3231
public static Integer getInteger(ResultSet resultSet, String fieldName) throws SQLException {
3332
int value = resultSet.getInt(fieldName);
3433
if (resultSet.wasNull()) {
@@ -38,7 +37,6 @@ public static Integer getInteger(ResultSet resultSet, String fieldName) throws S
3837
return Integer.valueOf(value);
3938
}
4039

41-
@SuppressWarnings("PMD.PrematureDeclaration")
4240
public static Boolean getBoolean(ResultSet resultSet, String fieldName) throws SQLException {
4341
boolean value = resultSet.getBoolean(fieldName);
4442
if (resultSet.wasNull()) {
@@ -51,7 +49,6 @@ public static Boolean getBoolean(ResultSet resultSet, String fieldName) throws S
5149
/**
5250
* @author Sergey Chechenev
5351
*/
54-
@SuppressWarnings("PMD.PrematureDeclaration")
5552
public static Currency getCurrency(ResultSet resultSet, String fieldName) throws SQLException {
5653
String value = resultSet.getString(fieldName);
5754
if (resultSet.wasNull()) {

src/main/java/ru/mystamps/web/common/Pager.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@
2525
import java.util.Collections;
2626
import java.util.List;
2727

28-
// yes, I know that it's too complex :-(
29-
@SuppressWarnings("PMD.ModifiedCyclomaticComplexity")
3028
@ToString
3129
public class Pager {
3230
// be very careful when you're changing this value
@@ -41,15 +39,12 @@ public class Pager {
4139
private static final int FIRST_PAGE = 1;
4240

4341
// this field is shown in toString() and useful when debugging unit tests
44-
@SuppressWarnings("PMD.SingularField")
4542
private final int totalRecords;
4643

4744
// this field is shown in toString() and useful when debugging unit tests
48-
@SuppressWarnings("PMD.SingularField")
4945
private final int totalPages;
5046

5147
// this field is shown in toString() and useful when debugging unit tests
52-
@SuppressWarnings({ "PMD.SingularField", "PMD.UnusedPrivateField" })
5348
private final int recordsPerPage;
5449

5550
// this field is using in the view (hence its getter)
@@ -106,8 +101,6 @@ private static Integer findNext(int currentPage, int totalPages) {
106101
return Integer.valueOf(currentPage + 1);
107102
}
108103

109-
// I hope that we'll fix these one day
110-
@SuppressWarnings("PMD.NPathComplexity")
111104
private static List<Integer> createItems(
112105
int totalRecords,
113106
int recordsPerPage,

src/main/java/ru/mystamps/web/feature/account/AccountDb.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
*/
1818
package ru.mystamps.web.feature.account;
1919

20-
@SuppressWarnings("PMD.CommentDefaultAccessModifier")
2120
final class AccountDb {
2221

2322
static final class UsersActivation {

src/main/java/ru/mystamps/web/feature/account/AccountUrl.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
*
2727
* @author Slava Semushin
2828
*/
29-
@SuppressWarnings("PMD.CommentDefaultAccessModifier")
3029
public final class AccountUrl {
3130

3231
public static final String REGISTRATION_PAGE = "/account/register";

src/main/java/ru/mystamps/web/feature/account/AccountValidation.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,11 @@
2020
import ru.mystamps.web.feature.account.AccountDb.User;
2121
import ru.mystamps.web.feature.account.AccountDb.UsersActivation;
2222

23-
@SuppressWarnings("PMD.CommentDefaultAccessModifier")
2423
public final class AccountValidation {
2524

2625
public static final int LOGIN_MIN_LENGTH = 2;
2726
public static final int LOGIN_MAX_LENGTH = User.LOGIN_LENGTH;
2827
static final String LOGIN_REGEXP = "[-_\\.a-zA-Z0-9]+";
29-
@SuppressWarnings("PMD.LongVariable")
3028
static final String LOGIN_NO_REPEATING_CHARS_REGEXP = "(?!.+[-_.]{2,}).+";
3129

3230
static final int NAME_MAX_LENGTH = User.NAME_LENGTH;

src/main/java/ru/mystamps/web/feature/account/JdbcUsersActivationDao.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
import java.util.List;
2828
import java.util.Map;
2929

30-
@SuppressWarnings("PMD.AvoidDuplicateLiterals")
3130
public class JdbcUsersActivationDao implements UsersActivationDao {
3231

3332
private final NamedParameterJdbcTemplate jdbcTemplate;

src/main/java/ru/mystamps/web/feature/category/ApiCategoryService.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
/**
3535
* Implementation that delegates calls to a category service.
3636
*/
37-
@SuppressWarnings("PMD.TooManyMethods")
3837
public class ApiCategoryService implements CategoryService {
3938

4039
private static final Logger LOG = LoggerFactory.getLogger(ApiCategoryService.class);

0 commit comments

Comments
 (0)