SpotBugs Bug Detector Report
The following document contains the results of SpotBugs
SpotBugs Version is 4.2.3
Threshold is medium
Effort is default
Summary
Classes |
Bugs |
Errors |
Missing Classes |
330 |
63 |
0 |
0 |
com.foxinmy.weixin4j.api.MchApi
Bug |
Category |
Details |
Line |
Priority |
com.foxinmy.weixin4j.api.MchApi.getWeixinSSLExecutor() may fail to clean up java.io.InputStream |
EXPERIMENTAL |
OBL_UNSATISFIED_OBLIGATION |
113 |
Medium |
com.foxinmy.weixin4j.cache.FileCacheStorager
com.foxinmy.weixin4j.cache.MemcacheCacheStorager$MemcachePoolConfig
Bug |
Category |
Details |
Line |
Priority |
com.foxinmy.weixin4j.cache.MemcacheCacheStorager$MemcachePoolConfig.getServers() may expose internal representation by returning MemcacheCacheStorager$MemcachePoolConfig.servers |
MALICIOUS_CODE |
EI_EXPOSE_REP |
205 |
Medium |
com.foxinmy.weixin4j.cache.MemcacheCacheStorager$MemcachePoolConfig.getWeights() may expose internal representation by returning MemcacheCacheStorager$MemcachePoolConfig.weights |
MALICIOUS_CODE |
EI_EXPOSE_REP |
210 |
Medium |
com.foxinmy.weixin4j.cache.MemcacheCacheStorager$MemcachePoolConfig.aliveCheck isn't final but should be |
MALICIOUS_CODE |
MS_SHOULD_BE_FINAL |
100 |
Medium |
com.foxinmy.weixin4j.cache.MemcacheCacheStorager$MemcachePoolConfig.failback isn't final but should be |
MALICIOUS_CODE |
MS_SHOULD_BE_FINAL |
98 |
Medium |
com.foxinmy.weixin4j.cache.MemcacheCacheStorager$MemcachePoolConfig.failover isn't final but should be |
MALICIOUS_CODE |
MS_SHOULD_BE_FINAL |
97 |
Medium |
com.foxinmy.weixin4j.cache.MemcacheCacheStorager$MemcachePoolConfig.initConn isn't final but should be |
MALICIOUS_CODE |
MS_SHOULD_BE_FINAL |
91 |
Medium |
com.foxinmy.weixin4j.cache.MemcacheCacheStorager$MemcachePoolConfig.maxBusyTime isn't final but should be |
MALICIOUS_CODE |
MS_SHOULD_BE_FINAL |
94 |
Medium |
com.foxinmy.weixin4j.cache.MemcacheCacheStorager$MemcachePoolConfig.maxConn isn't final but should be |
MALICIOUS_CODE |
MS_SHOULD_BE_FINAL |
92 |
Medium |
com.foxinmy.weixin4j.cache.MemcacheCacheStorager$MemcachePoolConfig.maxIdle isn't final but should be |
MALICIOUS_CODE |
MS_SHOULD_BE_FINAL |
93 |
Medium |
com.foxinmy.weixin4j.cache.MemcacheCacheStorager$MemcachePoolConfig.minConn isn't final but should be |
MALICIOUS_CODE |
MS_SHOULD_BE_FINAL |
90 |
Medium |
com.foxinmy.weixin4j.cache.MemcacheCacheStorager$MemcachePoolConfig.nagle isn't final but should be |
MALICIOUS_CODE |
MS_SHOULD_BE_FINAL |
99 |
Medium |
com.foxinmy.weixin4j.cache.MemcacheCacheStorager$MemcachePoolConfig.socketConnectTO isn't final but should be |
MALICIOUS_CODE |
MS_SHOULD_BE_FINAL |
96 |
Medium |
com.foxinmy.weixin4j.cache.MemcacheCacheStorager$MemcachePoolConfig.socketTO isn't final but should be |
MALICIOUS_CODE |
MS_SHOULD_BE_FINAL |
95 |
Medium |
com.foxinmy.weixin4j.http.AbstractHttpResponse
Bug |
Category |
Details |
Line |
Priority |
com.foxinmy.weixin4j.http.AbstractHttpResponse.getContent() may expose internal representation by returning AbstractHttpResponse.content |
MALICIOUS_CODE |
EI_EXPOSE_REP |
24 |
Medium |
new com.foxinmy.weixin4j.http.AbstractHttpResponse(byte[]) may expose internal representation by storing an externally mutable object into AbstractHttpResponse.content |
MALICIOUS_CODE |
EI_EXPOSE_REP2 |
19 |
Medium |
com.foxinmy.weixin4j.http.ContentType
Bug |
Category |
Details |
Line |
Priority |
Nullcheck of params at line 182 of value previously dereferenced in com.foxinmy.weixin4j.http.ContentType.create(MimeType, NameValue[], boolean) |
CORRECTNESS |
RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE |
167 |
Medium |
Class com.foxinmy.weixin4j.http.ContentType defines non-transient non-serializable instance field charset |
BAD_PRACTICE |
SE_BAD_FIELD |
Not available |
Medium |
com.foxinmy.weixin4j.http.MimeType
Bug |
Category |
Details |
Line |
Priority |
com.foxinmy.weixin4j.http.MimeType.STREAM_MIMETYPES is a mutable collection |
MALICIOUS_CODE |
MS_MUTABLE_COLLECTION |
56 |
High |
com.foxinmy.weixin4j.http.apache.content.ByteArrayBody
Bug |
Category |
Details |
Line |
Priority |
new com.foxinmy.weixin4j.http.apache.content.ByteArrayBody(byte[], ContentType, String) may expose internal representation by storing an externally mutable object into ByteArrayBody.data |
MALICIOUS_CODE |
EI_EXPOSE_REP2 |
71 |
Medium |
com.foxinmy.weixin4j.http.apache.mime.MultipartEntity
Bug |
Category |
Details |
Line |
Priority |
Random object created and used only once in com.foxinmy.weixin4j.http.apache.mime.MultipartEntity.generateBoundary() |
BAD_PRACTICE |
DMI_RANDOM_USED_ONLY_ONCE |
108 |
High |
com.foxinmy.weixin4j.http.apache.mime.MultipartEntityBuilder
Bug |
Category |
Details |
Line |
Priority |
Random object created and used only once in com.foxinmy.weixin4j.http.apache.mime.MultipartEntityBuilder.generateBoundary() |
BAD_PRACTICE |
DMI_RANDOM_USED_ONLY_ONCE |
187 |
High |
com.foxinmy.weixin4j.http.entity.ByteArrayEntity
Bug |
Category |
Details |
Line |
Priority |
new com.foxinmy.weixin4j.http.entity.ByteArrayEntity(byte[], int, int, ContentType) may expose internal representation by storing an externally mutable object into ByteArrayEntity.content |
MALICIOUS_CODE |
EI_EXPOSE_REP2 |
26 |
Medium |
com.foxinmy.weixin4j.http.support.okhttp.OkHttpClient3
Bug |
Category |
Details |
Line |
Priority |
Possible null pointer dereference in com.foxinmy.weixin4j.http.support.okhttp.OkHttpClient3.execute(HttpRequest) due to return value of called method |
STYLE |
NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE |
44 |
Medium |
com.foxinmy.weixin4j.model.card.CardCoupons
com.foxinmy.weixin4j.model.card.CardInfo
Bug |
Category |
Details |
Line |
Priority |
The method name com.foxinmy.weixin4j.model.card.CardInfo.CardItem() doesn't start with a lower case letter |
BAD_PRACTICE |
NM_METHOD_NAMING_CONVENTION |
177 |
Medium |
The method name com.foxinmy.weixin4j.model.card.CardInfo.CardItem(String, String) doesn't start with a lower case letter |
BAD_PRACTICE |
NM_METHOD_NAMING_CONVENTION |
180-182 |
Medium |
Unused field: com.foxinmy.weixin4j.model.card.CardInfo.price |
PERFORMANCE |
UUF_UNUSED_FIELD |
Not available |
Medium |
com.foxinmy.weixin4j.model.card.CouponBaseInfo$Builder
Bug |
Category |
Details |
Line |
Priority |
Read of unwritten field locationIds in com.foxinmy.weixin4j.model.card.CouponBaseInfo$Builder.locationIds(String[]) |
CORRECTNESS |
NP_UNWRITTEN_FIELD |
852 |
Medium |
Unwritten field: com.foxinmy.weixin4j.model.card.CouponBaseInfo$Builder.locationIds |
CORRECTNESS |
UWF_UNWRITTEN_FIELD |
852 |
Medium |
com.foxinmy.weixin4j.model.card.GiftCard
Bug |
Category |
Details |
Line |
Priority |
Unread field: com.foxinmy.weixin4j.model.card.GiftCard.autoActivate |
PERFORMANCE |
URF_UNREAD_FIELD |
64 |
Medium |
Unread field: com.foxinmy.weixin4j.model.card.GiftCard.backgroundPicUrl |
PERFORMANCE |
URF_UNREAD_FIELD |
65 |
Medium |
Unread field: com.foxinmy.weixin4j.model.card.GiftCard.customField1 |
PERFORMANCE |
URF_UNREAD_FIELD |
66 |
Medium |
Unread field: com.foxinmy.weixin4j.model.card.GiftCard.customField2 |
PERFORMANCE |
URF_UNREAD_FIELD |
67 |
Medium |
Unread field: com.foxinmy.weixin4j.model.card.GiftCard.customField3 |
PERFORMANCE |
URF_UNREAD_FIELD |
68 |
Medium |
Unread field: com.foxinmy.weixin4j.model.card.GiftCard.initBalance |
PERFORMANCE |
URF_UNREAD_FIELD |
71 |
Medium |
Unread field: com.foxinmy.weixin4j.model.card.GiftCard.supplyBalance |
PERFORMANCE |
URF_UNREAD_FIELD |
69 |
Medium |
Unread field: com.foxinmy.weixin4j.model.card.GiftCard.supplyBonus |
PERFORMANCE |
URF_UNREAD_FIELD |
70 |
Medium |
com.foxinmy.weixin4j.model.card.GiftCardOrder
Bug |
Category |
Details |
Line |
Priority |
Unused field: com.foxinmy.weixin4j.model.card.GiftCardOrder.orderId |
PERFORMANCE |
UUF_UNUSED_FIELD |
Not available |
Medium |
Unused field: com.foxinmy.weixin4j.model.card.GiftCardOrder.pageId |
PERFORMANCE |
UUF_UNUSED_FIELD |
Not available |
Medium |
com.foxinmy.weixin4j.model.media.MediaDownloadResult
Bug |
Category |
Details |
Line |
Priority |
com.foxinmy.weixin4j.model.media.MediaDownloadResult.getContent() may expose internal representation by returning MediaDownloadResult.content |
MALICIOUS_CODE |
EI_EXPOSE_REP |
33 |
Medium |
new com.foxinmy.weixin4j.model.media.MediaDownloadResult(byte[], ContentType, String) may expose internal representation by storing an externally mutable object into MediaDownloadResult.content |
MALICIOUS_CODE |
EI_EXPOSE_REP2 |
46 |
Medium |
com.foxinmy.weixin4j.model.media.MediaUploadResult
Bug |
Category |
Details |
Line |
Priority |
com.foxinmy.weixin4j.model.media.MediaUploadResult.getCreatedAt() may expose internal representation by returning MediaUploadResult.createdAt |
MALICIOUS_CODE |
EI_EXPOSE_REP |
45 |
Medium |
new com.foxinmy.weixin4j.model.media.MediaUploadResult(String, MediaType, Date, String) may expose internal representation by storing an externally mutable object into MediaUploadResult.createdAt |
MALICIOUS_CODE |
EI_EXPOSE_REP2 |
32 |
Medium |
com.foxinmy.weixin4j.model.qr.QRResult
Bug |
Category |
Details |
Line |
Priority |
com.foxinmy.weixin4j.model.qr.QRResult.getContent() may expose internal representation by returning QRResult.content |
MALICIOUS_CODE |
EI_EXPOSE_REP |
61 |
Medium |
com.foxinmy.weixin4j.model.qr.QRResult.setContent(byte[]) may expose internal representation by storing an externally mutable object into QRResult.content |
MALICIOUS_CODE |
EI_EXPOSE_REP2 |
65 |
Medium |
com.foxinmy.weixin4j.util.ByteArrayBuffer
Bug |
Category |
Details |
Line |
Priority |
com.foxinmy.weixin4j.util.ByteArrayBuffer.buffer() may expose internal representation by returning ByteArrayBuffer.buffer |
MALICIOUS_CODE |
EI_EXPOSE_REP |
245 |
Medium |
com.foxinmy.weixin4j.util.CharArrayBuffer
Bug |
Category |
Details |
Line |
Priority |
com.foxinmy.weixin4j.util.CharArrayBuffer.buffer() may expose internal representation by returning CharArrayBuffer.buffer |
MALICIOUS_CODE |
EI_EXPOSE_REP |
271 |
Medium |
com.foxinmy.weixin4j.util.DigestUtil
Bug |
Category |
Details |
Line |
Priority |
Found reliance on default encoding in com.foxinmy.weixin4j.util.DigestUtil.HMACSHA256(String, String): String.getBytes() |
I18N |
DM_DEFAULT_ENCODING |
77 |
High |
com.foxinmy.weixin4j.util.FileUtil
Bug |
Category |
Details |
Line |
Priority |
Hard coded reference to an absolute pathname in com.foxinmy.weixin4j.util.FileUtil.main(String[]) |
STYLE |
DMI_HARDCODED_ABSOLUTE_FILENAME |
165 |
Medium |
com.foxinmy.weixin4j.util.ObjectId
Bug |
Category |
Details |
Line |
Priority |
Random object created and used only once in com.foxinmy.weixin4j.util.ObjectId.<static initializer for ObjectId>() |
BAD_PRACTICE |
DMI_RANDOM_USED_ONLY_ONCE |
272 |
High |
com.foxinmy.weixin4j.util.RandomUtil
Bug |
Category |
Details |
Line |
Priority |
Random object created and used only once in com.foxinmy.weixin4j.util.RandomUtil.generateString(int) |
BAD_PRACTICE |
DMI_RANDOM_USED_ONLY_ONCE |
32 |
High |
Random object created and used only once in com.foxinmy.weixin4j.util.RandomUtil.generateStringByLetterCharr(int) |
BAD_PRACTICE |
DMI_RANDOM_USED_ONLY_ONCE |
64 |
High |
Random object created and used only once in com.foxinmy.weixin4j.util.RandomUtil.generateStringByNumberChar(int) |
BAD_PRACTICE |
DMI_RANDOM_USED_ONLY_ONCE |
48 |
High |
com.foxinmy.weixin4j.xml.XmlStream
Bug |
Category |
Details |
Line |
Priority |
com.foxinmy.weixin4j.xml.XmlStream.<static initializer for XmlStream>() might ignore java.lang.Exception |
BAD_PRACTICE |
DE_MIGHT_IGNORE |
87 |
Medium |
Exception is caught when Exception is not thrown in com.foxinmy.weixin4j.xml.XmlStream.<static initializer for XmlStream>() |
STYLE |
REC_CATCH_EXCEPTION |
87 |
Medium |
Return value of putIfAbsent is ignored, but jaxbContext is reused in com.foxinmy.weixin4j.xml.XmlStream.getJaxbContext(Class) |
MT_CORRECTNESS |
RV_RETURN_VALUE_OF_PUTIFABSENT_IGNORED |
335 |
Medium |