Skip to content

Analyze the Java code CodeQL sees compiled - #9

Merged
abashev merged 1 commit into
mainfrom
codeql-manual-build
Sep 26, 2026
Merged

abashev merged 1 commit into
mainfrom
codeql-manual-build

Conversation

@abashev

@abashev abashev commented Sep 26, 2026

Copy link
Copy Markdown

The CodeQL run on main scanned 23 of 73 Java files. With build-mode: none CodeQL scans every Java
file in the checkout, and 54 of them are the test projects in src/test/resources: formatter inputs
that declare the same classes over and over (HelloWorld1 alone 26 times). The build step copied them
once more into target/test-classes. CodeQL keeps one file per fully-qualified class name, and the log
said so: "104 files defined a class that clashes with the fully-qualified name of another scanned
class".

  • Java now uses build-mode: manual: CodeQL analyzes what the existing mvn clean test-compile step
    compiles, which is the plugin's 16 main sources, the generated HelpMojo and the 3 test classes. The
    test projects are only copied as resources, so none of them reaches the scan.
  • The build step runs only for that leg; the actions leg keeps build-mode: none and needs no Maven.

The analysis log of this pull request's run says how many files were scanned ("CodeQL scanned N out of
M Java files"); the status page follows once it runs on main.

With build-mode none CodeQL scans every Java file in the checkout, and
this repository keeps 54 of them in src/test/resources: the test
projects the formatter runs on, which declare the same classes over and
over (HelloWorld1 alone 26 times). The build step copied them once more
into target/test-classes. CodeQL keeps one file per fully-qualified
class name, so the main branch reported 104 clashing files filtered out
and 23 of 73 Java files scanned.

Java now uses build-mode manual: CodeQL analyzes what the existing
`mvn clean test-compile` step compiles, which is the plugin's main and
test sources and the generated HelpMojo. The test projects are copied as
resources and never compiled, so none of them reaches the scan. The
build step runs only for that leg; the actions leg keeps build-mode none
and needs no Maven.
@abashev
abashev merged commit b934a7e into main Sep 26, 2026
8 checks passed
@abashev
abashev deleted the codeql-manual-build branch September 26, 2026 13:30
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.

1 participant