silentbalanceyh/vertx-zero

View on GitHub
vertx-pin/zero-vie/src/main/jib/io/mature/extension/uca/log/KoData.java

Summary

Maintainability
B
4 hrs
Test Coverage

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

    static XLog ongoing(final Class<?> clazz, final DataAtom atom, final JsonObject record) {
        final XLog log = KoTool.warn(clazz, atom, record);
        log.setType(TypeLog.TODO_ONGOING.name());
        log.setInfoSystem(toMessage(record));
        log.setInfoReadable(Ox.Env.message(TypeLog.TODO_ONGOING));
vertx-pin/zero-vie/src/main/jib/io/mature/extension/uca/log/KoData.java on lines 38..44
vertx-pin/zero-vie/src/main/jib/io/mature/extension/uca/log/KoData.java on lines 46..52

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

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 3 locations. Consider refactoring.
Open

    static XLog push(final Class<?> clazz, final DataAtom atom, final JsonObject data) {
        final XLog log = KoTool.warn(clazz, atom, data);
        log.setType(TypeLog.PUSH_FAIL.name());
        log.setInfoSystem(toMessage(data));
        log.setInfoReadable(Ox.Env.message(TypeLog.PUSH_FAIL));
vertx-pin/zero-vie/src/main/jib/io/mature/extension/uca/log/KoData.java on lines 30..36
vertx-pin/zero-vie/src/main/jib/io/mature/extension/uca/log/KoData.java on lines 38..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 64.

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 3 locations. Consider refactoring.
Open

    static XLog pending(final Class<?> clazz, final DataAtom atom, final JsonObject data) {
        final XLog log = KoTool.info(clazz, atom, data);
        log.setType(TypeLog.PUSH_NONE.name());
        log.setInfoSystem(toMessage(data));
        log.setInfoReadable(Ox.Env.message(TypeLog.PUSH_NONE));
vertx-pin/zero-vie/src/main/jib/io/mature/extension/uca/log/KoData.java on lines 30..36
vertx-pin/zero-vie/src/main/jib/io/mature/extension/uca/log/KoData.java on lines 46..52

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

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 3 locations. Consider refactoring.
Open

    static List<XLog> ongoing(final Class<?> clazz, final DataAtom atom, final JsonArray records) {
        final List<XLog> logs = new ArrayList<>();
        Ut.itJArray(records).map(each -> ongoing(clazz, atom, each)).forEach(logs::add);
        return logs;
    }
vertx-pin/zero-vie/src/main/jib/io/mature/extension/uca/log/KoData.java on lines 66..70
vertx-pin/zero-vie/src/main/jib/io/mature/extension/uca/log/KoData.java on lines 72..76

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

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 3 locations. Consider refactoring.
Open

    static List<XLog> unique(final Class<?> clazz, final DataAtom atom, final JsonArray data) {
        final List<XLog> logs = new ArrayList<>();
        Ut.itJArray(data).map(each -> unique(clazz, atom, each)).forEach(logs::add);
        return logs;
    }
vertx-pin/zero-vie/src/main/jib/io/mature/extension/uca/log/KoData.java on lines 60..64
vertx-pin/zero-vie/src/main/jib/io/mature/extension/uca/log/KoData.java on lines 72..76

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

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 3 locations. Consider refactoring.
Open

    static List<XLog> pending(final Class<?> clazz, final DataAtom atom, final JsonArray data) {
        final List<XLog> logs = new ArrayList<>();
        Ut.itJArray(data).map(each -> pending(clazz, atom, each)).forEach(logs::add);
        return logs;
    }
vertx-pin/zero-vie/src/main/jib/io/mature/extension/uca/log/KoData.java on lines 60..64
vertx-pin/zero-vie/src/main/jib/io/mature/extension/uca/log/KoData.java on lines 66..70

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

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

There are no issues that match your filters.

Category
Status