Showing 72 of 117 total issues
Method unsalt
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
@SuppressWarnings("PMD.CyclomaticComplexity")
private static byte[] unsalt(final byte[] text) {
if (text.length == 0) {
throw new DecodingException("empty input");
}
Method token
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
private String token(final String home, final String code)
throws IOException {
final String response = this.request
.uri()
.set(
Method copy
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
public void copy() throws IOException {
int match = 0;
boolean cont = true;
while (cont) {
if (!this.buffer.hasRemaining()) {
Method start
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
@Override
public void start(final Exit exit) throws IOException {
final Take tks;
if (this.options.hitRefresh()) {
tks = request -> this.take.act(
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method resolve
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
@Override
public Source resolve(final String href, final String base)
throws TransformerException {
final URI uri;
if (base == null || base.isEmpty()) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method resolve
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
public Source resolve(final String href, final String base)
throws TransformerException {
final URI uri;
if (base == null || base.isEmpty()) {
Method head
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
public Iterable<String> head() {
final Collection<String> head = new LinkedList<>();
head.add(new HttpHead(this.sreq).toString());
final Collection<String> names = Collections.list(
Method act
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
@SuppressWarnings("PMD.AvoidCatchingGenericException")
public Response act(final Request req) throws IOException {
if (this.count <= 0) {
throw new IllegalArgumentException(
Method next
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static State next(final InputStream stream, final State state,
final ByteArrayOutputStream line) throws IOException {
final int next = stream.read();
if (next == -1) {
throw new IOException("chunked stream ended unexpectedly");
Method header
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
public List<String> header(final CharSequence key)
throws IOException {
final List<String> values = this.map().getOrDefault(
new UncheckedText(
Method header
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
public List<String> header(final CharSequence key)
throws IOException {
final List<String> values = this.map().getOrDefault(
new UncheckedText(
Method chunkSize
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static int chunkSize(final InputStream stream)
throws IOException {
final ByteArrayOutputStream baos = ChunkedInputStream.sizeLine(stream);
final String data = baos.toString(Charset.defaultCharset().name());
final int separator = data.indexOf(';');
Method urn
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
private Opt<String> urn(final String user, final String pwd) {
final String urn;
try {
urn = this.usernames.get(
String.format(
Method asMap
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
@SuppressWarnings("PMD.AvoidInstantiatingObjectsInLoops")
private static SortedMap<String, List<String>> asMap(final String query) {
final SortedMap<String, List<String>> params = new TreeMap<>();
if (query != null) {
for (final String pair : query.split("&")) {
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method parse
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
@SuppressWarnings("PMD.AvoidInstantiatingObjectsInLoops")
private static Request parse(final InputStream input) throws IOException {
boolean eof = true;
final Collection<String> head = new LinkedList<>();
final ByteArrayOutputStream baos = new ByteArrayOutputStream();
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method parse
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
@SuppressWarnings("PMD.AvoidInstantiatingObjectsInLoops")
private static Request parse(final InputStream input) throws IOException {
boolean eof = true;
final Collection<String> head = new LinkedList<>();
final ByteArrayOutputStream baos = new ByteArrayOutputStream();
Method response
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
private Response response(final String home, final URI dest,
final com.jcabi.http.Response rsp) {
final Collection<String> hdrs = new LinkedList<>();
hdrs.add(
String.format(
Method prepareDocType
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static void prepareDocType(final InputStream body,
final Transformer transformer) throws IOException {
try {
final String html = "html";
final DocumentType doctype = RsPrettyXml.getDocType(body);
Method printHead
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public void printHead(final OutputStream output) throws IOException {
final String eol = "\r\n";
final Writer writer =
new OutputStreamWriter(output, StandardCharsets.UTF_8);
int pos = 0;
Method route
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
public Opt<Response> route(final Request req) throws IOException {
final Iterator<String> headers =
new RqHeaders.Base(req).header("Accept-Encoding").iterator();
final Opt<Response> resp;