IBM/scc-java-sdk

View on GitHub

Showing 39 of 183 total issues

Method main has 908 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  @SuppressWarnings("checkstyle:methodlength")
  public static void main(String[] args) throws Exception {
    SecurityAndComplianceCenterApi securityAndComplianceCenterApiService = SecurityAndComplianceCenterApi.newInstance();

    // Load up our test-specific config properties.

    File SecurityAndComplianceCenterApi.java has 1377 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /*
     * (C) Copyright IBM Corp. 2023.
     *
     * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
     * the License. You may obtain a copy of the License at

      File SecurityAndComplianceCenterApiExamples.java has 1028 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /*
       * (C) Copyright IBM Corp. 2023.
       *
       * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
       * the License. You may obtain a copy of the License at

        SecurityAndComplianceCenterApi has 59 methods (exceeds 20 allowed). Consider refactoring.
        Open

        public class SecurityAndComplianceCenterApi extends BaseService {
        
          /**
           * Default service name used when configuring the `SecurityAndComplianceCenterApi` client.
           */

          Method main has a Cognitive Complexity of 51 (exceeds 5 allowed). Consider refactoring.
          Open

            @SuppressWarnings("checkstyle:methodlength")
            public static void main(String[] args) throws Exception {
              SecurityAndComplianceCenterApi securityAndComplianceCenterApiService = SecurityAndComplianceCenterApi.newInstance();
          
              // Load up our test-specific config properties.

          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

          File ReplaceProfileAttachmentOptions.java has 297 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          /*
           * (C) Copyright IBM Corp. 2023.
           *
           * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
           * the License. You may obtain a copy of the License at

            Method replaceProfileAttachment has 73 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              public ServiceCall<AttachmentItem> replaceProfileAttachment(ReplaceProfileAttachmentOptions replaceProfileAttachmentOptions) {
                com.ibm.cloud.sdk.core.util.Validator.notNull(replaceProfileAttachmentOptions,
                  "replaceProfileAttachmentOptions cannot be null");
                Map<String, String> pathParamsMap = new HashMap<String, String>();
                pathParamsMap.put("attachment_id", replaceProfileAttachmentOptions.attachmentId());

              Method replaceCustomControlLibrary has 69 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                public ServiceCall<ControlLibrary> replaceCustomControlLibrary(ReplaceCustomControlLibraryOptions replaceCustomControlLibraryOptions) {
                  com.ibm.cloud.sdk.core.util.Validator.notNull(replaceCustomControlLibraryOptions,
                    "replaceCustomControlLibraryOptions cannot be null");
                  Map<String, String> pathParamsMap = new HashMap<String, String>();
                  pathParamsMap.put("control_libraries_id", replaceCustomControlLibraryOptions.controlLibrariesId());

                Method replaceProfileAttachment has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
                Open

                  public ServiceCall<AttachmentItem> replaceProfileAttachment(ReplaceProfileAttachmentOptions replaceProfileAttachmentOptions) {
                    com.ibm.cloud.sdk.core.util.Validator.notNull(replaceProfileAttachmentOptions,
                      "replaceProfileAttachmentOptions cannot be null");
                    Map<String, String> pathParamsMap = new HashMap<String, String>();
                    pathParamsMap.put("attachment_id", replaceProfileAttachmentOptions.attachmentId());

                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

                Builder has 24 methods (exceeds 20 allowed). Consider refactoring.
                Open

                  public static class Builder {
                    private String attachmentId;
                    private String profileId;
                    private String id;
                    private String accountId;

                  Method replaceCustomControlLibrary has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
                  Open

                    public ServiceCall<ControlLibrary> replaceCustomControlLibrary(ReplaceCustomControlLibraryOptions replaceCustomControlLibraryOptions) {
                      com.ibm.cloud.sdk.core.util.Validator.notNull(replaceCustomControlLibraryOptions,
                        "replaceCustomControlLibraryOptions cannot be null");
                      Map<String, String> pathParamsMap = new HashMap<String, String>();
                      pathParamsMap.put("control_libraries_id", replaceCustomControlLibraryOptions.controlLibrariesId());

                  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

                  File ReplaceCustomControlLibraryOptions.java has 268 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  /*
                   * (C) Copyright IBM Corp. 2023.
                   *
                   * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
                   * the License. You may obtain a copy of the License at

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

                      public static class Builder {
                        private String controlLibrariesId;
                        private String id;
                        private String accountId;
                        private String controlLibraryName;

                      ReplaceProfileAttachmentOptions has 21 methods (exceeds 20 allowed). Consider refactoring.
                      Open

                      public class ReplaceProfileAttachmentOptions extends GenericModel {
                      
                        /**
                         * The status of an attachment evaluation.
                         */

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

                          public ServiceCall<EvaluationPage> listReportEvaluations(ListReportEvaluationsOptions listReportEvaluationsOptions) {
                            com.ibm.cloud.sdk.core.util.Validator.notNull(listReportEvaluationsOptions,
                              "listReportEvaluationsOptions cannot be null");
                            Map<String, String> pathParamsMap = new HashMap<String, String>();
                            pathParamsMap.put("report_id", listReportEvaluationsOptions.reportId());

                          Method listReportResources has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            public ServiceCall<ResourcePage> listReportResources(ListReportResourcesOptions listReportResourcesOptions) {
                              com.ibm.cloud.sdk.core.util.Validator.notNull(listReportResourcesOptions,
                                "listReportResourcesOptions cannot be null");
                              Map<String, String> pathParamsMap = new HashMap<String, String>();
                              pathParamsMap.put("report_id", listReportResourcesOptions.reportId());

                            Method listReports has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              public ServiceCall<ReportPage> listReports(ListReportsOptions listReportsOptions) {
                                if (listReportsOptions == null) {
                                  listReportsOptions = new ListReportsOptions.Builder().build();
                                }
                                RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/reports"));

                              Method getReportControls has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                public ServiceCall<ReportControls> getReportControls(GetReportControlsOptions getReportControlsOptions) {
                                  com.ibm.cloud.sdk.core.util.Validator.notNull(getReportControlsOptions,
                                    "getReportControlsOptions cannot be null");
                                  Map<String, String> pathParamsMap = new HashMap<String, String>();
                                  pathParamsMap.put("report_id", getReportControlsOptions.reportId());

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

                                  public ServiceCall<EvaluationPage> listReportEvaluations(ListReportEvaluationsOptions listReportEvaluationsOptions) {
                                    com.ibm.cloud.sdk.core.util.Validator.notNull(listReportEvaluationsOptions,
                                      "listReportEvaluationsOptions cannot be null");
                                    Map<String, String> pathParamsMap = new HashMap<String, String>();
                                    pathParamsMap.put("report_id", listReportEvaluationsOptions.reportId());

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

                                  public ServiceCall<ControlLibrary> createCustomControlLibrary(CreateCustomControlLibraryOptions createCustomControlLibraryOptions) {
                                    com.ibm.cloud.sdk.core.util.Validator.notNull(createCustomControlLibraryOptions,
                                      "createCustomControlLibraryOptions cannot be null");
                                    RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/control_libraries"));
                                    Map<String, String> sdkHeaders = SdkCommon.getSdkHeaders("security_and_compliance_center_api", "v3", "createCustomControlLibrary");
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language