silentbalanceyh/vertx-zero

View on GitHub
vertx-gaia/vertx-co/src/main/java/io/vertx/up/util/Invoker.java

Summary

Maintainability
B
6 hrs
Test Coverage

Method invokeAsync has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

    static <T> Future<T> invokeAsync(final Object instance,
                                     final Method method,
                                     final Object... args) {
        /*
         * Analyzing method returnType first
Severity: Minor
Found in vertx-gaia/vertx-co/src/main/java/io/vertx/up/util/Invoker.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

Method invokeAsync has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    static <T> Future<T> invokeAsync(final Object instance,
                                     final Method method,
                                     final Object... args) {
        /*
         * Analyzing method returnType first
Severity: Minor
Found in vertx-gaia/vertx-co/src/main/java/io/vertx/up/util/Invoker.java - About 1 hr to fix

    Method methodSeek has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
    Open

        private static Method methodSeek(final Object instance, final String name, final Object... args) {
            // Direct invoke, multi overwrite for unbox/box issue still existing.
            if (Ut.isNil(name) || Objects.isNull(instance)) {
                throw new _412ArgumentNullException(Invoker.class, "name | instance");
            }
    Severity: Minor
    Found in vertx-gaia/vertx-co/src/main/java/io/vertx/up/util/Invoker.java - About 55 mins 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

    Method isMatch has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

        private static boolean isMatch(final Method method, final String name, final Class<?>[] arguments) {
            if (!name.equals(method.getName())) {
                // Name not match
                return false;
            }
    Severity: Minor
    Found in vertx-gaia/vertx-co/src/main/java/io/vertx/up/util/Invoker.java - About 45 mins 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

    Avoid too many return statements within this method.
    Open

                        return Future.succeededFuture(null);
    Severity: Major
    Found in vertx-gaia/vertx-co/src/main/java/io/vertx/up/util/Invoker.java - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

                      return promise.future();
      Severity: Major
      Found in vertx-gaia/vertx-co/src/main/java/io/vertx/up/util/Invoker.java - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                    return Future.failedFuture(ex);
        Severity: Major
        Found in vertx-gaia/vertx-co/src/main/java/io/vertx/up/util/Invoker.java - About 30 mins to fix

          Method invokeObject has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              static <T> T invokeObject(
                  final Object instance,
                  final String name,
                  final Object... args) {
          
          
          Severity: Minor
          Found in vertx-gaia/vertx-co/src/main/java/io/vertx/up/util/Invoker.java - About 25 mins 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