skofgar/mercury

View on GitHub

Showing 821 of 821 total issues

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

    public byte[] rsaDecrypt(byte[] cipherText, byte[] privateKey) throws GeneralSecurityException {
        PrivateKey key = getPrivate(privateKey, true);
        Cipher cipher = Cipher.getInstance(RSA_PADDING);
        cipher.init(Cipher.DECRYPT_MODE, key);
        return cipher.doFinal(cipherText);
system/platform-core/src/main/java/org/platformlambda/core/util/CryptoApi.java on lines 140..145

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

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 k: cache.keySet()) {
            TimedItem item = cache.get(k);
            if (now - item.time > expiry) {
                expired.add(k);
            }
connectors/core/service-monitor/src/main/java/org/platformlambda/services/HouseKeeper.java on lines 123..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 48.

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 k: monitors.keySet()) {
            MonitorInstance monitor = monitors.get(k);
            if (now - monitor.updated > ONE_MINUTE) {
                expired.add(k);
            }
system/platform-core/src/main/java/org/platformlambda/core/util/SimpleCache.java on lines 128..133

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

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

                                    if (ADD.equals(type) && event.containsKey(ROUTE)) {
                                        po.send(LANGUAGE_REGISTRY, new Kv(TYPE, ADD),
                                                new Kv(TOKEN, token), new Kv(ROUTE, event.get(ROUTE)));
                                    }
language-packs/language-connector/src/main/java/org/platformlambda/lang/websocket/server/LanguageConnector.java on lines 336..339

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

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

                                    if (REMOVE.equals(type) && event.containsKey(ROUTE)) {
                                        po.send(LANGUAGE_REGISTRY, new Kv(TYPE, REMOVE),
                                                new Kv(TOKEN, token), new Kv(ROUTE, event.get(ROUTE)));
                                    }
language-packs/language-connector/src/main/java/org/platformlambda/lang/websocket/server/LanguageConnector.java on lines 332..335

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

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 ScheduledJob(String name, String service, String cronSchedule) {
        this.created = new Date();
        this.name = name;
        this.service = service;
        this.cronSchedule = cronSchedule;
language-packs/language-connector/src/main/java/org/platformlambda/lang/websocket/server/LanguageConnector.java on lines 544..549

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

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 ConnectionStatus(String rxPath, String txPath, String token) {
            this.created = new Date();
            this.rxPath = rxPath;
            this.txPath = txPath;
            this.token = token;
extensions/simple-scheduler/src/main/java/org/platformlambda/quartz/models/ScheduledJob.java on lines 42..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 48.

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

            if (group.get(KEEP) instanceof List) {
                List<Object> items = (List<Object>) group.get(KEEP);
                for (Object o : items) {
                    info.keep(o.toString().toLowerCase());
                }
system/platform-core/src/main/java/org/platformlambda/automation/config/RoutingEntry.java on lines 711..716

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

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

            if (group.get(DROP) instanceof List) {
                List<Object> items = (List<Object>) group.get(DROP);
                for (Object o : items) {
                    info.drop(o.toString().toLowerCase());
                }
system/platform-core/src/main/java/org/platformlambda/automation/config/RoutingEntry.java on lines 717..722

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

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 getSize has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    public long getSize(T t, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType) {

    Method sendResponse has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        public static void sendResponse(HttpServletResponse response, int status, String message, String uri, String accept)

      Method getSize has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          public long getSize(T t, Class<?> cls, Type genericType, Annotation[] annotations, MediaType mediaType) {

        Method getSize has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            public long getSize(T t, Class<?> cls, Type genericType, Annotation[] annotations, MediaType mediaType) {

          Method sendResponse has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              public void sendResponse(String type, String requestId, HttpServerRequest request, int status, String message) {

            Method getSize has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                public long getSize(T t, Class<?> cls, Type type, Annotation[] annotations, MediaType mediaType) {

              Method aesEncrypt has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  public void aesEncrypt(InputStream clearIn, OutputStream encryptedOut, byte[] key, byte[] iv, String algorithm)

                Method aesDecrypt has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    public void aesDecrypt(InputStream encryptedIn, OutputStream clearOut, byte[] key, byte[] iv, String algorithm)

                  Method sendResponse has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      private void sendResponse(String type, HttpServerResponse response, String uri, int status, Object message) {

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

                            if (value instanceof String) {
                                String s = (String) value;
                                if (s.startsWith("${") && s.endsWith("}")) {
                                    return Utility.getInstance().getEnvVariable(s);
                                }
                    system/platform-core/src/main/java/org/platformlambda/core/util/ConfigReader.java on lines 80..85

                    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

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

                                            } else {
                                                byte[] payload = SimpleMapper.getInstance().getMapper().writeValueAsBytes(responseBody);
                                                response.putHeader(CONTENT_LEN, String.valueOf(payload.length));
                                                response.write(Buffer.buffer(payload));
                                            }
                    system/platform-core/src/main/java/org/platformlambda/automation/services/ServiceResponseHandler.java on lines 234..238

                    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

                    Severity
                    Category
                    Status
                    Source
                    Language