silentbalanceyh/vertx-zero

View on GitHub

Showing 9,050 of 9,050 total issues

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

    public <T> Future<T> upsertAsync(final JsonObject criteria, final JsonObject data, final String pojo) {
        return JqTool.joinAsync(criteria, data, JqFlow.create(this.analyzer, pojo))
            .compose(response -> this.upsertAsync(response.resultAt(VValue.IDX), (T) response.resultAt(VValue.ONE), pojo));
    }
vertx-gaia/vertx-up/src/main/jib/io/vertx/up/uca/jooq/UxJooq.java on lines 954..957

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

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

    private Future<JsonObject> fetchJ(final JsonObject response) {
        final UxJooq childJq = this.store.childJooq();
        if (Objects.nonNull(childJq)) {
            final JsonObject joined = this.store.dataJoin(response);
            return childJq.fetchJOneAsync(joined);
vertx-gaia/vertx-up/src/main/jib/io/vertx/up/uca/jooq/JoinUnique.java on lines 38..46

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

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

            list.stream().filter(Objects::nonNull).forEach(each -> {
                final K key = keyFn.apply(each);
                final V value = valueFn.apply(each);
                if (Objects.nonNull(key) && Objects.nonNull(value)) {
                    grouped.put(key, value);
Severity: Minor
Found in vertx-gaia/vertx-ams/src/main/java/io/horizon/util/CMap.java and 1 other location - About 45 mins to fix
vertx-pin/zero-atom/src/main/modulat/io/vertx/mod/atom/refine/AoCompare.java on lines 342..357

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

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

    private Future<JsonArray> fetchA(final JsonObject response) {
        final UxJooq childJq = this.store.childJooq();
        if (Objects.nonNull(childJq)) {
            final JsonObject joined = this.store.dataJoin(response);
            return childJq.fetchJAsync(joined);
vertx-gaia/vertx-up/src/main/jib/io/vertx/up/uca/jooq/JoinUnique.java on lines 48..56

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

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 <T> Future<T> updateAsync(final JsonObject criteria, final JsonObject data, final String pojo) {
        return JqTool.joinAsync(criteria, data, JqFlow.create(this.analyzer, pojo))
            .compose(response -> this.updateAsync(response.resultAt(VValue.IDX), (T) response.resultAt(VValue.ONE), pojo));
    }
vertx-gaia/vertx-up/src/main/jib/io/vertx/up/uca/jooq/UxJooq.java on lines 1118..1121

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

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 getResolver has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    private Resolver<T> getResolver(final RoutingContext context,
                                    final Epsilon<T> income) {
        /* 1.Read the resolver first **/
        final Annotation annotation = income.getAnnotation();
        final Class<?> resolverCls = Ut.invoke(annotation, YmlCore.resolver.__KEY);

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 fetchAggregation has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    private <T> List<Map<String, Object>> fetchAggregation(final JsonObject criteria, final Field[] selectedFields, final String... groupFields) {
        /*
         * Field[] by groupFields
         */
        final Field[] columns = this.analyzer.column(groupFields);

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 createProxy has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    public Object createProxy(final Class<?> clazz, final Method action) {
        final Injector di = ZeroAnno.getDi();
        final Object instance;
        if (clazz.isInterface()) {
            final Class<?> implClass = Ut.child(clazz);
Severity: Minor
Found in vertx-gaia/vertx-up/src/main/web/io/vertx/up/boot/di/DiPlugin.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

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

    protected <T> org.jooq.Record newRecord(T pojo) {
        Objects.requireNonNull(pojo);
        final org.jooq.Record record = this.context().newRecord(this.analyzer.table(), pojo);
        int size = record.size();
        for (int i = 0; i < size; i++)

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 toFreedom has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    protected String toFreedom(final Envelop envelop) {
        final JsonObject input = envelop.outJson();
        if (Ut.isNil(input)) {
            return null;
        } else {

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 toParameter has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    static Object toParameter(final Envelop envelop, final Class<?> type) {
        final Object returnValue;
        final RoutingContext context = envelop.context();
        if (is(type, XHeader.class)) {
            /*
Severity: Minor
Found in vertx-gaia/vertx-up/src/main/java/io/vertx/up/unity/Web.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

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

    protected List<CMessage> messages(final Object args, final ProceedingJoinPoint point) {
        final List<CMessage> messageList = new ArrayList<>();
        if (Objects.nonNull(args)) {
            if (args instanceof Collection) {
                /*

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 buildExpressionFactory has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    private static ExpressionFactory buildExpressionFactory() {
        if (canLoadExpressionFactory()) {
            final ExpressionFactory expressionFactory = ELManager.getExpressionFactory();
            LOGGER.debug("Loaded expression factory via original TCCL");
            return expressionFactory;

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 getRecord has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    protected HRecord getRecord(final Object input, final HRecord definition, final BTree mapping) {
        final HRecord record = definition.createNew();
        if (input instanceof String) {
            final String key = (String) input;
            record.key(key);
Severity: Minor
Found in vertx-gaia/vertx-up/src/main/java/io/vertx/up/commune/ActMapping.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

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

    private static Object findSmart(final JsonObject itPart) {
        /*
         * Find first complex object reference
         * 1. The first value of JsonObject
         * 2. The first value of JsonArray

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 deeply nested control flow statements.
Open

                        if (null != value) {
                            reference.add(value);
                        }
Severity: Major
Found in vertx-gaia/vertx-ams/src/main/java/io/horizon/util/CGroup.java - About 45 mins to fix

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

        static <T, V> List<T> remove(final List<T> list, final T entity, final Function<T, V> keyFn) {
            if (Objects.isNull(entity)) {
                return list;
            }
            final V keyAdd = keyFn.apply(entity);
    Severity: Minor
    Found in vertx-gaia/vertx-ams/src/main/java/io/horizon/util/CRemove.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 deeply nested control flow statements.
    Open

                            if (null == reference) {
                                reference = new ArrayList<>();
                            }
    Severity: Major
    Found in vertx-gaia/vertx-ams/src/main/java/io/horizon/util/CGroup.java - About 45 mins to fix

      Avoid deeply nested control flow statements.
      Open

                              if (ret.containsKey(key)) {
                                  reference = ret.get(key);
                              }
      Severity: Major
      Found in vertx-gaia/vertx-ams/src/main/java/io/horizon/util/CGroup.java - About 45 mins to fix

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

            static <T> T plugin(final JsonObject options, final String key, final Class<?> interfaceCls) {
                if (HUt.isNil(options) || HUt.isNil(key)) {
                    /*
                     * options or key are either invalid
                     */
        Severity: Minor
        Found in vertx-gaia/vertx-co/src/main/java/io/vertx/up/util/Instance.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

        Severity
        Category
        Status
        Source
        Language