vertx-gaia/vertx-up/src/main/java/io/vertx/up/commune/Envelop.java
Envelop
has 54 methods (exceeds 20 allowed). Consider refactoring. Open
Open
public class Envelop implements Serializable {
/* Basic Data for Envelop such as: Data, Error, Status */
private final HttpStatusCode status;
private final WebException error;
File Envelop.java
has 294 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
package io.vertx.up.commune;
import io.horizon.eon.em.web.HttpStatusCode;
import io.horizon.exception.WebException;
import io.horizon.exception.web._500InternalServerException;
Method failure
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
Open
public static Envelop failure(final Throwable ex) {
if (ex instanceof WebException) {
// Throwable converted to WebException
return failure((WebException) ex);
} else {
- 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"