joestrhq/AcronisFSS

View on GitHub

Showing 15 of 48 total issues

Node has 40 methods (exceeds 20 allowed). Consider refactoring.
Open

public abstract class Node {

  @JsonAdapter(value = NodeUuidTypeAdapter.class, nullSafe = false)
  @SerializedName("uuid")
  private UUID uuid;
Severity: Minor
Found in src/main/java/at/or/joestr/acronisfss/api/structures/Node.java - About 5 hrs to fix

    Device has 26 methods (exceeds 20 allowed). Consider refactoring.
    Open

    public class Device {
      private UUID uuid;
      private String appVersion;
      private Filesystem filesystem;
      private LocalDateTime lastContactTime;
    Severity: Minor
    Found in src/main/java/at/or/joestr/acronisfss/api/structures/Device.java - About 3 hrs to fix

      AuditLogEntry has 22 methods (exceeds 20 allowed). Consider refactoring.
      Open

      public class AuditLogEntry {
      
        private UUID uuid;
        private int code;
        private LocalDateTime createdAt;

        Method getAuditLogEntries has 54 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          public static List<AuditLogEntry> getAuditLogEntries(URI apiUri, String bearerToken, AuditLogEntriesListFilter auditLogFilter) throws IOException, InterruptedException, URISyntaxException {
            ArrayList<AuditLogEntry> result = null;
        
            URIBuilder uri
              = new URIBuilder(apiUri.toString() + ENDPOINT_PATH)

          Method getDevices has 50 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            public static List<Device> getDevices(URI apiUri, String bearerToken, DeviceListFilter deviceListFilter) throws URISyntaxException, IOException, InterruptedException {
              ArrayList<Device> result = null;
          
              URIBuilder uri
                = new URIBuilder(apiUri.toString() + ENDPOINT_PATH)

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

              public static Device getDeviceInformation(URI apiUri, String bearerToken, UUID deviceUuid, TenantFilter tenantFilter) throws URISyntaxException, IOException, InterruptedException {
                Device result = null;
            
                URIBuilder uri
                  = new URIBuilder(apiUri.toString() + ENDPOINT_PATH + "/" + deviceUuid.toString())

              Method build has 38 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                public List<NameValuePair> build() {
              
                  ArrayList<NameValuePair> result = new ArrayList<>();
              
                  if (this.filterUser != null) {

                Method getToken has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  public static OAuth2Token getToken(URI authUri, String grantType, String username, String password) throws IOException, InterruptedException, URISyntaxException {
                
                    OAuth2Token result;
                
                    HttpRequest req = HttpRequest.newBuilder()

                  Method getAuditLogEntries has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                  Open

                    public static List<AuditLogEntry> getAuditLogEntries(URI apiUri, String bearerToken, AuditLogEntriesListFilter auditLogFilter) throws IOException, InterruptedException, URISyntaxException {
                      ArrayList<AuditLogEntry> result = null;
                  
                      URIBuilder uri
                        = new URIBuilder(apiUri.toString() + ENDPOINT_PATH)

                  Cognitive Complexity

                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                  A method's cognitive complexity is based on a few simple rules:

                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                  • Code is considered more complex for each "break in the linear flow of the code"
                  • Code is considered more complex when "flow breaking structures are nested"

                  Further reading

                  Method getToken has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    public static OAuth2Token getToken(URI authUri, String grantType, OAuth2Token token) throws IOException, InterruptedException, URISyntaxException {
                  
                      OAuth2Token result;
                  
                      HttpRequest req = HttpRequest.newBuilder()

                    Method createFolder has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      public static FolderNode createFolder(URI apiUri, String bearerToken, SyncAndShareNode node) throws URISyntaxException, IOException, InterruptedException {
                        FolderNode result;
                    
                        URIBuilder uri
                          = new URIBuilder(apiUri.toString() + ENDPOINT_PATH);

                      Method build has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                      Open

                        public List<NameValuePair> build() {
                      
                          ArrayList<NameValuePair> result = new ArrayList<>();
                      
                          if (this.filterUser != null) {

                      Cognitive Complexity

                      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                      A method's cognitive complexity is based on a few simple rules:

                      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                      • Code is considered more complex for each "break in the linear flow of the code"
                      • Code is considered more complex when "flow breaking structures are nested"

                      Further reading

                      Method getDevices has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                      Open

                        public static List<Device> getDevices(URI apiUri, String bearerToken, DeviceListFilter deviceListFilter) throws URISyntaxException, IOException, InterruptedException {
                          ArrayList<Device> result = null;
                      
                          URIBuilder uri
                            = new URIBuilder(apiUri.toString() + ENDPOINT_PATH)
                      Severity: Minor
                      Found in src/main/java/at/or/joestr/acronisfss/api/endpoints/DeviceEndpoint.java - About 55 mins to fix

                      Cognitive Complexity

                      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                      A method's cognitive complexity is based on a few simple rules:

                      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                      • Code is considered more complex for each "break in the linear flow of the code"
                      • Code is considered more complex when "flow breaking structures are nested"

                      Further reading

                      Method read has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                      Open

                        @Override
                        public UUID read(JsonReader in) throws IOException {
                          JsonToken token = in.peek();
                          
                          if (null == token) {

                      Cognitive Complexity

                      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                      A method's cognitive complexity is based on a few simple rules:

                      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                      • Code is considered more complex for each "break in the linear flow of the code"
                      • Code is considered more complex when "flow breaking structures are nested"

                      Further reading

                      Method getDeviceInformation has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                      Open

                        public static Device getDeviceInformation(URI apiUri, String bearerToken, UUID deviceUuid, TenantFilter tenantFilter) throws URISyntaxException, IOException, InterruptedException {
                          Device result = null;
                      
                          URIBuilder uri
                            = new URIBuilder(apiUri.toString() + ENDPOINT_PATH + "/" + deviceUuid.toString())
                      Severity: Minor
                      Found in src/main/java/at/or/joestr/acronisfss/api/endpoints/DeviceEndpoint.java - About 25 mins to fix

                      Cognitive Complexity

                      Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                      A method's cognitive complexity is based on a few simple rules:

                      • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                      • Code is considered more complex for each "break in the linear flow of the code"
                      • Code is considered more complex when "flow breaking structures are nested"

                      Further reading

                      Severity
                      Category
                      Status
                      Source
                      Language