Skip to content

Add methods to check for size and empty collections#1838

Merged
uhafner merged 1 commit intomainfrom
ensure-size
Apr 22, 2026
Merged

Add methods to check for size and empty collections#1838
uhafner merged 1 commit intomainfrom
ensure-size

Conversation

@uhafner
Copy link
Copy Markdown
Owner

@uhafner uhafner commented Apr 21, 2026

Provides some new checks like:

Ensure.that(new String[]{""}).hasSize(1);
Ensure.that(new String[0]).isEmpty();
Ensure.that(new String[]{""}).isNotEmpty();

Ensure.that(Set.of("")).hasSize(1);
Ensure.that(Set.of()).isEmpty();
Ensure.that(Set.of("")).isNotEmpty();

@uhafner uhafner added the enhancement Enhancement of existing functionality label Apr 21, 2026
@github-actions
Copy link
Copy Markdown

☀️   Quality Monitor

Tests

   JUnit   Unit Tests: ✅ successful — 87 passed, 2 skipped
   ⛔   Architecture Tests: ✅ successful — 17 passed, 2 skipped

Coverage for New Code

   〰️   Line Coverage: 87.50% — 6 missed lines
   ➰   Branch Coverage: 94.44% — 1 missed branches
   PIT   Mutation Coverage: 79.31% — 6 survived mutations
   💪   Test Strength: 100.00% — perfect 🎉

Coverage for Whole Project

   〰️   Line Coverage: 92.03% — 64 missed lines
   ➰   Branch Coverage: 92.04% — 18 missed branches
   PIT   Mutation Coverage: 91.16% — 29 survived mutations
   💪   Test Strength: 93.15% — 22 survived mutations in tested code

Style

   CheckStyle   CheckStyle: No warnings
   PMD   PMD: No warnings
   ☕   Java Compiler: No warnings

Bugs

   SpotBugs   SpotBugs: No bugs
   🐛   Error Prone: No bugs

API Problems

   🚫   Revapi: 8 warnings — low: 8

Vulnerabilities

   🛡️   OWASP Dependency Check: No vulnerabilities

Software Metrics

   🌀   Cyclomatic Complexity: 397 (total)
   💭   Cognitive Complexity: 173 (total)
   ➿   N-Path Complexity: 361 (total)
   📏   Lines of Code: 4722 (total)
   📝   Non Commenting Source Statements: 1338 (total)
   🔗   Class Cohesion: 71.43% (maximum)
   ⚖️   Weight of Class: 100.00% (maximum)

🚦 Quality Gates

Overall Status: ❗ UNSTABLE

✅ Passed Gates

  • ✅ Overall Tests Success Rate: 100.00 >= 100.00
  • ✅ Branch Coverage in New Code: 94.44 >= 90.00
  • ✅ Potential Bugs in Whole Project: 0.00 <= 0.00
  • ✅ Style Violation in Whole Project: 0.00 <= 0.00

❌ Failed Gates

  • ❌ Line Coverage in New Code: 87.50 >= 90.00
  • ❌ Mutation Coverage in New Code: 79.31 >= 90.00

Created by Quality Monitor v4.10.0 (#a182a22). More details are shown in the GitHub Checks Result.

@uhafner uhafner merged commit ee3a652 into main Apr 22, 2026
16 checks passed
@uhafner uhafner deleted the ensure-size branch April 22, 2026 08:03
uhafner added a commit to uhafner/warnings-ng-plugin-devenv that referenced this pull request Apr 22, 2026
Using width and height seems broken in GitHub now.

Example: uhafner/codingstyle#1838 (comment)
-4294422846
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Enhancement of existing functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant