Skip to content

Sonar mechanical sweep: idioms, functional interfaces, merge-if, logging (11 rules) - #3397

Merged
dbwiddis merged 6 commits into
oshi:masterfrom
dbwiddis:sonar-mechanical-sweep
Jun 15, 2026
Merged

dbwiddis merged 6 commits into
oshi:masterfrom
dbwiddis:sonar-mechanical-sweep

Conversation

@dbwiddis

@dbwiddis dbwiddis commented Jun 15, 2026 •

Copy link
Copy Markdown
Member

A batch of mechanical Sonar fixes, grouped into 6 thematic commits. Each finding was validated as real before fixing. No behavior change to query results; verified with a clean install -P aggregate-coverage,native-comparison (full unit suite + NativeComparisonTest green) plus checkstyle/forbiddenapis/javadoc.

Fixed (~40 findings)

  • S7158 (7) length()==0/>0 → isEmpty()
  • S4201 (1) drop redundant null check before instanceof
  • S6353 (3) / S6326 (2) concise regex (\d, \D, {2})
  • S1153 (4) drop redundant String.valueOf() in concatenation
  • S1066 (6) merge collapsible nested ifs (parenthesized where an || is involved)
  • S4276 (8) + S5411 (1) specialize functional interfaces: BiPredicate / Predicate / BinaryOperator / ToLongFunction / UnaryOperator (incl. removing the now-needless Boolean.TRUE.equals guard in IOKit)
  • S1170 (4) instance constants → static final (Linux fields renamed UPPER_CASE to stay convention-compliant)
  • S3038 (1) remove LinuxHAL's bare redundant abstract method
  • S1301 (1) demo switch → if
  • S2629 (3): RegistryUtil concat-log → parameterized; the two sysctl WARN logs guarded with isWarnEnabled() so the native getErrno() read is skipped when WARN is off
  • FQN cleanup: java.util.function.* inline/javadoc FQNs → imports

Accepted as won't-fix (with reasons), not in this diff

  • S2629 ×12 — already-parameterized logs whose only arg is a cheap Integer.toHexString(int) in rarely-taken failure branches (guarding = boilerplate for negligible gain; the native-call ones above were guarded instead)
  • S1301 ×3 (PrivilegedUtil) — single-case platform switches intentionally kept open for future-OS extensibility (comment added)
  • S3038 ×1 (AixGlobalMemory) — the abstract re-declaration carries class-specific javadoc the interface doesn't

Note on slf4j

The lazy fluent API (atWarn().addArgument(() -> …)) would have been the elegant fix for the getErrno logs, but OSHI's OSGi Import-Package pins slf4j to [1.7,3.0) and uses no 2.0-only API — so an isWarnEnabled() guard is used to stay runtime-compatible with slf4j 1.7.

Summary by CodeRabbit

  • Refactor

    • Simplified conditional logic and improved code readability across multiple modules for better maintainability.
    • Standardized string validation patterns using modern Java API conventions.
    • Refactored callback and function types to use more semantically appropriate interfaces.
  • Performance

    • Optimized native code logging to avoid unnecessary system calls when logging is disabled.
  • Documentation

    • Updated code comments and Javadoc references for consistency.

dbwiddis added 6 commits June 14, 2026 19:15
…26, S1153)

- S7158: replace length()==0 / length()>0 with isEmpty().
- S4201: drop the redundant null check before instanceof.
- S6353/S6326: concise regex classes (\d, \D) and the {2} space quantifier.
- S1153: drop redundant String.valueOf() in string concatenation.
No behavior change.
Combine each outer if whose sole body is an inner if into a single condition
(parenthesizing where an || is involved). No behavior change.
Replace generic Function/BiFunction params with the specialized interface that
fits the usage: BiPredicate (WindowsSensors, also fixing S5411 boxed-Boolean
unboxing), Predicate (IOKitProvider + JNA/FFM impls, removing the now-needless
Boolean.TRUE.equals null guard since visitors return primitive boolean),
BinaryOperator (FreeBsd/OpenBsd sysctl accessor), ToLongFunction (LinuxGraphicsCard
vram lookup), UnaryOperator (CupsPrinter driver lookup). No behavior change.
… S3038)

- S1170: instance final-constant fields -> static final (Linux IP-stats fields
  renamed to UPPER_CASE to keep them naming-convention compliant).
- S3038: remove LinuxHardwareAbstractionLayer's bare redundant abstract
  getGraphicsCards() re-declaration (still declared on the interface).
- S1301: convert the demo's single-case platform switch to an if/else. The three
  PrivilegedUtil switches are intentionally kept (extensibility for future OSes)
  with an explanatory comment.
- S2629: convert RegistryUtil's string-concat log to parameterized form, and
  guard the two sysctl WARN logs with isWarnEnabled() so the native getErrno()
  read is skipped when WARN is disabled.
Per project convention, import Supplier rather than fully-qualifying it inline
(WmiQueryHandlerFFM) or in javadoc {@link} (Memoizer).
@coderabbitai

coderabbitai Bot commented Jun 15, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: ff463e45-c815-48d9-91bc-55f9a7793dee

📥 Commits

Reviewing files that changed from the base of the PR and between 6148843 and f025123.

📒 Files selected for processing (35)
  • oshi-common/src/main/java/oshi/hardware/CentralProcessor.java
  • oshi-common/src/main/java/oshi/hardware/common/AbstractNetworkIF.java
  • oshi-common/src/main/java/oshi/hardware/common/platform/linux/LinuxCentralProcessor.java
  • oshi-common/src/main/java/oshi/hardware/common/platform/linux/LinuxGraphicsCard.java
  • oshi-common/src/main/java/oshi/hardware/common/platform/linux/LinuxHardwareAbstractionLayer.java
  • oshi-common/src/main/java/oshi/hardware/common/platform/linux/nativefree/LinuxHWDiskStoreNF.java
  • oshi-common/src/main/java/oshi/hardware/common/platform/mac/IOKitProvider.java
  • oshi-common/src/main/java/oshi/hardware/common/platform/unix/CupsPrinter.java
  • oshi-common/src/main/java/oshi/hardware/common/platform/unix/freebsd/FreeBsdHWDiskStore.java
  • oshi-common/src/main/java/oshi/hardware/common/platform/unix/openbsd/OpenBsdHWDiskStore.java
  • oshi-common/src/main/java/oshi/hardware/common/platform/windows/WindowsSensors.java
  • oshi-common/src/main/java/oshi/software/common/AbstractNetworkParams.java
  • oshi-common/src/main/java/oshi/software/common/os/linux/LinuxInternetProtocolStats.java
  • oshi-common/src/main/java/oshi/software/common/os/mac/MacInstalledApps.java
  • oshi-common/src/main/java/oshi/spi/SystemInfoFactory.java
  • oshi-common/src/main/java/oshi/util/FileSystemUtil.java
  • oshi-common/src/main/java/oshi/util/Memoizer.java
  • oshi-common/src/main/java/oshi/util/ParseUtil.java
  • oshi-common/src/main/java/oshi/util/PrivilegedUtil.java
  • oshi-common/src/main/java/oshi/util/SystemInfoHelper.java
  • oshi-common/src/main/java/oshi/util/driver/unix/Xwininfo.java
  • oshi-common/src/test/java/oshi/hardware/common/platform/linux/LinuxGraphicsCardTest.java
  • oshi-common/src/test/java/oshi/util/driver/linux/proc/ProcessStatTest.java
  • oshi-core-ffm/src/main/java/oshi/ffm/util/platform/unix/freebsd/BsdSysctlUtilFFM.java
  • oshi-core-ffm/src/main/java/oshi/ffm/util/platform/unix/openbsd/OpenBsdSysctlUtilFFM.java
  • oshi-core-ffm/src/main/java/oshi/ffm/util/platform/windows/WmiQueryHandlerFFM.java
  • oshi-core-ffm/src/main/java/oshi/hardware/platform/mac/IOKitProviderFFM.java
  • oshi-core-ffm/src/main/java/oshi/hardware/platform/mac/MacNetworkIfFFM.java
  • oshi-core-ffm/src/main/java/oshi/software/os/windows/WindowsFileSystemFFM.java
  • oshi-core-ffm/src/main/java/oshi/software/os/windows/WindowsOSProcessFFM.java
  • oshi-core/src/main/java/oshi/hardware/platform/mac/IOKitProviderJNA.java
  • oshi-core/src/main/java/oshi/software/os/windows/WindowsFileSystemJNA.java
  • oshi-core/src/main/java/oshi/util/platform/windows/RegistryUtil.java
  • oshi-demo/src/main/java/oshi/demo/jmx/JMXOshiAgentServer.java
  • oshi-demo/src/main/java/oshi/demo/jmx/mbeans/Baseboard.java
💤 Files with no reviewable changes (1)
  • oshi-common/src/main/java/oshi/hardware/common/platform/linux/LinuxHardwareAbstractionLayer.java
📜 Recent review details
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (11)
  • GitHub Check: Codacy Static Code Analysis
  • GitHub Check: Test JDK 26, macos-latest
  • GitHub Check: Lint (Spotless, Checkstyle, ForbiddenAPIs, Javadoc)
  • GitHub Check: Test JDK 25, macos-latest (+ JNA==FFM)
  • GitHub Check: Test JDK 25, windows-latest (+ JNA==FFM)
  • GitHub Check: Test JDK 21, windows-latest
  • GitHub Check: Test JDK 26, windows-latest
  • GitHub Check: Test JDK 25, FreeBSD (+ JNA==FFM)
  • GitHub Check: Test JDK 25, OpenBSD (+ JNA==FFM)
  • GitHub Check: Test JDK 25, OpenIndiana (+ JNA==FFM)
  • GitHub Check: Analyze (java)
🧰 Additional context used
🧠 Learnings (3)
📚 Learning: 2026-04-06T04:45:47.644Z
Learnt from: dbwiddis
Repo: oshi/oshi PR: 3121
File: oshi-core/src/main/java/oshi/software/os/linux/LinuxOperatingSystem.java:53-53
Timestamp: 2026-04-06T04:45:47.644Z
Learning: In the oshi/oshi project, only interfaces and classes in the root packages `oshi`, `oshi.hardware`, and `oshi.software.os` are considered the public API. Code in subpackages that represent specific implementations/platforms (e.g., `oshi.software.os.linux`, `oshi.hardware.platform.linux`, and similar subpackages) is implementation detail. When reviewing, do not treat changes to classes in these platform-specific subpackages as public API breaks (for example: making `LinuxOperatingSystem` abstract, narrowing constructor visibility, or adding/removing abstract methods should not be flagged as breaking public API).

Applied to files:

  • oshi-core/src/main/java/oshi/software/os/windows/WindowsFileSystemJNA.java
  • oshi-core/src/main/java/oshi/hardware/platform/mac/IOKitProviderJNA.java
📚 Learning: 2026-04-12T19:22:09.716Z
Learnt from: dbwiddis
Repo: oshi/oshi PR: 3149
File: oshi-common/src/main/java/oshi/hardware/common/platform/mac/MacCentralProcessor.java:159-163
Timestamp: 2026-04-12T19:22:09.716Z
Learning: When reviewing OSHI hardware platform code that uses or implements `CentralProcessor`/`PhysicalProcessor.getEfficiency()`, remember the API’s counterintuitive semantics: a *higher* efficiency-class value indicates *greater performance* (lower efficiency). P-cores/“performance cores” should therefore have higher values (e.g., 1) than E-cores/“efficiency cores” (e.g., 0), as documented in the `CentralProcessor` Javadoc. Do not flag code as incorrect solely because ARM_P_CORES or Intel P-cores are assigned higher efficiency values.

Applied to files:

  • oshi-common/src/main/java/oshi/software/common/AbstractNetworkParams.java
  • oshi-common/src/main/java/oshi/hardware/common/platform/linux/LinuxCentralProcessor.java
  • oshi-common/src/main/java/oshi/hardware/common/platform/linux/nativefree/LinuxHWDiskStoreNF.java
  • oshi-common/src/main/java/oshi/software/common/os/mac/MacInstalledApps.java
  • oshi-common/src/main/java/oshi/hardware/common/AbstractNetworkIF.java
  • oshi-common/src/main/java/oshi/util/Memoizer.java
  • oshi-common/src/main/java/oshi/spi/SystemInfoFactory.java
  • oshi-common/src/main/java/oshi/util/FileSystemUtil.java
  • oshi-common/src/main/java/oshi/hardware/common/platform/windows/WindowsSensors.java
  • oshi-common/src/main/java/oshi/util/driver/unix/Xwininfo.java
  • oshi-common/src/main/java/oshi/util/PrivilegedUtil.java
  • oshi-common/src/main/java/oshi/software/common/os/linux/LinuxInternetProtocolStats.java
  • oshi-common/src/main/java/oshi/hardware/common/platform/unix/freebsd/FreeBsdHWDiskStore.java
  • oshi-common/src/main/java/oshi/hardware/CentralProcessor.java
  • oshi-common/src/main/java/oshi/util/SystemInfoHelper.java
  • oshi-common/src/main/java/oshi/hardware/common/platform/unix/CupsPrinter.java
  • oshi-common/src/main/java/oshi/hardware/common/platform/linux/LinuxGraphicsCard.java
  • oshi-common/src/main/java/oshi/hardware/common/platform/unix/openbsd/OpenBsdHWDiskStore.java
  • oshi-common/src/main/java/oshi/hardware/common/platform/mac/IOKitProvider.java
  • oshi-common/src/main/java/oshi/util/ParseUtil.java
📚 Learning: 2026-04-12T19:34:56.879Z
Learnt from: dbwiddis
Repo: oshi/oshi PR: 3149
File: oshi-common/src/main/java/oshi/hardware/common/platform/mac/MacCentralProcessor.java:159-163
Timestamp: 2026-04-12T19:34:56.879Z
Learning: In OSHI’s Java platform implementations, `PhysicalProcessor.getEfficiency()` / `EfficiencyClass` follow the same convention as Windows `PROCESSOR_RELATIONSHIP.EfficiencyClass`: a *higher* numeric efficiency class value represents *greater performance* and *less efficiency* (typically P-cores higher than E-cores). When reviewing, do not treat cases where P-cores are assigned higher efficiency/class values as a bug—this is intentional cross-platform consistency.

Applied to files:

  • oshi-common/src/main/java/oshi/hardware/common/platform/linux/LinuxCentralProcessor.java
🔇 Additional comments (34)
oshi-common/src/main/java/oshi/hardware/common/platform/linux/nativefree/LinuxHWDiskStoreNF.java (1)

53-55: LGTM!

oshi-common/src/main/java/oshi/software/common/os/mac/MacInstalledApps.java (1)

218-220: LGTM!

oshi-common/src/main/java/oshi/spi/SystemInfoFactory.java (1)

58-59: LGTM!

oshi-core-ffm/src/main/java/oshi/hardware/platform/mac/MacNetworkIfFFM.java (1)

54-57: LGTM!

oshi-core-ffm/src/main/java/oshi/software/os/windows/WindowsFileSystemFFM.java (1)

185-190: LGTM!

oshi-core-ffm/src/main/java/oshi/software/os/windows/WindowsOSProcessFFM.java (1)

348-356: LGTM!

oshi-demo/src/main/java/oshi/demo/jmx/JMXOshiAgentServer.java (1)

119-124: LGTM!

oshi-common/src/main/java/oshi/hardware/CentralProcessor.java (1)

802-803: LGTM!

oshi-common/src/main/java/oshi/hardware/common/AbstractNetworkIF.java (1)

113-113: LGTM!

oshi-common/src/main/java/oshi/software/common/AbstractNetworkParams.java (1)

70-70: LGTM!

oshi-core/src/main/java/oshi/software/os/windows/WindowsFileSystemJNA.java (1)

234-235: LGTM!

oshi-common/src/main/java/oshi/util/SystemInfoHelper.java (1)

400-400: LGTM!

Also applies to: 493-493, 507-507, 523-523, 540-540

oshi-common/src/main/java/oshi/hardware/common/platform/linux/LinuxCentralProcessor.java (1)

96-96: LGTM!

oshi-common/src/main/java/oshi/util/FileSystemUtil.java (1)

75-75: LGTM!

oshi-common/src/main/java/oshi/util/ParseUtil.java (1)

130-130: LGTM!

Also applies to: 133-133, 998-998

oshi-common/src/main/java/oshi/util/driver/unix/Xwininfo.java (1)

35-35: LGTM!

oshi-common/src/test/java/oshi/util/driver/linux/proc/ProcessStatTest.java (1)

83-83: LGTM!

oshi-common/src/main/java/oshi/software/common/os/linux/LinuxInternetProtocolStats.java (1)

45-47: LGTM!

Also applies to: 65-67, 89-91, 115-117

oshi-demo/src/main/java/oshi/demo/jmx/mbeans/Baseboard.java (1)

35-35: LGTM!

oshi-core-ffm/src/main/java/oshi/ffm/util/platform/unix/freebsd/BsdSysctlUtilFFM.java (1)

148-151: LGTM!

oshi-core-ffm/src/main/java/oshi/ffm/util/platform/unix/openbsd/OpenBsdSysctlUtilFFM.java (1)

193-196: LGTM!

oshi-core/src/main/java/oshi/util/platform/windows/RegistryUtil.java (1)

73-73: LGTM!

oshi-common/src/main/java/oshi/util/PrivilegedUtil.java (1)

135-136: LGTM!

Also applies to: 145-146, 155-156

oshi-common/src/main/java/oshi/util/Memoizer.java (1)

52-53: LGTM!

Also applies to: 87-88

oshi-common/src/main/java/oshi/hardware/common/platform/mac/IOKitProvider.java (1)

9-9: LGTM!

Also applies to: 42-42

oshi-core-ffm/src/main/java/oshi/hardware/platform/mac/IOKitProviderFFM.java (1)

9-9: LGTM!

Also applies to: 46-46, 53-53

oshi-core/src/main/java/oshi/hardware/platform/mac/IOKitProviderJNA.java (1)

9-9: LGTM!

Also applies to: 49-49, 56-56

oshi-common/src/main/java/oshi/hardware/common/platform/windows/WindowsSensors.java (1)

11-11: LGTM!

Also applies to: 249-249, 266-266

oshi-common/src/main/java/oshi/hardware/common/platform/linux/LinuxGraphicsCard.java (1)

11-11: LGTM!

Also applies to: 217-217, 246-247, 275-275

oshi-common/src/main/java/oshi/hardware/common/platform/unix/freebsd/FreeBsdHWDiskStore.java (1)

13-13: LGTM!

Also applies to: 66-67

oshi-common/src/main/java/oshi/hardware/common/platform/unix/openbsd/OpenBsdHWDiskStore.java (1)

12-12: LGTM!

Also applies to: 46-47

oshi-common/src/main/java/oshi/hardware/common/platform/unix/CupsPrinter.java (1)

10-10: LGTM!

Also applies to: 76-77

oshi-common/src/test/java/oshi/hardware/common/platform/linux/LinuxGraphicsCardTest.java (1)

19-19: LGTM!

Also applies to: 201-201

oshi-core-ffm/src/main/java/oshi/ffm/util/platform/windows/WmiQueryHandlerFFM.java (1)

16-16: LGTM!

Also applies to: 272-272, 288-289


📝 Walkthrough

Walkthrough

A broad code-quality sweep across oshi-common, oshi-core-ffm, oshi-core, and oshi-demo that replaces generic functional interfaces (Function, BiFunction) with semantically precise alternatives (Predicate, BinaryOperator, BiPredicate, ToLongFunction, UnaryOperator), modernizes string-empty tests to isEmpty(), simplifies nested conditionals, promotes instance fields to static final, and adds lazy-evaluation guards around native logging calls.

Changes

Code Quality Sweep

Layer / File(s) Summary
Functional interface type tightening
oshi-common/.../IOKitProvider.java, oshi-core-ffm/.../IOKitProviderFFM.java, oshi-core/.../IOKitProviderJNA.java, oshi-common/.../FreeBsdHWDiskStore.java, oshi-common/.../OpenBsdHWDiskStore.java, oshi-common/.../WindowsSensors.java, oshi-common/.../CupsPrinter.java, oshi-common/.../LinuxGraphicsCard.java, oshi-common/src/test/.../LinuxGraphicsCardTest.java, oshi-core-ffm/.../WmiQueryHandlerFFM.java
IOKitProvider interface and its FFM/JNA implementations switch the forEachMatchingServiceUntil callback from Function<RegistryEntry,Boolean> to Predicate<RegistryEntry>; FreeBSD/OpenBSD disk-store getDisks moves from BiFunction<String,String,String> to BinaryOperator<String>; WindowsSensors.getAverageValueFromLHM moves from BiFunction to BiPredicate; CupsPrinter driver-lookup moves from Function<String,String> to UnaryOperator<String>; LinuxGraphicsCard.getGraphicsCardsFromLspci VRAM lookup moves from Function<String,Long> to ToLongFunction<String> with matching test update; WmiQueryHandlerFFM replaces fully-qualified java.util.function.Supplier with imported Supplier.
Abstract getGraphicsCards() removed from LinuxHardwareAbstractionLayer
oshi-common/.../LinuxHardwareAbstractionLayer.java
Drops the public abstract List<GraphicsCard> getGraphicsCards() declaration and its import, reducing the required override surface for subclasses.
String empty-check and regex modernization
oshi-common/.../CentralProcessor.java, oshi-common/.../AbstractNetworkIF.java, oshi-common/.../LinuxCentralProcessor.java, oshi-common/.../AbstractNetworkParams.java, oshi-common/.../FileSystemUtil.java, oshi-common/.../ParseUtil.java, oshi-core/.../WindowsFileSystemJNA.java, oshi-common/.../SystemInfoHelper.java, oshi-common/.../Xwininfo.java, oshi-common/src/test/.../ProcessStatTest.java
Replaces length() > 0 / length() != 0 guards with isEmpty() across multiple files; ParseUtil public constants notDigits and startWithNotDigits switch from [^0-9] to \D; LinuxCentralProcessor cpuinfo digit regex switches from [0-9]+ to \d+; Xwininfo.WINDOW_PATTERN tightens space quantifiers; SystemInfoHelper print helpers drop String.valueOf() wrapping; ProcessorCache.equals simplifies null+instanceof check.
Control flow flattening
oshi-common/.../LinuxHWDiskStoreNF.java, oshi-common/.../MacInstalledApps.java, oshi-common/.../SystemInfoFactory.java, oshi-core-ffm/.../MacNetworkIfFFM.java, oshi-core-ffm/.../WindowsFileSystemFFM.java, oshi-core-ffm/.../WindowsOSProcessFFM.java, oshi-demo/.../JMXOshiAgentServer.java
LinuxHWDiskStoreNF merges nested virtual-device skip into one condition; MacInstalledApps.parseStringArray combines <string> guard; SystemInfoFactory combines availability and priority check; MacNetworkIfFFM.queryIfDisplayName flattens BSD-name null checks; WindowsFileSystemFFM gates buffer-resize retry directly on GetLastError == 0x7A; WindowsOSProcessFFM merges ReadProcessMemory and bytesRead checks; JMXOshiAgentServer.initilizeMBeans replaces switch with if/else.
Static constants, lazy logging, and minor docs
oshi-common/.../LinuxInternetProtocolStats.java, oshi-demo/.../Baseboard.java, oshi-core-ffm/.../BsdSysctlUtilFFM.java, oshi-core-ffm/.../OpenBsdSysctlUtilFFM.java, oshi-core/.../RegistryUtil.java, oshi-common/.../PrivilegedUtil.java, oshi-common/.../Memoizer.java
LinuxInternetProtocolStats promotes three instance string fields to private static final constants; Baseboard.PROPERTIES becomes static final; BsdSysctlUtilFFM and OpenBsdSysctlUtilFFM wrap getErrno native calls with LOG.isWarnEnabled() guards; RegistryUtil trace log switches to SLF4J parameterized formatting; PrivilegedUtil adds explanatory comments above intentional switch blocks; Memoizer Javadoc uses imported Supplier link.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • oshi/oshi#3238: Directly related — that PR implements native-free Linux graphics-card classes (LinuxHardwareAbstractionLayerNF, LinuxGraphicsCardNF) that depend on the getGraphicsCards() abstract method and VRAM lookup signature being changed here.

Poem

🐇 Hop, hop, through the code I go,
Replacing BiFunction with Predicate's glow,
isEmpty() skips the old length checks too,
Static constants shine, forever brand new,
Logging guards keep native calls at bay—
A tidier warren at the end of the day! 🌿

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 52.08% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and concisely summarizes the primary change: a batch of Sonar code quality improvements across 11 mechanical rules, including idioms, functional interfaces, control flow, and logging optimizations.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov

codecov Bot commented Jun 15, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 52.83019% with 25 lines in your changes missing coverage. Please review.
✅ Project coverage is 75.04%. Comparing base (6148843) to head (f025123).

Files with missing lines Patch % Lines
...oshi/software/os/windows/WindowsFileSystemFFM.java 0.00% 4 Missing and 1 partial ⚠️
...dware/common/platform/linux/LinuxGraphicsCard.java 33.33% 1 Missing and 1 partial ⚠️
...re/common/os/linux/LinuxInternetProtocolStats.java 60.00% 0 Missing and 2 partials ⚠️
...mmon/src/main/java/oshi/util/SystemInfoHelper.java 60.00% 1 Missing and 1 partial ⚠️
...va/oshi/hardware/platform/mac/MacNetworkIfFFM.java 50.00% 0 Missing and 2 partials ⚠️
.../oshi/software/os/windows/WindowsOSProcessFFM.java 75.00% 0 Missing and 2 partials ⚠️
...n/java/oshi/hardware/common/AbstractNetworkIF.java 0.00% 0 Missing and 1 partial ⚠️
.../platform/linux/nativefree/LinuxHWDiskStoreNF.java 50.00% 0 Missing and 1 partial ⚠️
...va/oshi/software/common/AbstractNetworkParams.java 0.00% 0 Missing and 1 partial ⚠️
...mmon/src/main/java/oshi/spi/SystemInfoFactory.java 50.00% 0 Missing and 1 partial ⚠️
... and 6 more
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #3397      +/-   ##
============================================
- Coverage     75.07%   75.04%   -0.03%     
  Complexity       76       76              
============================================
  Files           579      579              
  Lines         21356    21351       -5     
  Branches       3557     3555       -2     
============================================
- Hits          16032    16022      -10     
- Misses         3299     3301       +2     
- Partials       2025     2028       +3     
Flag Coverage Δ
freebsd 26.31% <22.64%> (+<0.01%) ⬆️
linux 30.90% <28.30%> (-0.01%) ⬇️
macos 31.24% <24.52%> (+<0.01%) ⬆️
openbsd 25.80% <22.64%> (+<0.01%) ⬆️
solaris 27.87% <20.75%> (-0.02%) ⬇️
windows 39.52% <32.07%> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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