silentbalanceyh/vertx-zero

View on GitHub

Showing 9,050 of 9,050 total issues

Method build has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    private static Envelop build(final JsonObject json) {
        Envelop envelop = Envelop.ok();
        // 1. Headers
        if (null != json) {
            // 2.Rebuild

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

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    public TOaTraining(
        String key,
        String commentExtension,
        LocalDateTime startAt,
        LocalDateTime endAt,
vertx-pin/zero-rbac/src/main/java/cn/vertxup/rbac/domain/tables/pojos/OAccessToken.java on lines 46..68

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 115.

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

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

    public OAccessToken(
        String key,
        byte[] token,
        byte[] auth,
        Long expiredTime,
vertx-pin/zero-erp/src/main/java/cn/vertxup/erp/domain/tables/pojos/TOaTraining.java on lines 45..67

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 115.

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

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

    @Override
    public ConcurrentMap<Integer, HttpServerOptions> visit(final String... key)
        throws ProgramException {
        final JsonArray serverData = this.serverPre(0, key);
        this.logger().info(VMessage.Visitor.V_BEFORE, KName.SERVER, this.serverType(), serverData.encode());
vertx-gaia/vertx-up/src/main/web/io/vertx/up/boot/options/SockVisitor.java on lines 26..39

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 114.

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

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

            } else if (HUt.isInteger(type)) {
                /*
                 * Integer -> Long
                 * Short -> Long
                 */
vertx-gaia/vertx-ams/src/main/jib/io/horizon/uca/convert/ShortVto.java on lines 32..58

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 114.

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

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

    @Override
    public ConcurrentMap<Integer, SockOptions> visit(final String... key)
        throws ProgramException {
        final JsonArray serverData = this.serverPre(0, key);
        this.logger().info(VMessage.Visitor.V_BEFORE, KName.SERVER, this.serverType(), serverData.encode());
vertx-gaia/vertx-up/src/main/web/io/vertx/up/boot/options/HttpServerVisitor.java on lines 31..44

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 114.

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

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

            } else if (HUt.isInteger(type)) {
                /*
                 * Integer -> Short
                 * Long -> Short
                 */
vertx-gaia/vertx-ams/src/main/jib/io/horizon/uca/convert/LongVto.java on lines 32..58

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 114.

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

Further Reading

Method toParameter has 43 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    static Object toParameter(final RoutingContext context, final Class<?> type) {
        Object returnValue = null;
        if (is(type, XHeader.class)) {
            /*
             * XHeader for
Severity: Minor
Found in vertx-gaia/vertx-up/src/main/java/io/vertx/up/unity/Web.java - About 1 hr to fix

    Method toJson has 43 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

            @Override
            public default io.vertx.core.json.JsonObject toJson() {
                    io.vertx.core.json.JsonObject json = new io.vertx.core.json.JsonObject();
                    json.put("KEY",getKey());
                    json.put("SERIAL",getSerial());

      Method toJson has 43 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              @Override
              public default io.vertx.core.json.JsonObject toJson() {
                      io.vertx.core.json.JsonObject json = new io.vertx.core.json.JsonObject();
                      json.put("KEY",getKey());
                      json.put("CODE",getCode());

        Method createChild has 43 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            private static Future<IDirectory> createChild(final Future<IDirectory> futureParent,
                                                          final IDirectory child,
                                                          final JsonObject params) {
                final UxJooq jq = Ux.Jooq.on(IDirectoryDao.class);
                final String updatedBy = params.getString(KName.UPDATED_BY);

          Identical blocks of code found in 2 locations. Consider refactoring.
          Open

                  {
                      /*
                       * Auditor information of current application.
                       * createdAt, createdBy
                       * updatedAt, updatedBy
          vertx-pin/zero-ambient/src/main/jib/io/horizon/spi/environment/UnityAmbient.java on lines 152..164

          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 112.

          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

          Further Reading

          Identical blocks of code found in 2 locations. Consider refactoring.
          Open

                  {
                      /*
                       * Auditor information of current application.
                       * createdAt, createdBy
                       * updatedAt, updatedBy
          vertx-pin/zero-ambient/src/main/jib/io/horizon/spi/environment/_RegistryKit.java on lines 141..153

          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 112.

          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

          Further Reading

          Method parse has 42 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              static Date parse(final String literal) {
                  if (Objects.isNull(literal)) {
                      return null;
                  } else {
                      String target = literal;
          Severity: Minor
          Found in vertx-gaia/vertx-ams/src/main/java/io/horizon/util/TPeriod.java - About 1 hr to fix

            Method fromJson has 42 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    @Override
                    public default IWTicket fromJson(io.vertx.core.json.JsonObject json) {
                            setOrThrow(this::setKey,json::getString,"KEY","java.lang.String");
                            setOrThrow(this::setSerial,json::getString,"SERIAL","java.lang.String");
                            setOrThrow(this::setName,json::getString,"NAME","java.lang.String");

              Method fromJson has 42 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      @Override
                      public default IEIdentity fromJson(io.vertx.core.json.JsonObject json) {
                              setOrThrow(this::setKey,json::getString,"KEY","java.lang.String");
                              setOrThrow(this::setCode,json::getString,"CODE","java.lang.String");
                              setOrThrow(this::setType,json::getString,"TYPE","java.lang.String");

                Method toString has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    @Override
                    public String toString() {
                        StringBuilder sb = new StringBuilder("PBuyOrder (");
                
                        sb.append(key);

                  Method hashCode has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      @Override
                      public int hashCode() {
                          final int prime = 31;
                          int result = 1;
                          result = prime * result + ((this.key == null) ? 0 : this.key.hashCode());

                    Consider simplifying this complex logical expression.
                    Open

                                if (widely) {
                                    /*
                                     * 匹配对
                                     * yes / no
                                     * true / false
                    Severity: Critical
                    Found in vertx-gaia/vertx-ams/src/main/java/io/horizon/util/TIs.java - About 1 hr to fix

                      Identical blocks of code found in 3 locations. Consider refactoring.
                      Open

                          static void registry(final HAmbient ambient) {
                              /*
                               * Read definition of security configuration from RBAC default folder
                               */
                              if (null == CONFIG) {
                      vertx-pin/zero-atom/src/main/modulat/io/vertx/mod/atom/init/_AoConfiguration.java on lines 20..33
                      vertx-pin/zero-crud/src/main/modulat/io/vertx/mod/crud/init/_IxConfiguration.java on lines 31..47

                      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 110.

                      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

                      Further Reading

                      Severity
                      Category
                      Status
                      Source
                      Language