Skip to content

Fix issue with filesize being 0 and add more coverage#4017

Merged
ildyria merged 1 commit intomasterfrom
fix-issue-with-filesize-0
Jan 23, 2026
Merged

Fix issue with filesize being 0 and add more coverage#4017
ildyria merged 1 commit intomasterfrom
fix-issue-with-filesize-0

Conversation

@ildyria
Copy link
Member

@ildyria ildyria commented Jan 23, 2026

Summary by CodeRabbit

Bug Fixes

  • Fixed file size display to correctly show '0 B' when byte quantity is zero or negative

Tests

  • Added comprehensive test coverage for utility helper functions including size formatting, coordinate conversion, permissions checking, time conversion, and text processing

✏️ Tip: You can customize this high-level summary in your review settings.

@ildyria ildyria requested a review from a team as a code owner January 23, 2026 21:04
@coderabbitai
Copy link

coderabbitai bot commented Jan 23, 2026

📝 Walkthrough

Walkthrough

The changes comprise a behavioral fix in getSymbolByQuantity to handle non-positive byte values with an early return, and comprehensive unit test additions covering multiple helper functions including edge cases for null inputs, boundary values, and special scenarios.

Changes

Cohort / File(s) Summary
Helper Function Enhancement
app/Assets/Helpers.php
Added early return of '0 B' when input bytes ≤ 0 in getSymbolByQuantity, preventing edge case processing
Test Coverage Expansion
tests/Unit/HelpersUnitTest.php
Added extensive unit tests for decimalToDegreeMinutesSeconds, getSymbolByQuantity, hasPermissions, secondsToHMS, censor, and isExecAvailable with coverage for null inputs, boundary values, negative numbers, and special cases

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Poem

🐰 A fix for the bytes that go astray,
When numbers turn negative, we return '0 B' today,
While tests bloom like carrots in the field so wide,
Every edge case caught, nothing left to hide! 🥕

🚥 Pre-merge checks | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 14.29% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.

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


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.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

@ildyria ildyria merged commit f2e91cb into master Jan 23, 2026
41 checks passed
@ildyria ildyria deleted the fix-issue-with-filesize-0 branch January 23, 2026 21:31
@codecov
Copy link

codecov bot commented Jan 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.07%. Comparing base (566db27) to head (b077cb0).
⚠️ Report is 1 commits behind head on master.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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