Skip to content

Commit

Permalink
Merge pull request #195 from dickschoeller/fix-pmd-rule
Browse files Browse the repository at this point in the history
Cleaned up a mess of code climate warnings
  • Loading branch information
dickschoeller committed Feb 5, 2017
2 parents ff27963 + 783cf0b commit fc5c770
Show file tree
Hide file tree
Showing 37 changed files with 168 additions and 155 deletions.
1 change: 1 addition & 0 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ engines:
string:
- FIXME
- TODO
- NOPMD
checkstyle:
enabled: true
channel: "beta"
Expand Down
2 changes: 1 addition & 1 deletion gedbrowser-analytics/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
<scope>test</scope>
</dependency>
</dependencies>

<reporting>
<plugins>
<plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ protected final LocalDate getNearBirthEventDate(final Person person0) {
* @param event the event
* @return true if it is non-time event
*/
protected boolean ignoreable(final Attribute event) {
protected final boolean ignoreable(final Attribute event) {
// Layed out like this because it is easier to understand
// coverage. No performance differences expected compared
// to tighter layout.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
/**
* @author Dick Schoeller
*/
public class ChildrenOrderAnalyzer extends AbstractOrderAnalyzer {
public final class ChildrenOrderAnalyzer extends AbstractOrderAnalyzer {
/** Format for child order problem message. */
private static final String CHILD_ORDER_FORMAT =
"Child order: %s, born on %s, is after %s, born on %s";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
*
* @author Dick Schoeller
*/
public class FamilyOrderAnalyzer extends AbstractOrderAnalyzer {
public final class FamilyOrderAnalyzer extends AbstractOrderAnalyzer {
/** */
private final Person person;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
/**
* @author Dick Schoeller
*/
public class OrderAnalyzerResult {
public final class OrderAnalyzerResult {
/** Current status of the analysis. */
private boolean correct;
/** List of mismatch descriptions. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ public void testMinDateSecondIsMin() {
* @throws IOException if failed to read file
*/
@Test
public final void testFactoryGedFile() throws IOException {
public void testFactoryGedFile() throws IOException {
final AbstractGedLine top =
ReaderHelper.readFileTestSource(this, "gl120368.ged");
final GedObject root = top.createGedObject((AbstractGedLine) null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
/**
* @author Dick Schoeller
*/
public class OrderAnalyzerTestHelper {
public final class OrderAnalyzerTestHelper {
/**
* Analyze and dump the result.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
* @author Dick Schoeller
*/
@SuppressWarnings({ "PMD.ExcessiveClassLength" })
public class BirthDateEstimatorTest {
public final class BirthDateEstimatorTest {
/** */
@Test
public final void testSimple() {
public void testSimple() {
final GedObjectBuilder builder = new GedObjectBuilder();
final Person person =
builder.createPerson("I0", "J. Random/Schoeller/");
Expand All @@ -45,7 +45,7 @@ public final void testSimple() {

/** */
@Test
public final void testEmpty() {
public void testEmpty() {
final GedObjectBuilder builder = new GedObjectBuilder();
final Person person =
builder.createPerson("I0", "J. Random/Schoeller/");
Expand All @@ -57,7 +57,7 @@ public final void testEmpty() {

/** */
@Test
public final void testFromYoungerSibling() {
public void testFromYoungerSibling() {
final GedObjectBuilder builder = new GedObjectBuilder();
final Person person1 =
builder.createPerson("I1", "J. Random/Schoeller/");
Expand All @@ -81,7 +81,7 @@ public final void testFromYoungerSibling() {

/** */
@Test
public final void testFromYoungerSiblings() {
public void testFromYoungerSiblings() {
final GedObjectBuilder builder = new GedObjectBuilder();
final Person person1 = builder.createPerson("I1",
"J. Random/Schoeller/");
Expand All @@ -107,7 +107,7 @@ public final void testFromYoungerSiblings() {

/** */
@Test
public final void testFromEmptyYoungerSiblings() {
public void testFromEmptyYoungerSiblings() {
final GedObjectBuilder builder = new GedObjectBuilder();
final Person person1 = builder.createPerson1();
final Person person2 = builder.createPerson2();
Expand All @@ -125,7 +125,7 @@ public final void testFromEmptyYoungerSiblings() {

/** */
@Test
public final void testFromOlderSibling() {
public void testFromOlderSibling() {
final GedObjectBuilder builder = new GedObjectBuilder();
final Person person1 = builder.createPerson1();
final Person person2 = builder.createPerson2();
Expand All @@ -148,7 +148,7 @@ public final void testFromOlderSibling() {

/** */
@Test
public final void testFromOlderSiblings() {
public void testFromOlderSiblings() {
final GedObjectBuilder builder = new GedObjectBuilder();
final Person person1 = builder.createPerson1();
final Person person2 = builder.createPerson2();
Expand All @@ -173,7 +173,7 @@ public final void testFromOlderSiblings() {

/** */
@Test
public final void testFromEmptyOlderSiblings() {
public void testFromEmptyOlderSiblings() {
final GedObjectBuilder builder = new GedObjectBuilder();
final Person person1 = builder.createPerson1();
final Person person2 = builder.createPerson2();
Expand All @@ -191,7 +191,7 @@ public final void testFromEmptyOlderSiblings() {

/** */
@Test
public final void testFromOwnMarriage() {
public void testFromOwnMarriage() {
final GedObjectBuilder builder = new GedObjectBuilder();
final Person person1 = builder.createPerson1();
final Person person2 = builder.createPerson2();
Expand All @@ -214,7 +214,7 @@ public final void testFromOwnMarriage() {

/** */
@Test
public final void testFromOwnMarriageWithNoDate() {
public void testFromOwnMarriageWithNoDate() {
final GedObjectBuilder builder = new GedObjectBuilder();
final Person person1 = builder.createPerson1();
final Person person2 = builder.createPerson2();
Expand All @@ -230,7 +230,7 @@ public final void testFromOwnMarriageWithNoDate() {

/** */
@Test
public final void testFromOwnMarriages() {
public void testFromOwnMarriages() {
final GedObjectBuilder builder = new GedObjectBuilder();
final Person person1 = builder.createPerson1();
final Person person2 = builder.createPerson2();
Expand Down Expand Up @@ -259,7 +259,7 @@ public final void testFromOwnMarriages() {

/** */
@Test
public final void testFromParentsMarriage() {
public void testFromParentsMarriage() {
final GedObjectBuilder builder = new GedObjectBuilder();
final Person person1 = builder.createPerson("I1",
"J. Random/Schoeller/");
Expand Down Expand Up @@ -290,7 +290,7 @@ public final void testFromParentsMarriage() {

/** */
@Test
public final void testFromParentsMarriageWithOlderSiblings() {
public void testFromParentsMarriageWithOlderSiblings() {
final GedObjectBuilder builder = new GedObjectBuilder();
final Person person1 = builder.createPerson("I1",
"J. Random/Schoeller/");
Expand All @@ -316,7 +316,7 @@ public final void testFromParentsMarriageWithOlderSiblings() {

/** */
@Test
public final void testFromChild() {
public void testFromChild() {
final GedObjectBuilder builder = new GedObjectBuilder();
final Person person1 = builder.createPerson("I1",
"J. Random/Schoeller/");
Expand All @@ -341,7 +341,7 @@ public final void testFromChild() {

/** */
@Test
public final void testFromChildren() {
public void testFromChildren() {
final GedObjectBuilder builder = new GedObjectBuilder();
final Person person1 = builder.createPerson("I1",
"J. Random/Schoeller/");
Expand All @@ -364,7 +364,7 @@ public final void testFromChildren() {

/** */
@Test
public final void testFromHusband() {
public void testFromHusband() {
final GedObjectBuilder builder = new GedObjectBuilder();
final Person person1 = builder.createPerson("I1",
"J. Random/Schoeller/");
Expand All @@ -387,7 +387,7 @@ public final void testFromHusband() {

/** */
@Test
public final void testFromWife() {
public void testFromWife() {
final GedObjectBuilder builder = new GedObjectBuilder();
final Person person1 = builder.createPerson("I1",
"J. Random/Schoeller/");
Expand Down Expand Up @@ -417,7 +417,7 @@ public final void testFromWife() {
* @throws IOException if the file can't be read
*/
@Test
public final void testFactoryGedFile() throws IOException {
public void testFactoryGedFile() throws IOException {
final AbstractGedLine top = readFileTestSource();
final GedObject root = top.createGedObject((AbstractGedLine) null);
final List<Person> unhandled = new ArrayList<>();
Expand Down Expand Up @@ -452,7 +452,7 @@ public final void testFactoryGedFile() throws IOException {

/** */
@Test
public final void testFromBaptism() {
public void testFromBaptism() {
final GedObjectBuilder builder = new GedObjectBuilder();
final Person person = builder.createPerson("I0",
"J. Random/Schoeller/");
Expand All @@ -470,7 +470,7 @@ public final void testFromBaptism() {

/** */
@Test
public final void testChristening() {
public void testChristening() {
final GedObjectBuilder builder = new GedObjectBuilder();
final Person person = builder.createPerson("I0",
"J. Random/Schoeller/");
Expand All @@ -488,7 +488,7 @@ public final void testChristening() {

/** */
@Test
public final void testBarMitzah() {
public void testBarMitzah() {
final GedObjectBuilder builder = new GedObjectBuilder();
final Person person = builder.createPerson("I0",
"J. Random/Schoeller/");
Expand All @@ -506,7 +506,7 @@ public final void testBarMitzah() {

/** */
@Test
public final void testBatMitzvah() {
public void testBatMitzvah() {
final GedObjectBuilder builder = new GedObjectBuilder();
final Person person = builder.createPerson("I0",
"J. Random/Schoeller/");
Expand All @@ -524,7 +524,7 @@ public final void testBatMitzvah() {

/** */
@Test
public final void testDeath() {
public void testDeath() {
final GedObjectBuilder builder = new GedObjectBuilder();
final Person person = builder.createPerson("I0",
"J. Random/Schoeller/");
Expand All @@ -542,7 +542,7 @@ public final void testDeath() {

/** */
@Test
public final void testBurial() {
public void testBurial() {
final GedObjectBuilder builder = new GedObjectBuilder();
final Person person = builder.createPerson("I0",
"J. Random/Schoeller/");
Expand All @@ -560,7 +560,7 @@ public final void testBurial() {

/** */
@Test
public final void testChanged() {
public void testChanged() {
final GedObjectBuilder builder = new GedObjectBuilder();
final Person person = builder.createPerson("I0",
"J. Random/Schoeller/");
Expand All @@ -573,7 +573,7 @@ public final void testChanged() {

/** */
@Test
public final void testOtherEvent() {
public void testOtherEvent() {
final GedObjectBuilder builder = new GedObjectBuilder();
final Person person = builder.createPerson("I0",
"J. Random/Schoeller/");
Expand All @@ -591,7 +591,7 @@ public final void testOtherEvent() {

/** */
@Test
public final void testNoDate() {
public void testNoDate() {
final GedObjectBuilder builder = new GedObjectBuilder();
final Person person = builder.createPerson("I0",
"J. Random/Schoeller/");
Expand All @@ -604,7 +604,7 @@ public final void testNoDate() {

/** */
@Test
public final void testBadDate() {
public void testBadDate() {
final GedObjectBuilder builder = new GedObjectBuilder();
final Person person = builder.createPerson("I0",
"J. Random/Schoeller/");
Expand All @@ -617,7 +617,7 @@ public final void testBadDate() {

/** */
@Test
public final void testEstimateBirthDate() {
public void testEstimateBirthDate() {
final GedObjectBuilder builder = new GedObjectBuilder();
final Person person = builder.createPerson("I0",
"J. Random/Schoeller/");
Expand All @@ -635,7 +635,7 @@ public final void testEstimateBirthDate() {

/** */
@Test
public final void testEstimateMarriageDate() {
public void testEstimateMarriageDate() {
final GedObjectBuilder builder = new GedObjectBuilder();
final Person person = builder.createPerson("I0",
"J. Random/Schoeller/");
Expand All @@ -653,7 +653,7 @@ public final void testEstimateMarriageDate() {

/** */
@Test
public final void testEstimateOtherDate() {
public void testEstimateOtherDate() {
final GedObjectBuilder builder = new GedObjectBuilder();
final Person person = builder.createPerson("I0",
"J. Random/Schoeller/");
Expand Down
4 changes: 2 additions & 2 deletions gedbrowser-datamodel/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<version>1.1.1-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>

<artifactId>gedbrowser-datamodel</artifactId>
<name>gedbrowser-datamodel</name>

Expand Down Expand Up @@ -47,7 +47,7 @@
<scope>test</scope>
</dependency>
</dependencies>

<reporting>
<plugins>
<plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* @author Dick Schoeller
*/
@SuppressWarnings({ "PMD.GodClass", "PMD.TooManyMethods" })
public class DateParser {
public final class DateParser {
/** */
private static final String ABT = "ABT ";
/** */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* @author Dick Schoeller
*/
@RunWith(Parameterized.class)
public class AttributeConstructorTest {
public final class AttributeConstructorTest {
/** */
private final GedObject parent;
/** */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
*/
@RunWith(Parameterized.class)
@SuppressWarnings("PMD.CommentSize")
public class FamCConstructorTest {
public final class FamCConstructorTest {
/** */
private final Person parent;
/** */
Expand Down
Loading

0 comments on commit fc5c770

Please sign in to comment.