skofgar/mercury

View on GitHub

Showing 821 of 821 total issues

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

    @SuppressWarnings("unchecked")
    public <T> T getBody(Class<T> toValueType, Class<?>... parameterClass) {
        if (parameterClass.length == 0) {
            throw new IllegalArgumentException("Missing parameter class");
        }
system/platform-core/src/main/java/org/platformlambda/core/models/EventEnvelope.java on lines 277..295

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

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

    @SuppressWarnings("unchecked")
    public <T> T getBody(Class<T> toValueType, Class<?>... parameterClass) {
        if (parameterClass.length == 0) {
            throw new IllegalArgumentException("Missing parameter class");
        }
system/platform-core/src/main/java/org/platformlambda/core/models/AsyncHttpRequest.java on lines 176..194

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

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 handle has 47 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        @Override
        public void handle(Message<Object> message) {
            Object body = message.body();
            if (body instanceof String) {
                String text = (String) body;

    Method checkServices has 47 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        @SuppressWarnings("unchecked")
        private boolean checkServices(List<Map<String, Object>> upstream, List<String> healthServices, boolean required) {
            PostOffice po = PostOffice.getInstance();
            boolean up = true;
            for (String route: healthServices) {

      Method getTopics has 47 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          private List<String> getTopics() throws IOException {
              Utility util = Utility.getInstance();
              PubSub ps = PubSub.getInstance();
              List<String> topics = ps.list();
              if (topics.size() > 1) {

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

                    for (String address : cluster) {
                        int start = address.lastIndexOf('/');
                        int colon = address.lastIndexOf(':');
                        if (colon > 1 && colon > start) {
                            String host = address.substring(start+1, colon);
        connectors/adapters/activemq/activemq-connector/src/main/java/org/platformlambda/activemq/ArtemisConnector.java on lines 85..98

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

        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

                this.future = Future.future(p -> {
                    this.promise = p;
                    this.id = "r."+ Utility.getInstance().getUuid();
                    String sender = from == null? ASYNC_INBOX : from;
                    this.listener = platform.getEventSystem().localConsumer(this.id, new AsyncMultiInbox.InboxHandler(sender));
        system/platform-core/src/main/java/org/platformlambda/core/models/AsyncInbox.java on lines 49..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 122.

        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

                this.future = Future.future(p -> {
                    this.promise = p;
                    this.id = "r."+ Utility.getInstance().getUuid();
                    String sender = from == null? ASYNC_INBOX : from;
                    this.listener = platform.getEventSystem().localConsumer(this.id, new InboxHandler(sender));
        system/platform-core/src/main/java/org/platformlambda/core/models/AsyncMultiInbox.java on lines 57..64

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

        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

                    for (String address : cluster) {
                        int start = address.lastIndexOf('/');
                        int colon = address.lastIndexOf(':');
                        if (colon > 1 && colon > start) {
                            String host = address.substring(start+1, colon);
        connectors/adapters/tibco/tibco-connector/src/main/java/org/platformlambda/tibco/TibcoConnector.java on lines 97..110

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

        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 request has 46 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public List<EventEnvelope> request(final List<EventEnvelope> events, long timeout) throws IOException {
                if (events == null || events.isEmpty()) {
                    throw new IllegalArgumentException(MISSING_EVENT);
                }
                List<TargetRoute> destinations = new ArrayList<>();

          Method asyncRequest has 46 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public Future<List<EventEnvelope>> asyncRequest(final List<EventEnvelope> events, long timeout) throws IOException {
                  if (events == null || events.isEmpty()) {
                      throw new IllegalArgumentException(MISSING_EVENT);
                  }
                  List<TargetRoute> destinations = new ArrayList<>();

            Method loadServices has 46 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                @SuppressWarnings("rawtypes")
                private void loadServices() {
                    log.info("Preloading started");
                    Utility util = Utility.getInstance();
                    Platform platform = Platform.getInstance();

              Method readValue has 46 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  @SuppressWarnings("unchecked")
                  public <T> T readValue(Object fromValue, Class<T> toValueType) {
                      if (fromValue == null || toValueType == null) {
                          return null;
                      }

                Method doGet has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    @Override
                    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException {
                        if (!ready) {
                            response.sendError(404, "Did you forget to do " +
                                    "'git clone https://github.com/swagger-api/swagger-ui.git' " +

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

                  /*
                  
                      Copyright 2018-2023 Accenture Technology
                  
                      Licensed under the Apache License, Version 2.0 (the "License");
                  system/rest-spring/src/main/java/org/platformlambda/rest/serializers/MessageBodyWriterJson.java on lines 1..65

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

                  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

                  /*
                  
                      Copyright 2018-2023 Accenture Technology
                  
                      Licensed under the Apache License, Version 2.0 (the "License");
                  system/rest-spring/src/main/java/org/platformlambda/rest/serializers/MessageBodyWriterText.java on lines 1..65

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

                  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

                              for (EventEnvelope evt: events) {
                                  n++;
                                  Map<String, Object> singleResult = new HashMap<>();
                                  singleResult.put("status", evt.getStatus());
                                  singleResult.put("headers", evt.getHeaders());
                  examples/rest-example/src/main/java/com/accenture/examples/rest/RpcHelloConcurrent.java on lines 76..86

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

                  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

                          for (EventEnvelope evt: responses) {
                              n++;
                              Map<String, Object> singleResult = new HashMap<>();
                              singleResult.put("status", evt.getStatus());
                              singleResult.put("headers", evt.getHeaders());
                  examples/rest-example/src/main/java/com/accenture/examples/rest/AsyncHelloConcurrent.java on lines 72..82

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

                  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 validateCompositePathSyntax has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public void validateCompositePathSyntax(String path) {
                          Utility util = Utility.getInstance();
                          List<String> segments = util.split(path, "./");
                          if (segments.isEmpty()) {
                              throw new IllegalArgumentException("Missing composite path");

                    Method request has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public EventEnvelope request(final EventEnvelope event, long timeout) throws IOException, TimeoutException, AppException {
                            if (event == null) {
                                throw new IllegalArgumentException(MISSING_EVENT);
                            }
                            String dest = event.getTo();
                      Severity
                      Category
                      Status
                      Source
                      Language