Skip to content
Open

test #1842

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ public final class Messages {
public static final String ON_START_FILES_CLEANER_WITHOUT_CONTENT_ENABLED_0 = "On start files cleaner without content enabled: {0}";
public static final String THREADS_FOR_FILE_UPLOAD_TO_CONTROLLER_0 = "Threads for file upload to controller: {0}";
public static final String THREADS_FOR_FILE_STORAGE_UPLOAD_0 = "Threads for file storage upload: {0}";
public static final String DELETED_ORPHANED_MTA_DESCRIPTORS_COUNT = "Deleted orphaned mta descriptors count: {0}";
public static final String DELETED_ORPHANED_MTA_DESCRIPTORS_COUNT = "Deleted descriptors count: {0}";
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Severity: IMPORTANT · Confidence: 85

The log message change drops the word "orphaned" from the descriptor count message, making it less specific. The constant name DELETED_ORPHANED_MTA_DESCRIPTORS_COUNT still references "orphaned" but the message text no longer does, creating a misleading mismatch. Operators correlating log output with code will find the constant name and message inconsistent.

Evidence: public static final String DELETED_ORPHANED_MTA_DESCRIPTORS_COUNT = "Deleted descriptors count: {0}";

Fix:

Suggested change
public static final String DELETED_ORPHANED_MTA_DESCRIPTORS_COUNT = "Deleted descriptors count: {0}";
public static final String DELETED_ORPHANED_MTA_DESCRIPTORS_COUNT = "Deleted orphaned descriptors count: {0}";

public static final String IS_HEALTH_CHECK_ENABLED = "Is health check enabled: {0}";

// Debug messages
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
private static final int NUMBER_OF_DAYS_OF_EVENTS = 1;
private static final Logger LOGGER = LoggerFactory.getLogger(DataTerminationService.class);
private static final SafeExecutor SAFE_EXECUTOR = new SafeExecutor(DataTerminationService::log);
private final String TEST = "test";

Check warning on line 42 in multiapps-controller-core/src/main/java/org/cloudfoundry/multiapps/controller/core/security/data/termination/DataTerminationService.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Remove this unused "TEST" private field.

See more on https://sonarcloud.io/project/issues?id=cloudfoundry_multiapps-controller&issues=AZ5KgkfZvJUpS2h4e4iR&open=AZ5KgkfZvJUpS2h4e4iR&pullRequest=1842

Check warning on line 42 in multiapps-controller-core/src/main/java/org/cloudfoundry/multiapps/controller/core/security/data/termination/DataTerminationService.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Rename this field "TEST" to match the regular expression '^[a-z][a-zA-Z0-9]*$'.

See more on https://sonarcloud.io/project/issues?id=cloudfoundry_multiapps-controller&issues=AZ5KgkfZvJUpS2h4e4iP&open=AZ5KgkfZvJUpS2h4e4iP&pullRequest=1842

Check warning on line 42 in multiapps-controller-core/src/main/java/org/cloudfoundry/multiapps/controller/core/security/data/termination/DataTerminationService.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Make this final field static too.

See more on https://sonarcloud.io/project/issues?id=cloudfoundry_multiapps-controller&issues=AZ5KgkfZvJUpS2h4e4iQ&open=AZ5KgkfZvJUpS2h4e4iQ&pullRequest=1842
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Severity: CRITICAL · Confidence: 98

Accidental debug/test field committed to production code. This private final String TEST = "test" field is unused dead code that appears to be a debug artifact. It serves no functional purpose, violates Java naming conventions for non-static fields (ALL_CAPS is for static constants), and will fail the Sonar quality gate.

Evidence: private final String TEST = "test";

Fix:

Suggested change
private final String TEST = "test";

(Remove this line entirely before merging.)

// Required by CF API:
// https://v3-apidocs.cloudfoundry.org/version/3.128.0/index.html#timestamps
private static final DateTimeFormatter DATE_TIME_FORMATTER = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss'Z'");
Expand Down
Loading