joestrhq/AcronisFSS

View on GitHub

Showing 33 of 48 total issues

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

    HttpRequest req = HttpRequest.newBuilder()
      .GET()
      .uri(uri.build())
      .header(HttpHeaders.AUTHORIZATION, "Bearer " + bearerToken)
      .header(HttpHeaders.ACCEPT, "application/json")
src/main/java/at/or/joestr/acronisfss/api/endpoints/DeviceEndpoint.java on lines 57..62
src/main/java/at/or/joestr/acronisfss/api/endpoints/DeviceEndpoint.java on lines 124..129
src/main/java/at/or/joestr/acronisfss/api/endpoints/DeviceEndpoint.java on lines 208..213
src/main/java/at/or/joestr/acronisfss/api/endpoints/SyncAndShareNodesEndpoint.java on lines 78..83

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

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

    HttpRequest req = HttpRequest.newBuilder()
      .uri(new URI(authUri.toString() + ENDPOINT_PATH))
      .header(HttpHeaders.ACCEPT, ContentType.APPLICATION_JSON.getMimeType())
      .header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_FORM_URLENCODED.getMimeType())
src/main/java/at/or/joestr/acronisfss/api/endpoints/AuthorizationEndpoint.java on lines 93..96

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

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

    HttpRequest req = HttpRequest.newBuilder()
      .GET()
      .uri(uri.build())
      .header(HttpHeaders.AUTHORIZATION, "Bearer " + bearerToken)
      .header(HttpHeaders.ACCEPT, "application/json")
src/main/java/at/or/joestr/acronisfss/api/endpoints/AuditLogEndpoint.java on lines 53..58
src/main/java/at/or/joestr/acronisfss/api/endpoints/DeviceEndpoint.java on lines 124..129
src/main/java/at/or/joestr/acronisfss/api/endpoints/DeviceEndpoint.java on lines 208..213
src/main/java/at/or/joestr/acronisfss/api/endpoints/SyncAndShareNodesEndpoint.java on lines 78..83

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

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

    HttpRequest req = HttpRequest.newBuilder()
      .uri(new URI(authUri.toString() + ENDPOINT_PATH))
      .header(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_FORM_URLENCODED.getMimeType())
      .header(HttpHeaders.ACCEPT, ContentType.APPLICATION_JSON.getMimeType())
src/main/java/at/or/joestr/acronisfss/api/endpoints/AuthorizationEndpoint.java on lines 46..49

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

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

    HttpRequest req = HttpRequest.newBuilder()
      .DELETE()
      .uri(uri.build())
      .header(HttpHeaders.AUTHORIZATION, "Bearer " + bearerToken)
      .header(HttpHeaders.ACCEPT, "application/json")
src/main/java/at/or/joestr/acronisfss/api/endpoints/AuditLogEndpoint.java on lines 53..58
src/main/java/at/or/joestr/acronisfss/api/endpoints/DeviceEndpoint.java on lines 57..62
src/main/java/at/or/joestr/acronisfss/api/endpoints/DeviceEndpoint.java on lines 124..129
src/main/java/at/or/joestr/acronisfss/api/endpoints/SyncAndShareNodesEndpoint.java on lines 78..83

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

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

    if (CustomUtil.contains(response.statusCode(), 403)) {
      ErrorResponse errorResponse = new Gson().fromJson(response.body(), ErrorResponse.class);
      error = errorResponse.getError();
    }
src/main/java/at/or/joestr/acronisfss/api/endpoints/AuditLogEndpoint.java on lines 67..70
src/main/java/at/or/joestr/acronisfss/api/endpoints/DeviceEndpoint.java on lines 71..74
src/main/java/at/or/joestr/acronisfss/api/endpoints/DeviceEndpoint.java on lines 194..197

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

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

      if (jsonLogEntryObject.has("owner_uuid") && !jsonLogEntryObject.get("owner_uuid").isJsonNull()) {
        resultEntry.setOwnerUuid(
          UUID.fromString(jsonLogEntryObject.get("owner_uuid").getAsString())
        );
      }
src/main/java/at/or/joestr/acronisfss/api/endpoints/AuditLogEndpoint.java on lines 94..98
src/main/java/at/or/joestr/acronisfss/api/endpoints/AuditLogEndpoint.java on lines 100..104

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

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

    if (CustomUtil.contains(response.statusCode(), 403)) {
      ErrorResponse errorResponse = new Gson().fromJson(response.body(), ErrorResponse.class);
      error = errorResponse.getError();
    }
src/main/java/at/or/joestr/acronisfss/api/endpoints/DeviceEndpoint.java on lines 71..74
src/main/java/at/or/joestr/acronisfss/api/endpoints/DeviceEndpoint.java on lines 194..197
src/main/java/at/or/joestr/acronisfss/api/endpoints/SyncAndShareNodesEndpoint.java on lines 92..95

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

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

    if (CustomUtil.contains(response.statusCode(), 403)) {
      ErrorResponse errorResponse = new Gson().fromJson(response.body(), ErrorResponse.class);
      error = errorResponse.getError();
    }
src/main/java/at/or/joestr/acronisfss/api/endpoints/AuditLogEndpoint.java on lines 67..70
src/main/java/at/or/joestr/acronisfss/api/endpoints/DeviceEndpoint.java on lines 194..197
src/main/java/at/or/joestr/acronisfss/api/endpoints/SyncAndShareNodesEndpoint.java on lines 92..95

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

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

    if (CustomUtil.contains(response.statusCode(), 404)) {
      ErrorResponse errorResponse = new Gson().fromJson(response.body(), ErrorResponse.class);
      error = errorResponse.getError();
    }
src/main/java/at/or/joestr/acronisfss/api/endpoints/AuditLogEndpoint.java on lines 67..70
src/main/java/at/or/joestr/acronisfss/api/endpoints/DeviceEndpoint.java on lines 71..74
src/main/java/at/or/joestr/acronisfss/api/endpoints/SyncAndShareNodesEndpoint.java on lines 92..95

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

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

    HttpRequest req = HttpRequest.newBuilder()
      .DELETE()
      .uri(uri.build())
      .header(HttpHeaders.AUTHORIZATION, "Bearer " + bearerToken)
      .header(HttpHeaders.ACCEPT, "application/json")
src/main/java/at/or/joestr/acronisfss/api/endpoints/AuditLogEndpoint.java on lines 53..58
src/main/java/at/or/joestr/acronisfss/api/endpoints/DeviceEndpoint.java on lines 57..62
src/main/java/at/or/joestr/acronisfss/api/endpoints/DeviceEndpoint.java on lines 124..129
src/main/java/at/or/joestr/acronisfss/api/endpoints/DeviceEndpoint.java on lines 208..213

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

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

    HttpRequest req = HttpRequest.newBuilder()
      .GET()
      .uri(uri.build())
      .header(HttpHeaders.AUTHORIZATION, "Bearer " + bearerToken)
      .header(HttpHeaders.ACCEPT, "application/json")
src/main/java/at/or/joestr/acronisfss/api/endpoints/AuditLogEndpoint.java on lines 53..58
src/main/java/at/or/joestr/acronisfss/api/endpoints/DeviceEndpoint.java on lines 57..62
src/main/java/at/or/joestr/acronisfss/api/endpoints/DeviceEndpoint.java on lines 208..213
src/main/java/at/or/joestr/acronisfss/api/endpoints/SyncAndShareNodesEndpoint.java on lines 78..83

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

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

      if (jsonLogEntryObject.has("share_uuid") && !jsonLogEntryObject.get("share_uuid").isJsonNull()) {
        resultEntry.setShareUuid(
          UUID.fromString(jsonLogEntryObject.get("share_uuid").getAsString())
        );
      }
src/main/java/at/or/joestr/acronisfss/api/endpoints/AuditLogEndpoint.java on lines 94..98
src/main/java/at/or/joestr/acronisfss/api/endpoints/AuditLogEndpoint.java on lines 106..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 40.

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