The following issues were found

src/test/java/com/alibaba/json/bvtVO/WareHouseInfo.java
4 issues
The class 'WareHouseInfo' is suspected to be a Data Class (WOC=0.000%, NOPA=0, NOAM=16, WMC=16)
Design

Line: 10

               * 
 * @author maik.wangz 2011-12-12 ����09:50:32
 */
public class WareHouseInfo implements Serializable {

    private static final long serialVersionUID = 6102232214244738211L;
    // ʡ��ID
    private String            provinceId;
    // ʡ�����

            

Reported by PMD.

Returning 'images' may expose an internal array.
Design

Line: 87

                  }

    public Image[] getImages() {
        return images;
    }

    public void setImages(Image[] images) {
        this.images = images;
    }

            

Reported by PMD.

The user-supplied array 'images' is stored directly.
Design

Line: 90

                      return images;
    }

    public void setImages(Image[] images) {
        this.images = images;
    }

}

            

Reported by PMD.

Consider using varargs for methods or constructors which take an array the last parameter.
Design

Line: 90

                      return images;
    }

    public void setImages(Image[] images) {
        this.images = images;
    }

}

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/writeClassName/WriteClassNameTest2.java
4 issues
System.out.println is used
Design

Line: 17

                      A a = new A();
        a.setB(new B());
        String text = JSON.toJSONString(a, SerializerFeature.WriteClassName);
        System.out.println(text);
        Assert.assertEquals("{\"@type\":\"com.alibaba.json.bvt.writeClassName.WriteClassNameTest2$A\",\"b\":{\"id\":0}}",
                            text);

        A a1 = (A) JSON.parse(text, Feature.SupportAutoType);


            

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: 13

              
public class WriteClassNameTest2 extends TestCase {

    public void test_writeClassName() throws Exception {
        A a = new A();
        a.setB(new B());
        String text = JSON.toJSONString(a, SerializerFeature.WriteClassName);
        System.out.println(text);
        Assert.assertEquals("{\"@type\":\"com.alibaba.json.bvt.writeClassName.WriteClassNameTest2$A\",\"b\":{\"id\":0}}",

            

Reported by PMD.

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

Line: 23

              
        A a1 = (A) JSON.parse(text, Feature.SupportAutoType);

        Assert.assertNotNull(a1.getB());
    }

    public static class A {

        private B b;

            

Reported by PMD.

Avoid unused imports such as 'com.alibaba.fastjson.parser.ParserConfig'
Design

Line: 4

              package com.alibaba.json.bvt.writeClassName;

import com.alibaba.fastjson.parser.Feature;
import com.alibaba.fastjson.parser.ParserConfig;
import org.junit.Assert;
import junit.framework.TestCase;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.serializer.SerializerFeature;

            

Reported by PMD.

src/test/java/com/alibaba/json/test/benchmark/basic/DoubleBenchmark_arrayMapping.java
4 issues
System.out.println is used
Design

Line: 35

                          JSON.parseObject(json, Model.class, Feature.SupportArrayToBean);
        }
        long millis = System.currentTimeMillis() - start;
        System.out.println("millis : " + millis);
    }

    public static void perf2() {
        long start = System.currentTimeMillis();
        for (int i = 0; i < 1000 * 1000 * 10; ++i) {

            

Reported by PMD.

System.out.println is used
Design

Line: 44

                          JSON.parseObject(json2, Model.class, Feature.SupportArrayToBean);
        }
        long millis = System.currentTimeMillis() - start;
        System.out.println("millis : " + millis);
    }

    public static class Model {
        public double v1;
        public double v2;

            

Reported by PMD.

All methods are static. Consider using a utility class instead. Alternatively, you could add a private constructor or make the class abstract to silence this warning.
Design

Line: 9

              /**
 * Created by wenshao on 04/08/2017.
 */
public class DoubleBenchmark_arrayMapping {
    static String json = "[0.4430165316544028,0.22676692048907365,0.9766986818812096,0.3423751102308744,0.4262177938610565]";
    static String json2 = "[\"0.4430165316544028\",\"0.22676692048907365\",\"0.9766986818812096\",\"0.3423751102308744\",\"0.4262177938610565\"]";

    public static void main(String[] args) throws Exception {
//        Model model = new Model();

            

Reported by PMD.

A method/constructor should not explicitly throw java.lang.Exception
Design

Line: 13

                  static String json = "[0.4430165316544028,0.22676692048907365,0.9766986818812096,0.3423751102308744,0.4262177938610565]";
    static String json2 = "[\"0.4430165316544028\",\"0.22676692048907365\",\"0.9766986818812096\",\"0.3423751102308744\",\"0.4262177938610565\"]";

    public static void main(String[] args) throws Exception {
//        Model model = new Model();
//        model.v1 = new Random().nextDouble();
//        model.v2 = new Random().nextDouble();
//        model.v3 = new Random().nextDouble();
//        model.v4 = new Random().nextDouble();

            

Reported by PMD.

src/test/java/com/alibaba/json/test/benchmark/basic/DoubleBenchmark_arrayMapping_obj.java
4 issues
System.out.println is used
Design

Line: 35

                          JSON.parseObject(json, Model.class, Feature.SupportArrayToBean);
        }
        long millis = System.currentTimeMillis() - start;
        System.out.println("millis : " + millis);
    }

    public static void perf2() {
        long start = System.currentTimeMillis();
        for (int i = 0; i < 1000 * 1000 * 10; ++i) {

            

Reported by PMD.

System.out.println is used
Design

Line: 44

                          JSON.parseObject(json2, Model.class, Feature.SupportArrayToBean);
        }
        long millis = System.currentTimeMillis() - start;
        System.out.println("millis : " + millis);
    }

    public static class Model {
        public Double v1;
        public Double v2;

            

Reported by PMD.

All methods are static. Consider using a utility class instead. Alternatively, you could add a private constructor or make the class abstract to silence this warning.
Design

Line: 9

              /**
 * Created by wenshao on 04/08/2017.
 */
public class DoubleBenchmark_arrayMapping_obj {
    static String json = "[0.4430165316544028,0.22676692048907365,0.9766986818812096,0.3423751102308744,0.4262177938610565]";
    static String json2 = "[\"0.4430165316544028\",\"0.22676692048907365\",\"0.9766986818812096\",\"0.3423751102308744\",\"0.4262177938610565\"]";

    public static void main(String[] args) throws Exception {
//        Model model = new Model();

            

Reported by PMD.

A method/constructor should not explicitly throw java.lang.Exception
Design

Line: 13

                  static String json = "[0.4430165316544028,0.22676692048907365,0.9766986818812096,0.3423751102308744,0.4262177938610565]";
    static String json2 = "[\"0.4430165316544028\",\"0.22676692048907365\",\"0.9766986818812096\",\"0.3423751102308744\",\"0.4262177938610565\"]";

    public static void main(String[] args) throws Exception {
//        Model model = new Model();
//        model.v1 = new Random().nextDouble();
//        model.v2 = new Random().nextDouble();
//        model.v3 = new Random().nextDouble();
//        model.v4 = new Random().nextDouble();

            

Reported by PMD.

src/test/java/com/alibaba/json/bvt/writeClassName/WriteClassNameTest3.java
4 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: 16

              public class WriteClassNameTest3 extends TestCase {


    public void test_list() throws Exception {
        Map root = new HashMap();
        root.put("val", new Model());

        String str = JSON.toJSONString(root);
        assertEquals("{\"val\":{\"@type\":\"com.alibaba.json.bvt.writeClassName.WriteClassNameTest3$Model\"}}", str);

            

Reported by PMD.

JUnit assertions should include a message
Design

Line: 21

                      root.put("val", new Model());

        String str = JSON.toJSONString(root);
        assertEquals("{\"val\":{\"@type\":\"com.alibaba.json.bvt.writeClassName.WriteClassNameTest3$Model\"}}", str);

       JSON.parseObject(str);
    }

    @JSONType(serialzeFeatures = SerializerFeature.WriteClassName)

            

Reported by PMD.

Avoid unused imports such as 'com.alibaba.fastjson.JSONObject'
Design

Line: 4

              package com.alibaba.json.bvt.writeClassName;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.annotation.JSONType;
import com.alibaba.fastjson.serializer.SerializerFeature;
import junit.framework.TestCase;
import org.junit.Assert;


            

Reported by PMD.

Avoid unused imports such as 'org.junit.Assert'
Design

Line: 8

              import com.alibaba.fastjson.annotation.JSONType;
import com.alibaba.fastjson.serializer.SerializerFeature;
import junit.framework.TestCase;
import org.junit.Assert;

import java.util.HashMap;
import java.util.Map;

public class WriteClassNameTest3 extends TestCase {

            

Reported by PMD.

src/test/java/com/alibaba/json/demo/User.java
4 issues
System.out.println is used
Design

Line: 34

                      user.setId(123L);
        user.setName("wenshao");
        String text = JSON.toJSONString(user);
        System.out.println(text);
        
        User user1 = JSON.parseObject(text, User.class);
        Assert.assertEquals("{\"id\":123,\"name\":\"wenshao\"}", text);
    }
}

            

Reported by PMD.

The class 'User' is suspected to be a Data Class (WOC=20.000%, NOPA=0, NOAM=4, WMC=5)
Design

Line: 8

              
import com.alibaba.fastjson.JSON;

public class User {

    private Long   id;
    private String name;

    public Long getId() {

            

Reported by PMD.

Avoid unused local variables such as 'user1'.
Design

Line: 36

                      String text = JSON.toJSONString(user);
        System.out.println(text);
        
        User user1 = JSON.parseObject(text, User.class);
        Assert.assertEquals("{\"id\":123,\"name\":\"wenshao\"}", text);
    }
}

            

Reported by PMD.

Found 'DU'-anomaly for variable 'user1' (lines '36'-'38').
Error

Line: 36

                      String text = JSON.toJSONString(user);
        System.out.println(text);
        
        User user1 = JSON.parseObject(text, User.class);
        Assert.assertEquals("{\"id\":123,\"name\":\"wenshao\"}", text);
    }
}

            

Reported by PMD.

src/test/java/com/derbysoft/spitfire/fastjson/dto/AbstractDTO.java
3 issues
The class 'AbstractDTO' is suspected to be a Data Class (WOC=0.000%, NOPA=0, NOAM=4, WMC=4)
Design

Line: 7

              
import com.alibaba.fastjson.annotation.JSONField;

public abstract class AbstractDTO implements Serializable {
    private boolean keepgoingValidate = false;

    private boolean checkCircularReference = true;

    @JSONField(name="KV")

            

Reported by PMD.

Classes implementing Serializable should set a serialVersionUID
Error

Line: 7

              
import com.alibaba.fastjson.annotation.JSONField;

public abstract class AbstractDTO implements Serializable {
    private boolean keepgoingValidate = false;

    private boolean checkCircularReference = true;

    @JSONField(name="KV")

            

Reported by PMD.

Avoid using redundant field initializer for 'keepgoingValidate'
Performance

Line: 8

              import com.alibaba.fastjson.annotation.JSONField;

public abstract class AbstractDTO implements Serializable {
    private boolean keepgoingValidate = false;

    private boolean checkCircularReference = true;

    @JSONField(name="KV")
    public boolean isKeepgoingValidate() {

            

Reported by PMD.

src/test/java/com/alibaba/json/test/vans/VansGeometryData.java
3 issues
Classes implementing Serializable should set a serialVersionUID
Error

Line: 10

              import java.util.ArrayList;

@JSONType(orders = {"uvs","metadata","normals","name","faces","vertices"})
public class VansGeometryData implements Serializable{
    public float[][] uvs;

    @JSONField(name = "metadata")
    public VansGeometryDataMetaData metaData;


            

Reported by PMD.

The class 'VansGeometryData' is suspected to be a Data Class (WOC=0.000%, NOPA=6, NOAM=0, WMC=1)
Design

Line: 10

              import java.util.ArrayList;

@JSONType(orders = {"uvs","metadata","normals","name","faces","vertices"})
public class VansGeometryData implements Serializable{
    public float[][] uvs;

    @JSONField(name = "metadata")
    public VansGeometryDataMetaData metaData;


            

Reported by PMD.

Avoid unused imports such as 'java.util.ArrayList'
Design

Line: 7

              import com.alibaba.fastjson.annotation.JSONType;

import java.io.Serializable;
import java.util.ArrayList;

@JSONType(orders = {"uvs","metadata","normals","name","faces","vertices"})
public class VansGeometryData implements Serializable{
    public float[][] uvs;


            

Reported by PMD.

src/test/java/data/ReprUtil.java
3 issues
All methods are static. Consider using a utility class instead. Alternatively, you could add a private constructor or make the class abstract to silence this warning.
Design

Line: 4

              package data;

public class ReprUtil
{
	public static String repr(String s)
	{
		if (s == null) return "null";
		return '"' + s + '"';
	}

            

Reported by PMD.

Found 'DU'-anomaly for variable 'sep' (lines '15'-'22').
Error

Line: 15

              	{
		StringBuilder buf = new StringBuilder();
		buf.append('[');
		String sep = "";
		for (String s : it) {
			buf.append(sep); sep = ", ";
			buf.append(repr(s));
		}
		buf.append(']');

            

Reported by PMD.

Found 'DU'-anomaly for variable 'sep' (lines '17'-'22').
Error

Line: 17

              		buf.append('[');
		String sep = "";
		for (String s : it) {
			buf.append(sep); sep = ", ";
			buf.append(repr(s));
		}
		buf.append(']');
		return buf.toString();
	}

            

Reported by PMD.

src/test/java/com/alibaba/json/test/entity/case1/Int_100_Entity.java
3 issues
This class has a bunch of public methods and attributes
Design

Line: 1

              package com.alibaba.json.test.entity.case1;

public class Int_100_Entity {

    private int f0;
    private int f1;
    private int f2;
    private int f3;
    private int f4;

            

Reported by PMD.

Too many fields
Design

Line: 3

              package com.alibaba.json.test.entity.case1;

public class Int_100_Entity {

    private int f0;
    private int f1;
    private int f2;
    private int f3;
    private int f4;

            

Reported by PMD.

The class 'Int_100_Entity' has a total cyclomatic complexity of 200 (highest 1).
Design

Line: 3

              package com.alibaba.json.test.entity.case1;

public class Int_100_Entity {

    private int f0;
    private int f1;
    private int f2;
    private int f3;
    private int f4;

            

Reported by PMD.