silentbalanceyh/vertx-zero

View on GitHub
vertx-pin/zero-atom/src/main/modulat/io/vertx/mod/atom/refine/AoCompare.java

Summary

Maintainability
D
1 day
Test Coverage

Method diffPull has 79 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    static ConcurrentMap<ChangeFlag, JsonArray> diffPull(
        final JsonArray queueOld, final JsonArray queueNew,
        final DataAtom atom, final Set<String> ignoreSet
    ) {
        /*

    Method diffPure has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        static ConcurrentMap<ChangeFlag, JsonArray> diffPure(
            final JsonArray queueO, final JsonArray queueN,
            final DataAtom atom, final Set<String> ignoreSet
        ) {
            final HRule rules = atom.ruleSmart();

      Avoid too many return statements within this method.
      Open

              return new ConcurrentHashMap<ChangeFlag, JsonArray>() {
                  {
                      this.put(ChangeFlag.ADD, queueA);
                      this.put(ChangeFlag.DELETE, queueD);
                      this.put(ChangeFlag.UPDATE, queueU);

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

            static JsonObject diffPull(
                final JsonObject recordO, final JsonObject recordN,
                final DataAtom atom, final Set<String> ignoreSet
            ) {
                final JsonArray queueN = new JsonArray().add(recordN);
        vertx-pin/zero-atom/src/main/modulat/io/vertx/mod/atom/refine/AoCompare.java on lines 99..114

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

        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

            static JsonObject diffPure(
                final JsonObject recordO, final JsonObject recordN,
                final DataAtom atom, final Set<String> ignoreSet
            ) {
                final JsonArray queueN = new JsonArray().add(recordN);
        vertx-pin/zero-atom/src/main/modulat/io/vertx/mod/atom/refine/AoCompare.java on lines 424..439

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

        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

            static Apt diffPure(final Apt apt, final DataAtom atom,
                                final Set<String> ignoreSet) {
                final JsonArray queueO = apt.dataO();
                final JsonArray queueN = apt.dataN();
                LOG.Uca.info(AoCompare.class, "(Pure)新旧数量:({2} vs {3}),新数据:{1}, 旧数据:{0}",
        vertx-pin/zero-atom/src/main/modulat/io/vertx/mod/atom/refine/AoCompare.java on lines 441..453

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

        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

            static Apt diffPull(final Apt apt, final DataAtom atom,
                                final Set<String> ignoreSet) {
                final JsonArray queueO = apt.dataO();
                final JsonArray queueN = apt.dataN();
                LOG.Uca.info(AoCompare.class, "(Pull)新旧数量:({2} vs {3}),新数据:{1}, 旧数据:{0}",
        vertx-pin/zero-atom/src/main/modulat/io/vertx/mod/atom/refine/AoCompare.java on lines 116..128

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

        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

                                    rules.ruleStrong().forEach(rule -> rule.getFields().forEach(field -> {
                                        /*
                                         * 以旧数据中的强连接字段为主
                                         */
                                        final Object oldV = oldRef.getValue(field);
        vertx-gaia/vertx-ams/src/main/java/io/horizon/util/CMap.java on lines 20..26

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

            static <T> ConcurrentMap<ChangeFlag, List<T>> initMList() {
                return new ConcurrentHashMap<ChangeFlag, List<T>>() {
                    {
                        this.put(ChangeFlag.DELETE, new ArrayList<>());
                        this.put(ChangeFlag.ADD, new ArrayList<>());
        vertx-pin/zero-atom/src/main/modulat/io/vertx/mod/atom/refine/AoCompare.java on lines 40..48
        vertx-pin/zero-atom/src/main/modulat/io/vertx/mod/atom/refine/AoCompare.java on lines 50..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 47.

        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 ConcurrentMap<ChangeFlag, JsonArray> initMArray() {
                return new ConcurrentHashMap<ChangeFlag, JsonArray>() {
                    {
                        this.put(ChangeFlag.DELETE, new JsonArray());
                        this.put(ChangeFlag.ADD, new JsonArray());
        vertx-pin/zero-atom/src/main/modulat/io/vertx/mod/atom/refine/AoCompare.java on lines 30..38
        vertx-pin/zero-atom/src/main/modulat/io/vertx/mod/atom/refine/AoCompare.java on lines 40..48

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

        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 <T> ConcurrentMap<ChangeFlag, Queue<T>> initMQueue() {
                return new ConcurrentHashMap<ChangeFlag, Queue<T>>() {
                    {
                        this.put(ChangeFlag.DELETE, new ConcurrentLinkedQueue<>());
                        this.put(ChangeFlag.ADD, new ConcurrentLinkedQueue<>());
        vertx-pin/zero-atom/src/main/modulat/io/vertx/mod/atom/refine/AoCompare.java on lines 30..38
        vertx-pin/zero-atom/src/main/modulat/io/vertx/mod/atom/refine/AoCompare.java on lines 50..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 47.

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

                return new ConcurrentHashMap<ChangeFlag, JsonArray>() {
                    {
                        this.put(ChangeFlag.ADD, queueA);
                        this.put(ChangeFlag.DELETE, queueD);
                        this.put(ChangeFlag.UPDATE, queueU);
        vertx-pin/zero-atom/src/main/modulat/io/vertx/mod/atom/refine/AoCompare.java on lines 90..96
        vertx-pin/zero-is/src/main/modulat/io/vertx/mod/is/refine/IsDir.java on lines 193..199

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

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

                return new ConcurrentHashMap<ChangeFlag, JsonArray>() {
                    {
                        this.put(ChangeFlag.ADD, queueA);
                        this.put(ChangeFlag.DELETE, queueD);
                        this.put(ChangeFlag.UPDATE, queueU);
        vertx-pin/zero-atom/src/main/modulat/io/vertx/mod/atom/refine/AoCompare.java on lines 415..421
        vertx-pin/zero-is/src/main/modulat/io/vertx/mod/is/refine/IsDir.java on lines 193..199

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

        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