IBM/scc-java-sdk

View on GitHub

Showing 183 of 183 total issues

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

  protected MultiCloudScope(Builder builder) {
    com.ibm.cloud.sdk.core.util.Validator.notNull(builder.environment,
      "environment cannot be null");
    com.ibm.cloud.sdk.core.util.Validator.notNull(builder.xProperties,
      "xProperties cannot be null");
modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AttachmentsNotificationsPrototype.java on lines 93..100

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

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 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());

    Similar blocks of code found in 2 locations. 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
    modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ProfileCollection.java on lines 1..89

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

    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

    /*
     * (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
    modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AttachmentCollection.java on lines 1..89

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

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

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

        public Builder(String ruleId, String ifMatch, String description, TargetPrototype target, RequiredConfig requiredConfig) {
          this.ruleId = ruleId;
          this.ifMatch = ifMatch;
          this.description = description;
          this.target = target;
    modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AttachmentsPrototype.java on lines 102..108
    modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/CreateProfileOptions.java on lines 85..91

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

    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

        public Builder(String name, List<MultiCloudScope> scope, String status, String schedule, List<AttachmentParameterPrototype> attachmentParameters) {
          this.name = name;
          this.scope = scope;
          this.status = status;
          this.schedule = schedule;
    modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/CreateProfileOptions.java on lines 85..91
    modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReplaceRuleOptions.java on lines 84..90

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

    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

        public Builder(String profileName, String profileDescription, String profileType, List<ProfileControlsPrototype> controls, List<DefaultParametersPrototype> defaultParameters) {
          this.profileName = profileName;
          this.profileDescription = profileDescription;
          this.profileType = profileType;
          this.controls = controls;
    modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/AttachmentsPrototype.java on lines 102..108
    modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ReplaceRuleOptions.java on lines 84..90

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

    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

          ControlsInControlLib controlsInControlLibModel = new ControlsInControlLib.Builder()
            .controlName("SC-7")
            .controlId("1fa45e17-9322-4e6c-bbd6-1c51db08e790")
            .controlDescription("Boundary Protection")
            .controlCategory("System and Communications Protection")
    examples/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/SecurityAndComplianceCenterApiExamples.java on lines 652..661

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

    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

          ControlsInControlLib controlsInControlLibModel = new ControlsInControlLib.Builder()
            .controlName("SC-7")
            .controlId("1fa45e17-9322-4e6c-bbd6-1c51db08e790")
            .controlDescription("Boundary Protection")
            .controlCategory("System and Communications Protection")
    examples/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/SecurityAndComplianceCenterApiExamples.java on lines 752..761

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

    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

      protected UpdateSettingsOptions(Builder builder) {
        eventNotifications = builder.eventNotifications;
        objectStorage = builder.objectStorage;
        xCorrelationId = builder.xCorrelationId;
        xRequestId = builder.xRequestId;
    modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListAttachmentsAccountOptions.java on lines 110..115
    modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/Parameter.java on lines 132..137
    modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ParameterInfo.java on lines 135..140

    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

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

      protected ListAttachmentsAccountOptions(Builder builder) {
        xCorrelationId = builder.xCorrelationId;
        xRequestId = builder.xRequestId;
        limit = builder.limit;
        start = builder.start;
    modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/Parameter.java on lines 132..137
    modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ParameterInfo.java on lines 135..140
    modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/UpdateSettingsOptions.java on lines 122..127

    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

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

      protected ParameterInfo(Builder builder) {
        parameterName = builder.parameterName;
        parameterDisplayName = builder.parameterDisplayName;
        parameterType = builder.parameterType;
        parameterValue = builder.parameterValue;
    modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListAttachmentsAccountOptions.java on lines 110..115
    modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/Parameter.java on lines 132..137
    modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/UpdateSettingsOptions.java on lines 122..127

    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

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

      protected Parameter(Builder builder) {
        name = builder.name;
        displayName = builder.displayName;
        description = builder.description;
        type = builder.type;
    modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ListAttachmentsAccountOptions.java on lines 110..115
    modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/ParameterInfo.java on lines 135..140
    modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/model/UpdateSettingsOptions.java on lines 122..127

    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

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

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

        if (replaceCustomControlLibraryOptions.controls() != null) {
          contentJson.add("controls", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(replaceCustomControlLibraryOptions.controls()));
        }
    modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/SecurityAndComplianceCenterApi.java on lines 257..259
    modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/SecurityAndComplianceCenterApi.java on lines 260..262
    modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/SecurityAndComplianceCenterApi.java on lines 572..574
    modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/SecurityAndComplianceCenterApi.java on lines 578..580
    modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/SecurityAndComplianceCenterApi.java on lines 880..882
    modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/SecurityAndComplianceCenterApi.java on lines 883..885
    modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/SecurityAndComplianceCenterApi.java on lines 987..989
    modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/SecurityAndComplianceCenterApi.java on lines 990..992
    modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/SecurityAndComplianceCenterApi.java on lines 1183..1185
    modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/SecurityAndComplianceCenterApi.java on lines 1186..1188
    modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/SecurityAndComplianceCenterApi.java on lines 1192..1194
    modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/SecurityAndComplianceCenterApi.java on lines 1204..1206
    modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/SecurityAndComplianceCenterApi.java on lines 1207..1209
    modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/SecurityAndComplianceCenterApi.java on lines 1210..1212
    modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/SecurityAndComplianceCenterApi.java on lines 1213..1215

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

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

        if (replaceProfileAttachmentOptions.attachmentParameters() != null) {
          contentJson.add("attachment_parameters", com.ibm.cloud.sdk.core.util.GsonSingleton.getGson().toJsonTree(replaceProfileAttachmentOptions.attachmentParameters()));
        }
    modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/SecurityAndComplianceCenterApi.java on lines 257..259
    modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/SecurityAndComplianceCenterApi.java on lines 260..262
    modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/SecurityAndComplianceCenterApi.java on lines 572..574
    modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/SecurityAndComplianceCenterApi.java on lines 578..580
    modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/SecurityAndComplianceCenterApi.java on lines 596..598
    modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/SecurityAndComplianceCenterApi.java on lines 880..882
    modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/SecurityAndComplianceCenterApi.java on lines 883..885
    modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/SecurityAndComplianceCenterApi.java on lines 987..989
    modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/SecurityAndComplianceCenterApi.java on lines 990..992
    modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/SecurityAndComplianceCenterApi.java on lines 1183..1185
    modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/SecurityAndComplianceCenterApi.java on lines 1186..1188
    modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/SecurityAndComplianceCenterApi.java on lines 1192..1194
    modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/SecurityAndComplianceCenterApi.java on lines 1204..1206
    modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/SecurityAndComplianceCenterApi.java on lines 1210..1212
    modules/security-and-compliance-center-api/src/main/java/com/ibm/cloud/security_and_compliance_center_api/v3/SecurityAndComplianceCenterApi.java on lines 1213..1215

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

    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