Skip to content

SONARJAVA-5698 Report Eclipse parser type errors#5261

Merged
alban-auzeill merged 2 commits intomasterfrom
alban/SONARJAVA-5698
Jul 17, 2025
Merged

SONARJAVA-5698 Report Eclipse parser type errors#5261
alban-auzeill merged 2 commits intomasterfrom
alban/SONARJAVA-5698

Conversation

@alban-auzeill
Copy link
Copy Markdown
Member

@alban-auzeill alban-auzeill commented Jul 16, 2025

JAVA_IS_AUTOSCAN("java.is_autoscan"),
JAVA_ANALYSIS_MAIN_SUCCESS_SIZE_CHARS("java.analysis.main.success.size_chars"),
JAVA_ANALYSIS_MAIN_SUCCESS_TIME_MS("java.analysis.main.success.time_ms"),
JAVA_ANALYSIS_MAIN_SUCCESS_TYPE_ERROR_COUNT("java.analysis.main.success.type_error_count"),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Lets change TelemetryKeyTest so that it makes sure all java.analysis keys are tested. This would involve extracting the lists in testCompoundKeys and validating and the product of their lengths is equal to the number of java.analysis keys.

}

public record JavaAnalysisKeys(SpeedKeys success, SpeedKeys parseErrors, SpeedKeys exceptions) {
public record SizeAndTimeKeys(TelemetryKey sizeCharsKey, TelemetryKey timeMsKey) implements SpeedKeys {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I prefer {} on the same line here and below.

public record SizeAndTimeKeys(TelemetryKey sizeCharsKey, TelemetryKey timeMsKey) implements SpeedKeys {
}

public record SizeTimeAndTypeErrorKeys(TelemetryKey sizeCharsKey, TelemetryKey timeMsKey, TelemetryKey typeErrorCountKey) implements SpeedKeys {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please fix spacing before implements

new SpeedKeys(JAVA_ANALYSIS_MAIN_SUCCESS_SIZE_CHARS, JAVA_ANALYSIS_MAIN_SUCCESS_TIME_MS),
new SpeedKeys(JAVA_ANALYSIS_MAIN_PARSE_ERRORS_SIZE_CHARS, JAVA_ANALYSIS_MAIN_PARSE_ERRORS_TIME_MS),
new SpeedKeys(JAVA_ANALYSIS_MAIN_EXCEPTIONS_SIZE_CHARS, JAVA_ANALYSIS_MAIN_EXCEPTIONS_TIME_MS));
new SizeTimeAndTypeErrorKeys(JAVA_ANALYSIS_MAIN_SUCCESS_SIZE_CHARS, JAVA_ANALYSIS_MAIN_SUCCESS_TIME_MS,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Let's update the unit test for these data structures.

assertThat(telemetryMap).containsEntry("java.analysis.test.success.type_error_count", "199");
}

private static int lineNumberOfTheMethodWithNoSonar(FileSystem fs) throws IOException {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you for fixing this!

To avoid problems caused by refactoring. let's add the following comment on the test test_issues_creation_on_test_file:

// Renaming this test will break stuff. The name is used to locate the line number.

@sonarqube-next
Copy link
Copy Markdown

@alban-auzeill alban-auzeill merged commit f684952 into master Jul 17, 2025
16 of 17 checks passed
@alban-auzeill alban-auzeill deleted the alban/SONARJAVA-5698 branch July 17, 2025 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants