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
77 13 0 0

Files

Class Bugs
us.codecraft.webmagic.Page 2
us.codecraft.webmagic.Request 1
us.codecraft.webmagic.Spider 2
us.codecraft.webmagic.downloader.HttpClientDownloader 1
us.codecraft.webmagic.downloader.HttpUriRequestConverter 1
us.codecraft.webmagic.model.HttpRequestBody 3
us.codecraft.webmagic.selector.JsonPathSelector 1
us.codecraft.webmagic.utils.FilePersistentBase 2

us.codecraft.webmagic.Page

Bug Category Details Line Priority
us.codecraft.webmagic.Page.getBytes() may expose internal representation by returning Page.bytes MALICIOUS_CODE EI_EXPOSE_REP 237 Medium
us.codecraft.webmagic.Page.setBytes(byte[]) may expose internal representation by storing an externally mutable object into Page.bytes MALICIOUS_CODE EI_EXPOSE_REP2 241 Medium

us.codecraft.webmagic.Request

Bug Category Details Line Priority
Class us.codecraft.webmagic.Request defines non-transient non-serializable instance field downloader BAD_PRACTICE SE_BAD_FIELD Not available Medium

us.codecraft.webmagic.Spider

Bug Category Details Line Priority
us.codecraft.webmagic.Spider.getStartTime() may expose internal representation by returning Spider.startTime MALICIOUS_CODE EI_EXPOSE_REP 791 Medium
Exceptional return value of java.util.concurrent.locks.Condition.await(long, TimeUnit) ignored in us.codecraft.webmagic.Spider.waitNewUrl() BAD_PRACTICE RV_RETURN_VALUE_IGNORED_BAD_PRACTICE 601 Medium

us.codecraft.webmagic.downloader.HttpClientDownloader

Bug Category Details Line Priority
Null passed for non-null parameter of HttpClientGenerator.getClient(Site) in us.codecraft.webmagic.downloader.HttpClientDownloader.getHttpClient(Site) CORRECTNESS NP_NULL_PARAM_DEREF_ALL_TARGETS_DANGEROUS 56 Medium

us.codecraft.webmagic.downloader.HttpUriRequestConverter

Bug Category Details Line Priority
Nullcheck of site at line 69 of value previously dereferenced in us.codecraft.webmagic.downloader.HttpUriRequestConverter.convertHttpUriRequest(Request, Site, Proxy) CORRECTNESS RCN_REDUNDANT_NULLCHECK_WOULD_HAVE_BEEN_A_NPE 62 Medium

us.codecraft.webmagic.model.HttpRequestBody

Bug Category Details Line Priority
us.codecraft.webmagic.model.HttpRequestBody.getBody() may expose internal representation by returning HttpRequestBody.body MALICIOUS_CODE EI_EXPOSE_REP 100 Medium
new us.codecraft.webmagic.model.HttpRequestBody(byte[], String, String) may expose internal representation by storing an externally mutable object into HttpRequestBody.body MALICIOUS_CODE EI_EXPOSE_REP2 42 Medium
us.codecraft.webmagic.model.HttpRequestBody.setBody(byte[]) may expose internal representation by storing an externally mutable object into HttpRequestBody.body MALICIOUS_CODE EI_EXPOSE_REP2 56 Medium

us.codecraft.webmagic.selector.JsonPathSelector

Bug Category Details Line Priority
Redundant nullcheck of object, which is known to be non-null in us.codecraft.webmagic.selector.JsonPathSelector.select(String) STYLE RCN_REDUNDANT_NULLCHECK_OF_NONNULL_VALUE 36 Medium

us.codecraft.webmagic.utils.FilePersistentBase

Bug Category Details Line Priority
us.codecraft.webmagic.utils.FilePersistentBase.PATH_SEPERATOR isn't final but should be refactored to be so MALICIOUS_CODE MS_SHOULD_BE_REFACTORED_TO_BE_FINAL 15 High
Exceptional return value of java.io.File.mkdirs() ignored in us.codecraft.webmagic.utils.FilePersistentBase.checkAndMakeParentDirecotry(String) BAD_PRACTICE RV_RETURN_VALUE_IGNORED_BAD_PRACTICE 42 Medium