CMSgov/dpc-app

View on GitHub
dpc-api/src/main/java/gov/cms/dpc/api/cli/organizations/OrganizationRegistration.java

Summary

Maintainability
A
0 mins
Test Coverage
F
35%

Method registerOrganization has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Wontfix

    private void registerOrganization(Bundle organization, String attributionService, boolean noToken, String apiService) throws IOException, URISyntaxException {
        System.out.println(String.format("Connecting to Attribution service at: %s", attributionService));
        final IGenericClient client = ctx.newRestfulGenericClient(attributionService);

        final Parameters parameters = new Parameters();

    Replace this use of System.out or System.err by a logger.
    Open

                        System.out.println(String.format("Organization token: %s", token));

    When logging a message there are several important requirements which must be fulfilled:

    • The user must be able to easily retrieve the logs
    • The format of all logged message must be uniform to allow the user to easily read the log
    • Logged data must actually be recorded
    • Sensitive data must only be logged securely

    If a program directly writes to the standard outputs, there is absolutely no way to comply with those requirements. That's why defining and using a dedicated logger is highly recommended.

    Noncompliant Code Example

    System.out.println("My Message");  // Noncompliant
    

    Compliant Solution

    logger.log("My Message");
    

    See

    Replace this use of System.out or System.err by a logger.
    Open

                System.err.println(String.format("Unable to register organization. %s", e.getMessage()));

    When logging a message there are several important requirements which must be fulfilled:

    • The user must be able to easily retrieve the logs
    • The format of all logged message must be uniform to allow the user to easily read the log
    • Logged data must actually be recorded
    • Sensitive data must only be logged securely

    If a program directly writes to the standard outputs, there is absolutely no way to comply with those requirements. That's why defining and using a dedicated logger is highly recommended.

    Noncompliant Code Example

    System.out.println("My Message");  // Noncompliant
    

    Compliant Solution

    logger.log("My Message");
    

    See

    Replace this use of System.out or System.err by a logger.
    Open

            System.out.println(String.format("Connecting to Attribution service at: %s", attributionService));

    When logging a message there are several important requirements which must be fulfilled:

    • The user must be able to easily retrieve the logs
    • The format of all logged message must be uniform to allow the user to easily read the log
    • Logged data must actually be recorded
    • Sensitive data must only be logged securely

    If a program directly writes to the standard outputs, there is absolutely no way to comply with those requirements. That's why defining and using a dedicated logger is highly recommended.

    Noncompliant Code Example

    System.out.println("My Message");  // Noncompliant
    

    Compliant Solution

    logger.log("My Message");
    

    See

    Replace this use of System.out or System.err by a logger.
    Open

                System.out.println(String.format("Connecting to API service at: %s", apiService));

    When logging a message there are several important requirements which must be fulfilled:

    • The user must be able to easily retrieve the logs
    • The format of all logged message must be uniform to allow the user to easily read the log
    • Logged data must actually be recorded
    • Sensitive data must only be logged securely

    If a program directly writes to the standard outputs, there is absolutely no way to comply with those requirements. That's why defining and using a dedicated logger is highly recommended.

    Noncompliant Code Example

    System.out.println("My Message");  // Noncompliant
    

    Compliant Solution

    logger.log("My Message");
    

    See

    Replace this use of System.out or System.err by a logger.
    Open

            System.out.println("Registering Organization");

    When logging a message there are several important requirements which must be fulfilled:

    • The user must be able to easily retrieve the logs
    • The format of all logged message must be uniform to allow the user to easily read the log
    • Logged data must actually be recorded
    • Sensitive data must only be logged securely

    If a program directly writes to the standard outputs, there is absolutely no way to comply with those requirements. That's why defining and using a dedicated logger is highly recommended.

    Noncompliant Code Example

    System.out.println("My Message");  // Noncompliant
    

    Compliant Solution

    logger.log("My Message");
    

    See

    Replace this use of System.out or System.err by a logger.
    Open

                System.out.println(String.format("Registered organization: %s", organizationID));

    When logging a message there are several important requirements which must be fulfilled:

    • The user must be able to easily retrieve the logs
    • The format of all logged message must be uniform to allow the user to easily read the log
    • Logged data must actually be recorded
    • Sensitive data must only be logged securely

    If a program directly writes to the standard outputs, there is absolutely no way to comply with those requirements. That's why defining and using a dedicated logger is highly recommended.

    Noncompliant Code Example

    System.out.println("My Message");  // Noncompliant
    

    Compliant Solution

    logger.log("My Message");
    

    See

    There are no issues that match your filters.

    Category
    Status