silentbalanceyh/vertx-zero

View on GitHub
vertx-gaia/vertx-up/src/main/java/io/vertx/up/commune/Envelop.java

Summary

Maintainability
C
1 day
Test Coverage

Envelop has 54 methods (exceeds 20 allowed). Consider refactoring.
Open

public class Envelop implements Serializable {

    /* Basic Data for Envelop such as: Data, Error, Status */
    private final HttpStatusCode status;
    private final WebException error;
Severity: Major
Found in vertx-gaia/vertx-up/src/main/java/io/vertx/up/commune/Envelop.java - About 7 hrs to fix

    File Envelop.java has 294 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    package io.vertx.up.commune;
    
    import io.horizon.eon.em.web.HttpStatusCode;
    import io.horizon.exception.WebException;
    import io.horizon.exception.web._500InternalServerException;
    Severity: Minor
    Found in vertx-gaia/vertx-up/src/main/java/io/vertx/up/commune/Envelop.java - About 3 hrs to fix

      Method failure has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          public static Envelop failure(final Throwable ex) {
              if (ex instanceof WebException) {
                  // Throwable converted to WebException
                  return failure((WebException) ex);
              } else {
      Severity: Minor
      Found in vertx-gaia/vertx-up/src/main/java/io/vertx/up/commune/Envelop.java - About 1 hr to fix

      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

      There are no issues that match your filters.

      Category
      Status