The following issues were found

src/test/java/com/alibaba/json/bvt/bug/Bug_for_agapple.java
2 issues
JUnit tests should include assert() or fail()
Design

Line: 11

              
public class Bug_for_agapple extends TestCase {

    public void test_for_agapple() throws Exception {
        Entity entity = new Entity();
        entity.setProperties(new Properties());
        String text = JSON.toJSONString(entity);
        
        JSON.parseObject(text, Entity.class);

            

Reported by PMD.

JUnit 4 tests that execute tests should use the @Test annotation, JUnit 5 tests should use @Test, @RepeatedTest, @TestFactory, @TestTemplate or @ParameterizedTest
Design

Line: 11

              
public class Bug_for_agapple extends TestCase {

    public void test_for_agapple() throws Exception {
        Entity entity = new Entity();
        entity.setProperties(new Properties());
        String text = JSON.toJSONString(entity);
        
        JSON.parseObject(text, Entity.class);

            

Reported by PMD.

src/test/java/com/alibaba/fastjson/deserializer/issues3796/bean/ObjectJ.java
2 issues
This class has a bunch of public methods and attributes
Design

Line: 1

              package com.alibaba.fastjson.deserializer.issues3796.bean;




import java.util.List;


public class ObjectJ {

            

Reported by PMD.

Too many fields
Design

Line: 9

              import java.util.List;


public class ObjectJ {
	
	private long a;
	
	private int b;


            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/bug/Bug_for_issue_423.java
2 issues
JUnit 4 tests that execute tests should use the @Test annotation, JUnit 5 tests should use @Test, @RepeatedTest, @TestFactory, @TestTemplate or @ParameterizedTest
Design

Line: 13

              
public class Bug_for_issue_423 extends TestCase {

    public void test_for_issue() throws Exception {
        String text = "[[],{\"value\":[]}]";
        Object root = JSON.parse(text, Feature.UseObjectArray);
        Assert.assertEquals(Object[].class, root.getClass());
        
        Object[] rootArray = (Object[]) root;

            

Reported by PMD.

Potential violation of Law of Demeter (object not created locally)
Design

Line: 16

                  public void test_for_issue() throws Exception {
        String text = "[[],{\"value\":[]}]";
        Object root = JSON.parse(text, Feature.UseObjectArray);
        Assert.assertEquals(Object[].class, root.getClass());
        
        Object[] rootArray = (Object[]) root;
        Assert.assertEquals(Object[].class, rootArray[0].getClass());
        Assert.assertEquals(Object[].class, ((JSONObject)rootArray[1]).get("value").getClass());
    }

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/JSONObjectTest4.java
2 issues
JUnit 4 tests that execute tests should use the @Test annotation, JUnit 5 tests should use @Test, @RepeatedTest, @TestFactory, @TestTemplate or @ParameterizedTest
Design

Line: 12

              
public class JSONObjectTest4 extends TestCase {

    public void test_interface() throws Exception {
        VO vo = JSON.parseObject("{id:123}", VO.class);
        Assert.assertEquals(123, vo.getId());
    }

    public static interface VO {

            

Reported by PMD.

Potential violation of Law of Demeter (object not created locally)
Design

Line: 14

              
    public void test_interface() throws Exception {
        VO vo = JSON.parseObject("{id:123}", VO.class);
        Assert.assertEquals(123, vo.getId());
    }

    public static interface VO {
        @JSONField()
        int getId();

            

Reported by PMD.

src/test/java/com/alibaba/fastjson/deserializer/issues3796/bean/ObjectM1.java
2 issues
The class 'ObjectM1' is suspected to be a Data Class (WOC=0.000%, NOPA=0, NOAM=40, WMC=40)
Design

Line: 9

              import java.util.List;


public class ObjectM1 {

	
	private int a;

	

            

Reported by PMD.

Too many fields
Design

Line: 9

              import java.util.List;


public class ObjectM1 {

	
	private int a;

	

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/bug/Bug_for_issue_439.java
2 issues
JUnit tests should include assert() or fail()
Design

Line: 8

              import junit.framework.TestCase;

public class Bug_for_issue_439 extends TestCase {
    public void test_for_issue() throws Exception {
       JSON.parseObject("{/*aa*/}");
    }
    
}

            

Reported by PMD.

JUnit 4 tests that execute tests should use the @Test annotation, JUnit 5 tests should use @Test, @RepeatedTest, @TestFactory, @TestTemplate or @ParameterizedTest
Design

Line: 8

              import junit.framework.TestCase;

public class Bug_for_issue_439 extends TestCase {
    public void test_for_issue() throws Exception {
       JSON.parseObject("{/*aa*/}");
    }
    
}

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/bug/Bug_for_issue_446.java
2 issues
JUnit 4 tests that execute tests should use the @Test annotation, JUnit 5 tests should use @Test, @RepeatedTest, @TestFactory, @TestTemplate or @ParameterizedTest
Design

Line: 12

              
public class Bug_for_issue_446 extends TestCase {

    public void test_for_issue() throws Exception {
        String text = "{\"amount\":1,\"channel_id\":\"wnys01\",\"gem\":1,\"id\":\"pay\",\"login_name\":\"U10722466A\",\"money\":1000,\"order_id\":\"99142AO10000086695A\",\"pay_channel\":\"weilan\",\"pay_time\":\"2015-11-05 20:59:04\",\"reward\":\"11:5_12:5_13:5,4:1_5:1_6:1\",\"status\":1,\"user_id\":19313}";
        JSONObject obj = (JSONObject) JSON.parse(text);
        Assert.assertEquals(1, obj.get("amount"));
    }


            

Reported by PMD.

Potential violation of Law of Demeter (object not created locally)
Design

Line: 15

                  public void test_for_issue() throws Exception {
        String text = "{\"amount\":1,\"channel_id\":\"wnys01\",\"gem\":1,\"id\":\"pay\",\"login_name\":\"U10722466A\",\"money\":1000,\"order_id\":\"99142AO10000086695A\",\"pay_channel\":\"weilan\",\"pay_time\":\"2015-11-05 20:59:04\",\"reward\":\"11:5_12:5_13:5,4:1_5:1_6:1\",\"status\":1,\"user_id\":19313}";
        JSONObject obj = (JSONObject) JSON.parse(text);
        Assert.assertEquals(1, obj.get("amount"));
    }

}

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/bug/Issue799.java
2 issues
JUnit 4 tests that execute tests should use the @Test annotation, JUnit 5 tests should use @Test, @RepeatedTest, @TestFactory, @TestTemplate or @ParameterizedTest
Design

Line: 13

               * Created by wenshao on 16/8/30.
 */
public class Issue799 extends TestCase {
    public void test_for_issue() throws Exception {
        String path = "$.array[0:-1].bizData";

        Map<String, Object> root = new HashMap<String, Object>();
        Object val = JSONPath.eval(root, path);
        assertNull(val);

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 18

              
        Map<String, Object> root = new HashMap<String, Object>();
        Object val = JSONPath.eval(root, path);
        assertNull(val);
    }
}

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/bug/Bug_for_issue_545.java
2 issues
JUnit tests should include assert() or fail()
Design

Line: 9

              
public class Bug_for_issue_545 extends TestCase {

    public void test_for_issue() throws Exception {
        JSON.parse("\ufeff{}");
    }

    
}

            

Reported by PMD.

JUnit 4 tests that execute tests should use the @Test annotation, JUnit 5 tests should use @Test, @RepeatedTest, @TestFactory, @TestTemplate or @ParameterizedTest
Design

Line: 9

              
public class Bug_for_issue_545 extends TestCase {

    public void test_for_issue() throws Exception {
        JSON.parse("\ufeff{}");
    }

    
}

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/bug/Bug_for_Jay_1.java
2 issues
JUnit tests should include assert() or fail()
Design

Line: 8

              import junit.framework.TestCase;

public class Bug_for_Jay_1 extends TestCase {
	public void test_bug() throws Exception {
		JSON.parseObject("{\"body\":{\"coupons\":[{\"couponTypeId\":\"81c07c7c-7b88-4f5c-9d1e-e6f16e2ae36d\",\"editor\":\"ADMIN\",\"organizationPartyId\":\"00\",\"statusId\":\"COUPON_CREATED\",\"editorName\":\"超级管理员\",\"couponCode\":\"02\",\"creatorName\":\"超级管理员\",\"id\":\"d686bc04-a9d5-4f84-977a-8bfbb4fa9fe3\",\"fromDate\":\"2013-03-11 00:00:00\",\"creator\":\"ADMIN\",\"displayName\":\"02\",\"createTime\":\"2013-03-12 13:14:05\",\"updateTime\":\"2013-03-12 13:14:05\",\"organizationName\":\"X、X\"}],\"event\":\"activate\"}}");
	}
}

            

Reported by PMD.

JUnit 4 tests that execute tests should use the @Test annotation, JUnit 5 tests should use @Test, @RepeatedTest, @TestFactory, @TestTemplate or @ParameterizedTest
Design

Line: 8

              import junit.framework.TestCase;

public class Bug_for_Jay_1 extends TestCase {
	public void test_bug() throws Exception {
		JSON.parseObject("{\"body\":{\"coupons\":[{\"couponTypeId\":\"81c07c7c-7b88-4f5c-9d1e-e6f16e2ae36d\",\"editor\":\"ADMIN\",\"organizationPartyId\":\"00\",\"statusId\":\"COUPON_CREATED\",\"editorName\":\"超级管理员\",\"couponCode\":\"02\",\"creatorName\":\"超级管理员\",\"id\":\"d686bc04-a9d5-4f84-977a-8bfbb4fa9fe3\",\"fromDate\":\"2013-03-11 00:00:00\",\"creator\":\"ADMIN\",\"displayName\":\"02\",\"createTime\":\"2013-03-12 13:14:05\",\"updateTime\":\"2013-03-12 13:14:05\",\"organizationName\":\"X、X\"}],\"event\":\"activate\"}}");
	}
}

            

Reported by PMD.