Skip to content

Clean up low-severity CodeQL code-quality alerts#302

Merged
vharseko merged 2 commits into
OpenIdentityPlatform:masterfrom
vharseko:fix/codeql-quality-notes
Jul 24, 2026
Merged

Clean up low-severity CodeQL code-quality alerts#302
vharseko merged 2 commits into
OpenIdentityPlatform:masterfrom
vharseko:fix/codeql-quality-notes

Conversation

@vharseko

@vharseko vharseko commented Jul 23, 2026

Copy link
Copy Markdown
Member

Resolves a batch of CodeQL note-level (code-quality) alerts. No behaviour changes; all touched Java modules compile.

Commit 1 — 17 alerts across 15 files

  • inefficient-empty-string-test (8): use String.isEmpty() instead of "".equals(...)
  • inefficient-string-constructor (2): drop redundant new String(...) wrappers
  • inefficient-key-set-iterator (2): iterate entrySet() instead of keySet() + get()
  • useless-tostring-call (2): remove toString() on values already String
  • local-variable-is-never-read (3): remove dead local assignments

Commit 2 — 7 alerts across 5 files

  • java/local-shadows-field (5): rename local variables that shadowed fields in CsvAuditEventHandler, JsonFileWriter, and WarningHeader
  • java/call-to-object-tostring (1): log VersionedPath.getVersions() instead of the object's default toString() in CrestApiProducer
  • py/unused-import (1): drop the unused import sys, os in the persistit doc conf.py

Not addressed here (deliberate)

  • java/class-name-matches-super-class (2): renaming these public classes would break the API — dismissed as won't-fix
  • java/local-variable-is-never-read (1): BufferPool keeps a 1 MB reserve buffer released on OutOfMemoryError; the "unused" write is intentional — dismissed as won't-fix
  • java/chained-type-tests (2) in Converter.java left for a separate, dedicated refactor

vharseko added 2 commits July 23, 2026 18:41
Resolve 17 CodeQL note-level alerts across 15 files:
- inefficient-empty-string-test: use String.isEmpty() instead of ""-equality (8)
- inefficient-string-constructor: drop redundant new String(...) wrappers (2)
- inefficient-key-set-iterator: iterate entrySet() instead of keySet()+get() (2)
- useless-tostring-call: remove toString() on values already String (2)
- local-variable-is-never-read: remove dead local assignments (3)

Behaviour is unchanged; all touched modules compile.
- java/local-shadows-field (5): rename local variables that shadowed
  fields in CsvAuditEventHandler, JsonFileWriter, and WarningHeader
- java/call-to-object-tostring (1): log VersionedPath.getVersions()
  instead of the object's default toString() in CrestApiProducer
- py/unused-import (1): drop the unused `import sys, os` in the persistit
  doc conf.py

Behaviour is unchanged; all touched Java modules compile.
@vharseko vharseko added codeql CodeQL static-analysis findings refactoring Code cleanup / refactoring, no behavior change labels Jul 23, 2026
@vharseko
vharseko requested a review from maximthomas July 23, 2026 19:51
@vharseko
vharseko merged commit a518606 into OpenIdentityPlatform:master Jul 24, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

codeql CodeQL static-analysis findings refactoring Code cleanup / refactoring, no behavior change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants