IBM/scc-java-sdk

View on GitHub

Showing 39 of 183 total issues

Method replaceRule has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  public ServiceCall<Rule> replaceRule(ReplaceRuleOptions replaceRuleOptions) {
    com.ibm.cloud.sdk.core.util.Validator.notNull(replaceRuleOptions,
      "replaceRuleOptions cannot be null");
    Map<String, String> pathParamsMap = new HashMap<String, String>();
    pathParamsMap.put("rule_id", replaceRuleOptions.ruleId());

    Method listReports has a Cognitive Complexity of 11 (exceeds 5 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"));

    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 listReportResources has a Cognitive Complexity of 11 (exceeds 5 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());

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

      public ServiceCall<Rule> createRule(CreateRuleOptions createRuleOptions) {
        com.ibm.cloud.sdk.core.util.Validator.notNull(createRuleOptions,
          "createRuleOptions cannot be null");
        RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/rules"));
        Map<String, String> sdkHeaders = SdkCommon.getSdkHeaders("security_and_compliance_center_api", "v3", "createRule");

      Method listProfiles has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        public ServiceCall<ProfileCollection> listProfiles(ListProfilesOptions listProfilesOptions) {
          if (listProfilesOptions == null) {
            listProfilesOptions = new ListProfilesOptions.Builder().build();
          }
          RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/profiles"));

        Method listRules has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          public ServiceCall<RulesPageBase> listRules(ListRulesOptions listRulesOptions) {
            if (listRulesOptions == null) {
              listRulesOptions = new ListRulesOptions.Builder().build();
            }
            RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/rules"));

          Method listControlLibraries has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            public ServiceCall<ControlLibraryCollection> listControlLibraries(ListControlLibrariesOptions listControlLibrariesOptions) {
              if (listControlLibrariesOptions == null) {
                listControlLibrariesOptions = new ListControlLibrariesOptions.Builder().build();
              }
              RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/control_libraries"));

            Method replaceProfile has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              public ServiceCall<Profile> replaceProfile(ReplaceProfileOptions replaceProfileOptions) {
                com.ibm.cloud.sdk.core.util.Validator.notNull(replaceProfileOptions,
                  "replaceProfileOptions cannot be null");
                Map<String, String> pathParamsMap = new HashMap<String, String>();
                pathParamsMap.put("profile_id", replaceProfileOptions.profileId());

              Method getReportControls has a Cognitive Complexity of 9 (exceeds 5 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());

              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 listRules has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                public ServiceCall<RulesPageBase> listRules(ListRulesOptions listRulesOptions) {
                  if (listRulesOptions == null) {
                    listRulesOptions = new ListRulesOptions.Builder().build();
                  }
                  RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/rules"));

              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 listControlLibraries has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                public ServiceCall<ControlLibraryCollection> listControlLibraries(ListControlLibrariesOptions listControlLibrariesOptions) {
                  if (listControlLibrariesOptions == null) {
                    listControlLibrariesOptions = new ListControlLibrariesOptions.Builder().build();
                  }
                  RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/control_libraries"));

              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 a Cognitive Complexity of 7 (exceeds 5 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");

              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 listProfiles has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

                public ServiceCall<ProfileCollection> listProfiles(ListProfilesOptions listProfilesOptions) {
                  if (listProfilesOptions == null) {
                    listProfilesOptions = new ListProfilesOptions.Builder().build();
                  }
                  RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/profiles"));

              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 getNext has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                public List<Resource> getNext() {
                  if (!hasNext()) {
                    throw new NoSuchElementException("No more results available");
                  }
              
              

              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 createRule has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                public ServiceCall<Rule> createRule(CreateRuleOptions createRuleOptions) {
                  com.ibm.cloud.sdk.core.util.Validator.notNull(createRuleOptions,
                    "createRuleOptions cannot be null");
                  RequestBuilder builder = RequestBuilder.post(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/rules"));
                  Map<String, String> sdkHeaders = SdkCommon.getSdkHeaders("security_and_compliance_center_api", "v3", "createRule");

              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 getNext has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                public List<Report> getNext() {
                  if (!hasNext()) {
                    throw new NoSuchElementException("No more results available");
                  }
              
              

              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 listAttachmentsAccount has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                public ServiceCall<AttachmentCollection> listAttachmentsAccount(ListAttachmentsAccountOptions listAttachmentsAccountOptions) {
                  if (listAttachmentsAccountOptions == null) {
                    listAttachmentsAccountOptions = new ListAttachmentsAccountOptions.Builder().build();
                  }
                  RequestBuilder builder = RequestBuilder.get(RequestBuilder.resolveRequestUrl(getServiceUrl(), "/attachments"));

              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 replaceRule has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                public ServiceCall<Rule> replaceRule(ReplaceRuleOptions replaceRuleOptions) {
                  com.ibm.cloud.sdk.core.util.Validator.notNull(replaceRuleOptions,
                    "replaceRuleOptions cannot be null");
                  Map<String, String> pathParamsMap = new HashMap<String, String>();
                  pathParamsMap.put("rule_id", replaceRuleOptions.ruleId());

              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 getNext has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                public List<Evaluation> getNext() {
                  if (!hasNext()) {
                    throw new NoSuchElementException("No more results available");
                  }
              
              

              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