Showing 117 of 117 total issues
Identical blocks of code found in 2 locations. Consider refactoring. Open
@Override
@SuppressFBWarnings("EQ_UNUSUAL")
public boolean equals(final Object that) {
return new Unchecked<>(
new Or(
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 128.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Method requests
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
private Map<String, List<Request>> requests(
final Request req) throws IOException {
final String header = new RqHeaders.Smart(req).single("Content-Type");
final Unchecked<Boolean> multipart = new Unchecked<>(
new StartsWith(
Method make
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static Map<Integer, String> make() {
final Map<Integer, String> map = new HashMap<>(0);
map.put(HttpURLConnection.HTTP_OK, "OK");
map.put(HttpURLConnection.HTTP_CREATED, "Created");
map.put(HttpURLConnection.HTTP_ACCEPTED, "Accepted");
Method route
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
private static Response route(final Take take, final Fallback fbk,
final Request req) throws Exception {
final long start = System.currentTimeMillis();
Response res;
try {
Method enter
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
@Override
public Opt<Identity> enter(final Request request) throws IOException {
final Iterator<String> headers = new RqHeaders.Smart(request)
.header("authorization").iterator();
if (!headers.hasNext()) {
Method start
has 41 lines of code (exceeds 25 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(
Similar blocks of code found in 3 locations. Consider refactoring. Open
@Override
public List<String> header(final CharSequence key)
throws IOException {
final List<String> values = this.map().getOrDefault(
new UncheckedText(
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 100.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 3 locations. Consider refactoring. Open
@Override
public Iterable<String> param(final CharSequence key)
throws IOException {
final List<String> values = this.map().getOrDefault(
new UncheckedText(
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 100.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 3 locations. Consider refactoring. Open
@Override
public List<String> header(final CharSequence key)
throws IOException {
final List<String> values = this.map().getOrDefault(
new UncheckedText(
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 100.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Method map
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
@SuppressWarnings("PMD.AvoidInstantiatingObjectsInLoops")
private Map<String, List<String>> map() throws IOException {
final Iterator<String> head = this.head().iterator();
if (!head.hasNext()) {
throw new HttpException(
Method map
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
@SuppressWarnings("PMD.AvoidInstantiatingObjectsInLoops")
private Map<String, List<String>> map() throws IOException {
final Iterator<String> head = this.head().iterator();
if (!head.hasNext()) {
throw new HttpException(
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");
}
Similar blocks of code found in 2 locations. Consider refactoring. Open
/*
* The MIT License (MIT)
*
* Copyright (c) 2014-2024 Yegor Bugayenko
*
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 94.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
/*
* The MIT License (MIT)
*
* Copyright (c) 2014-2024 Yegor Bugayenko
*
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 94.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
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(